diff options
author | Clément Bœsch <u@pkh.me> | 2023-12-11 01:52:23 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2024-01-10 14:08:00 +0100 |
commit | 273f591a3d1cc19f7d6621c9a214c69475f06b04 (patch) | |
tree | a875d2223157bcc2d0a159918213c49805437099 /libavcodec/proresenc_anatoliy.c | |
parent | dadc5ac24aae78e89c37d5d65c5f30cff28eb577 (diff) | |
download | ffmpeg-273f591a3d1cc19f7d6621c9a214c69475f06b04.tar.gz |
avcodec/proresenc_anatoliy: directly work with blocks in encode_dcs()
This makes the function closer to encode_dcs() in proresenc_kostya.
Diffstat (limited to 'libavcodec/proresenc_anatoliy.c')
-rw-r--r-- | libavcodec/proresenc_anatoliy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index d9c6bfe917..94610d5bc2 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -271,16 +271,17 @@ static void encode_dcs(PutBitContext *pb, int16_t *blocks, int blocks_per_slice, int *qmat) { int prev_dc, codebook; - int i, sign, idx; + int i, sign; int new_dc, delta, diff_sign, code; prev_dc = (blocks[0] - 0x4000) / qmat[0]; codebook = TO_GOLOMB(prev_dc); encode_vlc_codeword(pb, FIRST_DC_CB, codebook); + blocks += 64; - codebook = 5; sign = 0; idx = 64; - for (i = 1; i < blocks_per_slice; i++, idx += 64) { - new_dc = (blocks[idx] - 0x4000) / qmat[0]; + codebook = 5; sign = 0; + for (i = 1; i < blocks_per_slice; i++, blocks += 64) { + new_dc = (blocks[0] - 0x4000) / qmat[0]; delta = new_dc - prev_dc; diff_sign = DIFF_SIGN(delta, sign); code = TO_GOLOMB2(get_level(delta), diff_sign); |