[FFmpeg-cvslog] avcodec/proresenc_anatoliy: execute AC run/level FFMIN() at assignment
Clément Bœsch
git at videolan.org
Wed Jan 10 15:22:49 EET 2024
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Dec 11 02:26:10 2023 +0100| [8fb2e96d7e61891b415b63dcbaaa77f6fdc00f4b] | committer: Clément Bœsch
avcodec/proresenc_anatoliy: execute AC run/level FFMIN() at assignment
This matches the logic from the function of the same name in proresenc_kostya.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fb2e96d7e61891b415b63dcbaaa77f6fdc00f4b
---
libavcodec/proresenc_anatoliy.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index bc25b96965..c0e8e69cf7 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -298,18 +298,18 @@ static void encode_acs(PutBitContext *pb, int16_t *blocks,
for (idx = scan[i]; idx < max_coeffs; idx += 64) {
int val = blocks[idx] / qmat[scan[i]];
if (val) {
- encode_vlc_codeword(pb, ff_prores_run_to_cb[FFMIN(prev_run, 15)], run);
+ encode_vlc_codeword(pb, ff_prores_run_to_cb[prev_run], run);
- prev_run = run;
- run = 0;
level = FFABS(val);
code = level - 1;
- encode_vlc_codeword(pb, ff_prores_level_to_cb[FFMIN(prev_level, 9)], code);
-
- prev_level = level;
+ encode_vlc_codeword(pb, ff_prores_level_to_cb[prev_level], code);
put_sbits(pb, 1, GET_SIGN(val));
+
+ prev_run = FFMIN(run, 15);
+ prev_level = FFMIN(level, 9);
+ run = 0;
} else {
++run;
}
More information about the ffmpeg-cvslog
mailing list