diff mbox series

[FFmpeg-devel,24/35] avcodec/proresenc_anatoliy: rename TO_GOLOMB() to MAKE_CODE()

Message ID 20231211014429.1841681-25-u@pkh.me
State Accepted
Commit 87ba89281c4e13ef9618821f27f2c642dfd1b41b
Headers show
Series [FFmpeg-devel,01/35] avcodec/proresenc_kostya: remove an unnecessary parenthesis level in MAKE_CODE() macro | expand

Commit Message

Clément Bœsch Dec. 11, 2023, 1:35 a.m. UTC
This matches the name in proresenc_kostya.
---
 libavcodec/proresenc_anatoliy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Sabatini Dec. 18, 2023, 10:32 p.m. UTC | #1
On date Monday 2023-12-11 02:35:25 +0100, Clément Bœsch wrote:
> This matches the name in proresenc_kostya.
> ---
>  libavcodec/proresenc_anatoliy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index 43dee7f79b..4b72798689 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -256,7 +256,7 @@ static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
>  }
>  
>  #define GET_SIGN(x)  ((x) >> 31)
> -#define TO_GOLOMB(val) (((val) * 2) ^ GET_SIGN(val))
> +#define MAKE_CODE(x) (((x) * 2) ^ GET_SIGN(x))
>  #define TO_GOLOMB2(val,sign) ((val)==0 ? 0 : ((val) << 1) + (sign))

LGTM.
diff mbox series

Patch

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 43dee7f79b..4b72798689 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -256,7 +256,7 @@  static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
 }
 
 #define GET_SIGN(x)  ((x) >> 31)
-#define TO_GOLOMB(val) (((val) * 2) ^ GET_SIGN(val))
+#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)
@@ -274,7 +274,7 @@  static void encode_dcs(PutBitContext *pb, int16_t *blocks,
     int dc, delta, diff_sign, code;
 
     prev_dc = (blocks[0] - 0x4000) / qmat[0];
-    codebook = TO_GOLOMB(prev_dc);
+    codebook = MAKE_CODE(prev_dc);
     encode_vlc_codeword(pb, FIRST_DC_CB, codebook);
     blocks  += 64;