diff options
author | foo86 <foobaz86@gmail.com> | 2016-04-27 10:19:54 -0700 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2016-05-01 00:13:37 -0300 |
commit | de28e73cce03b1de8b63683b70e4d0241161cca1 (patch) | |
tree | 358fde1e3910d85db649c79ab0e77af51fce53be | |
parent | 9a499e0ae7dd271e7e718bfe787e248bf3b4011f (diff) | |
download | ffmpeg-de28e73cce03b1de8b63683b70e4d0241161cca1.tar.gz |
avcodec/dcaenc: reuse shared quant levels table
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/dcaenc.c | 8 | ||||
-rw-r--r-- | libavcodec/dcaenc.h | 7 |
2 files changed, 4 insertions, 11 deletions
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index ab40e37b32..d562a27596 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -683,7 +683,7 @@ static int calc_one_scale(int32_t peak_cb, int abits, softfloat *quant) continue; our_quant.m = mul32(scalefactor_inv[our_nscale - try_remove].m, stepsize_inv[abits].m); our_quant.e = scalefactor_inv[our_nscale - try_remove].e + stepsize_inv[abits].e - 17; - if ((quant_levels[abits] - 1) / 2 < quantize_value(peak, our_quant)) + if ((ff_dca_quant_levels[abits] - 1) / 2 < quantize_value(peak, our_quant)) continue; our_nscale -= try_remove; } @@ -693,7 +693,7 @@ static int calc_one_scale(int32_t peak_cb, int abits, softfloat *quant) quant->m = mul32(scalefactor_inv[our_nscale].m, stepsize_inv[abits].m); quant->e = scalefactor_inv[our_nscale].e + stepsize_inv[abits].e - 17; - av_assert0((quant_levels[abits] - 1) / 2 >= quantize_value(peak, *quant)); + av_assert0((ff_dca_quant_levels[abits] - 1) / 2 >= quantize_value(peak, *quant)); return our_nscale; } @@ -858,9 +858,9 @@ static void put_subframe_samples(DCAEncContext *c, int ss, int band, int ch) for (i = 0; i < 8; i += 4) { sum = 0; for (j = 3; j >= 0; j--) { - sum *= quant_levels[c->abits[band][ch]]; + sum *= ff_dca_quant_levels[c->abits[band][ch]]; sum += c->quantized[ss * 8 + i + j][band][ch]; - sum += (quant_levels[c->abits[band][ch]] - 1) / 2; + sum += (ff_dca_quant_levels[c->abits[band][ch]] - 1) / 2; } put_bits(&c->pb, bit_consumption[c->abits[band][ch]] / 4, sum); } diff --git a/libavcodec/dcaenc.h b/libavcodec/dcaenc.h index 0443ca6511..bafc3c00d2 100644 --- a/libavcodec/dcaenc.h +++ b/libavcodec/dcaenc.h @@ -103,11 +103,4 @@ static const int bit_consumption[27] = { 272, 288, 304, 320, 336, 352, 368, }; -/* Table B.5: Selection of quantization levels and codebooks */ -static const int quant_levels[27] = { - 1, 3, 5, 7, 9, 13, 17, 25, 32, 64, - 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, - 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, -}; - #endif /* AVCODEC_DCAENC_H */ |