diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-10-27 14:27:36 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:45 +0100 |
commit | 3f4cfc48dd8eabd8f78a2bcb5ed121bc936fd4cc (patch) | |
tree | 779e4d2a4557e22f57d94b134948ce2ea2ff8a06 /libavcodec/cook.c | |
parent | 530d86b90d5f776844a936d5fcf1393cc0cd439c (diff) | |
download | ffmpeg-3f4cfc48dd8eabd8f78a2bcb5ed121bc936fd4cc.tar.gz |
avcodec/cook: Apply offset when initializing VLC table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r-- | libavcodec/cook.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c index f22fd02209..7756098d97 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -200,7 +200,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result |= ff_init_vlc_from_lengths(&q->envelope_quant_index[i], 9, 24, envelope_quant_index_huffbits[i], 1, envelope_quant_index_huffsyms[i], 1, 1, - 0, 0, q->avctx); + -12, 0, q->avctx); } av_log(q->avctx, AV_LOG_DEBUG, "sqvh VLC init\n"); for (i = 0; i < 7; i++) { @@ -385,7 +385,7 @@ static int decode_envelope(COOKContext *q, COOKSubpacket *p, j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index - 1].table, q->envelope_quant_index[vlc_index - 1].bits, 2); - quant_index_table[i] = quant_index_table[i - 1] + j - 12; // differential encoding + quant_index_table[i] = quant_index_table[i - 1] + j; // differential encoding if (quant_index_table[i] > 63 || quant_index_table[i] < -63) { av_log(q->avctx, AV_LOG_ERROR, "Invalid quantizer %d at position %d, outside [-63, 63] range\n", |