diff options
author | Rostislav Pehlivanov <rpehlivanov@ob-encoder.com> | 2016-06-23 18:06:59 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2016-07-11 23:38:01 +0100 |
commit | 09d89d940635e34b0f61266d66fbb9802b18564c (patch) | |
tree | 972503d5dd77694917501c035e0e5ad4e253df95 /libavcodec/diracdec.c | |
parent | b9c6c5f4539dfaf26e8484aece1b39f0a55f8fff (diff) | |
download | ffmpeg-09d89d940635e34b0f61266d66fbb9802b18564c.tar.gz |
diractab: expose the maximum quantization index as a macro
Prevents having to have random magic values in the decoder and a
separate macro in the encoder.
Signed-off-by: Rostislav Pehlivanov <rpehlivanov@obe.tv>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r-- | libavcodec/diracdec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index c5d00b9a8d..ad33809413 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -486,7 +486,7 @@ static inline void codeblock(DiracContext *s, SubBand *b, b->quant = quant; } - if (b->quant > 115) { + if (b->quant > DIRAC_MAX_QUANT_INDEX) { av_log(s->avctx, AV_LOG_ERROR, "Unsupported quant %d\n", b->quant); b->quant = 0; return; @@ -676,12 +676,12 @@ static void decode_subband(DiracContext *s, GetBitContext *gb, int quant, uint8_t *buf2 = b2 ? b2->ibuf + top * b2->stride: NULL; int x, y; - if (quant > 115) { + if (quant > DIRAC_MAX_QUANT_INDEX) { av_log(s->avctx, AV_LOG_ERROR, "Unsupported quant %d\n", quant); return; } - qfactor = ff_dirac_qscale_tab[quant & 0x7f]; - qoffset = ff_dirac_qoffset_intra_tab[quant & 0x7f] + 2; + qfactor = ff_dirac_qscale_tab[quant]; + qoffset = ff_dirac_qoffset_intra_tab[quant] + 2; /* we have to constantly check for overread since the spec explicitly requires this, with the meaning that all remaining coeffs are set to 0 */ if (get_bits_count(gb) >= bits_end) |