summaryrefslogtreecommitdiff
path: root/libavcodec/aaccoder.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2011-04-26 14:45:48 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-04-27 12:39:37 -0400
commitd70fa4c4238ffa69592fffa7c817532534f303c4 (patch)
treebb1d0fdf72e89cce8fad6093fdb7cafef43752f6 /libavcodec/aaccoder.c
parente4744b59aadd6e7064491c0228d6248289a6a85a (diff)
Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets instead
of hardcoding 200 everywhere.
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r--libavcodec/aaccoder.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index bc59ac5052..15fe430732 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -108,8 +108,8 @@ static av_always_inline float quantize_and_encode_band_cost_template(
int *bits, int BT_ZERO, int BT_UNSIGNED,
int BT_PAIR, int BT_ESC)
{
- const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
- const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
+ const float IQ = ff_aac_pow2sf_tab[POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
+ const float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
const float CLIPPED_ESCAPE = 165140.0f*IQ;
int i, j;
float cost = 0;
@@ -280,7 +280,7 @@ static float find_max_val(int group_len, int swb_size, const float *scaled) {
}
static int find_min_book(float maxval, int sf) {
- float Q = ff_aac_pow2sf_tab[200 - sf + SCALE_ONE_POS - SCALE_DIV_512];
+ float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
float Q34 = sqrtf(Q * sqrtf(Q));
int qmaxval, cb;
qmaxval = maxval * Q34 + 0.4054f;
@@ -955,7 +955,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
dist -= b;
}
dist *= 1.0f / 512.0f / lambda;
- quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[200 - scf + SCALE_ONE_POS - SCALE_DIV_512]);
+ quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[POW_SF2_ZERO - scf + SCALE_ONE_POS - SCALE_DIV_512]);
if (quant_max >= 8191) { // too much, return to the previous quantizer
sce->sf_idx[w*16+g] = prev_scf;
break;