[FFmpeg-cvslog] avcodec/proresenc_anatoliy: remove TO_GOLOMB2()
Clément Bœsch
git at videolan.org
Wed Jan 10 15:22:37 EET 2024
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Dec 11 02:11:00 2023 +0100| [e87bc5641ce64df6bd00871ba7ada8a94db90c68] | committer: Clément Bœsch
avcodec/proresenc_anatoliy: remove TO_GOLOMB2()
A few cosmetics aside, this makes the function identical to the one with
the same name in proresenc_kostya.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e87bc5641ce64df6bd00871ba7ada8a94db90c68
---
libavcodec/proresenc_anatoliy.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index b193ff5cf8..993fa9831b 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -257,7 +257,6 @@ static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
#define GET_SIGN(x) ((x) >> 31)
#define MAKE_CODE(x) (((x) * 2) ^ GET_SIGN(x))
-#define TO_GOLOMB2(val,sign) ((val)==0 ? 0 : ((val) << 1) + (sign))
static av_always_inline int get_level(int val)
{
@@ -271,7 +270,6 @@ static void encode_dcs(PutBitContext *pb, int16_t *blocks,
{
int i;
int codebook = 5, code, dc, prev_dc, delta, sign, new_sign;
- int diff_sign;
prev_dc = (blocks[0] - 0x4000) / scale;
encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc));
@@ -282,8 +280,8 @@ static void encode_dcs(PutBitContext *pb, int16_t *blocks,
dc = (blocks[0] - 0x4000) / scale;
delta = dc - prev_dc;
new_sign = GET_SIGN(delta);
- diff_sign = new_sign ^ sign;
- code = TO_GOLOMB2(get_level(delta), diff_sign);
+ delta = (delta ^ sign) - sign;
+ code = MAKE_CODE(delta);
encode_vlc_codeword(pb, ff_prores_dc_codebook[codebook], code);
More information about the ffmpeg-cvslog
mailing list