diff options
author | Clément Bœsch <u@pkh.me> | 2023-12-11 01:54:37 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2024-01-10 14:08:00 +0100 |
commit | 17392ca84fb411d13a2663bbd3e4fad397efb017 (patch) | |
tree | e3a51b7d5504decdd52fe4e706d19d975a4c8d5d | |
parent | 273f591a3d1cc19f7d6621c9a214c69475f06b04 (diff) | |
download | ffmpeg-17392ca84fb411d13a2663bbd3e4fad397efb017.tar.gz |
avcodec/proresenc_anatoliy: import GET_SIGN() macro from Kostya encoder and use it
-rw-r--r-- | libavcodec/proresenc_anatoliy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 94610d5bc2..fe7b3e9ef3 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) |