diff options
author | Nathan Caldwell <saintdev@gmail.com> | 2012-01-06 14:24:37 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2012-01-23 11:40:46 -0800 |
commit | 80d44277e6ae6291a1ddba476939bb394a2ed822 (patch) | |
tree | bcc4b85abcf2bf33f2abfe5f3588afb1334db234 /libavcodec/aaccoder.c | |
parent | 025ccf1f8bd669f45b628acf51e7febcb1fddd3b (diff) | |
download | ffmpeg-80d44277e6ae6291a1ddba476939bb394a2ed822.tar.gz |
aacenc: Move Q^3/4 calculation to it's own table
This should be moved to tablegen at some point.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r-- | libavcodec/aaccoder.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index ec78acc936..72be2a272b 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -110,14 +110,15 @@ 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[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 int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512; + const float Q = ff_aac_pow2sf_tab [q_idx]; + const float Q34 = ff_aac_pow34sf_tab[q_idx]; + const float IQ = 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; const int dim = BT_PAIR ? 2 : 4; int resbits = 0; - const float Q34 = sqrtf(Q * sqrtf(Q)); const int range = aac_cb_range[cb]; const int maxval = aac_cb_maxval[cb]; int off; |