diff mbox series

[FFmpeg-devel,19/35] avcodec/proresenc_anatoliy: import GET_SIGN() macro from Kostya encoder and use it

Message ID 20231211014429.1841681-20-u@pkh.me
State Accepted
Commit 17392ca84fb411d13a2663bbd3e4fad397efb017
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
---
 libavcodec/proresenc_anatoliy.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Stefano Sabatini Dec. 18, 2023, 12:30 a.m. UTC | #1
On date Monday 2023-12-11 02:35:20 +0100, Clément Bœsch wrote:
> ---
>  libavcodec/proresenc_anatoliy.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

LGTM
diff mbox series

Patch

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index a418a12705..0de262c9c5 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -255,9 +255,10 @@  static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
     }
 }
 
-#define TO_GOLOMB(val) (((val) * 2) ^ ((val) >> 31))
-#define DIFF_SIGN(val, sign) (((val) >> 31) ^ (sign))
-#define IS_NEGATIVE(val) ((((val) >> 31) ^ -1) + 1)
+#define GET_SIGN(x)  ((x) >> 31)
+#define TO_GOLOMB(val) (((val) * 2) ^ GET_SIGN(val))
+#define DIFF_SIGN(val, sign) (GET_SIGN(val) ^ (sign))
+#define IS_NEGATIVE(val) ((GET_SIGN(val) ^ -1) + 1)
 #define TO_GOLOMB2(val,sign) ((val)==0 ? 0 : ((val) << 1) + (sign))
 
 static av_always_inline int get_level(int val)