[FFmpeg-cvslog] avcodec/proresenc_anatoliy: replace get_level() with FFABS()

Clément Bœsch git at videolan.org
Wed Jan 10 15:22:41 EET 2024


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Dec 11 02:14:51 2023 +0100| [3543100a059fa146f501705a2c4c6dd2aff88831] | committer: Clément Bœsch

avcodec/proresenc_anatoliy: replace get_level() with FFABS()

This matches the code from proresenc_kostya.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3543100a059fa146f501705a2c4c6dd2aff88831
---

 libavcodec/proresenc_anatoliy.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 7c63d872fc..9ea7a90d00 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -258,13 +258,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))
 
-static av_always_inline int get_level(int val)
-{
-    int sign = (val >> 31);
-    return (val ^ sign) - sign;
-}
-
-
 static void encode_dcs(PutBitContext *pb, int16_t *blocks,
                        int blocks_per_slice, int scale)
 {
@@ -305,7 +298,7 @@ static void encode_ac_coeffs(PutBitContext *pb,
 
                 prev_run   = run;
                 run        = 0;
-                level      = get_level(val);
+                level      = FFABS(val);
                 code       = level - 1;
 
                 encode_vlc_codeword(pb, ff_prores_level_to_cb[FFMIN(prev_level, 9)], code);



More information about the ffmpeg-cvslog mailing list