aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2023-12-11 02:26:10 +0100
committerClément Bœsch <u@pkh.me>2024-01-10 14:08:00 +0100
commit8fb2e96d7e61891b415b63dcbaaa77f6fdc00f4b (patch)
treed9f05cb53bb8c3a33cd5ebc971005815d95066f3 /libavcodec
parent096a69ad43a6bd1602c90cb7d6009d5158e32726 (diff)
downloadffmpeg-8fb2e96d7e61891b415b63dcbaaa77f6fdc00f4b.tar.gz
avcodec/proresenc_anatoliy: execute AC run/level FFMIN() at assignment
This matches the logic from the function of the same name in proresenc_kostya.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/proresenc_anatoliy.c12
1 files 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;
}