History

avcodec/proresenc_anatoliy: execute AC run/level FFMIN() at assignment

This matches the logic from the function of the same name in proresenc_kostya.

Clément Bœsch committed 2 years ago

Commit 8fb2e961 parent 096a69a1 file · +6 −6Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/proresenc_anatoliy.c+6−6
@@ -298,18 +298,18 @@ static void encode_acs(PutBitContext *pb, int16_t *blocks, · 297 unmodified lines
298 for (idx = scan[i]; idx < max_coeffs; idx += 64) {298 for (idx = scan[i]; idx < max_coeffs; idx += 64) {
299 int val = blocks[idx] / qmat[scan[i]];299 int val = blocks[idx] / qmat[scan[i]];
300 if (val) {300 if (val) {
301 encode_vlc_codeword(pb, ff_prores_run_to_cb[FFMIN(prev_run, 15)], run);301 encode_vlc_codeword(pb, ff_prores_run_to_cb[prev_run], run);
302 302
303 prev_run = run;
304 run = 0;
305 level = FFABS(val);303 level = FFABS(val);
306 code = level - 1;304 code = level - 1;
307 305
308 encode_vlc_codeword(pb, ff_prores_level_to_cb[FFMIN(prev_level, 9)], code);306 encode_vlc_codeword(pb, ff_prores_level_to_cb[prev_level], code);
309
310 prev_level = level;
311 307
312 put_sbits(pb, 1, GET_SIGN(val));308 put_sbits(pb, 1, GET_SIGN(val));
309
310 prev_run = FFMIN(run, 15);
311 prev_level = FFMIN(level, 9);
312 run = 0;
313 } else {313 } else {
314 ++run;314 ++run;
315 }315 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t