Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -267,20 +267,20 @@ static av_always_inline int get_level(int val) · 266 unmodified lines | ||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
| 270 | −static void encode_dc_coeffs(PutBitContext *pb, int16_t *in, | |
| 271 | − int blocks_per_slice, int *qmat) | |
| 270 | +static void encode_dcs(PutBitContext *pb, int16_t *blocks, | |
| 271 | + int blocks_per_slice, int *qmat) | |
| 272 | 272 | { |
| 273 | 273 | int prev_dc, codebook; |
| 274 | 274 | int i, sign, idx; |
| 275 | 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 | 278 | codebook = TO_GOLOMB(prev_dc); |
| 279 | 279 | encode_vlc_codeword(pb, FIRST_DC_CB, codebook); |
| 280 | 280 | |
| 281 | 281 | codebook = 5; sign = 0; idx = 64; |
| 282 | 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 | 284 | delta = new_dc - prev_dc; |
| 285 | 285 | diff_sign = DIFF_SIGN(delta, sign); |
| 286 | 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 | 388 | blocks_per_slice = mb_count << (2 - sub_sample_chroma); |
| 389 | 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 | 392 | encode_ac_coeffs(&pb, blocks, blocks_per_slice, qmat, ff_prores_scan); |
| 393 | 393 | |
| 394 | 394 | flush_put_bits(&pb); |