History

avcodec/proresenc_anatoliy: reduce DC encoding function prototype differences with Kostya encoder

Clément Bœsch committed 2 years ago

Commit dadc5ac1 parent 8e42d3a1 file · +5 −5Browse files

Unified · Split

libavcodec/proresenc_anatoliy.c+5−5
@@ -267,20 +267,20 @@ static av_always_inline int get_level(int val) · 266 unmodified lines
267}267}
268 268
269 269
270static void encode_dc_coeffs(PutBitContext *pb, int16_t *in,270static void encode_dcs(PutBitContext *pb, int16_t *blocks,
271 int blocks_per_slice, int *qmat)271 int blocks_per_slice, int *qmat)
272{272{
273 int prev_dc, codebook;273 int prev_dc, codebook;
274 int i, sign, idx;274 int i, sign, idx;
275 int new_dc, delta, diff_sign, code;275 int new_dc, delta, diff_sign, code;
276 276
277 prev_dc = (in[0] - 0x4000) / qmat[0];277 prev_dc = (blocks[0] - 0x4000) / qmat[0];
278 codebook = TO_GOLOMB(prev_dc);278 codebook = TO_GOLOMB(prev_dc);
279 encode_vlc_codeword(pb, FIRST_DC_CB, codebook);279 encode_vlc_codeword(pb, FIRST_DC_CB, codebook);
280 280
281 codebook = 5; sign = 0; idx = 64;281 codebook = 5; sign = 0; idx = 64;
282 for (i = 1; i < blocks_per_slice; i++, idx += 64) {282 for (i = 1; i < blocks_per_slice; i++, idx += 64) {
283 new_dc = (in[idx] - 0x4000) / qmat[0];283 new_dc = (blocks[idx] - 0x4000) / qmat[0];
284 delta = new_dc - prev_dc;284 delta = new_dc - prev_dc;
285 diff_sign = DIFF_SIGN(delta, sign);285 diff_sign = DIFF_SIGN(delta, sign);
286 code = TO_GOLOMB2(get_level(delta), diff_sign);286 code = TO_GOLOMB2(get_level(delta), diff_sign);
@@ -388,7 +388,7 @@ static int encode_slice_plane(int16_t *blocks, int mb_count, uint8_t *buf, unsig · 101 unmodified lines
388 blocks_per_slice = mb_count << (2 - sub_sample_chroma);388 blocks_per_slice = mb_count << (2 - sub_sample_chroma);
389 init_put_bits(&pb, buf, buf_size);389 init_put_bits(&pb, buf, buf_size);
390 390
391 encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);391 encode_dcs(&pb, blocks, blocks_per_slice, qmat);
392 encode_ac_coeffs(&pb, blocks, blocks_per_slice, qmat, ff_prores_scan);392 encode_ac_coeffs(&pb, blocks, blocks_per_slice, qmat, ff_prores_scan);
393 393
394 flush_put_bits(&pb);394 flush_put_bits(&pb);

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