diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-08-25 14:00:30 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-08-25 14:00:30 +0400 |
commit | f8347c41671199c119843debde48f477961ace9f (patch) | |
tree | 870e1c6f746c23f822ddf9c351a18e8393e5645b /libavcodec/mpegaudiodec.c | |
parent | 7ca1ed0d9ca2952ec01448a9b9b4c11dadc13851 (diff) |
replace l3_unscale(1, exponents[pos]) by LUT
Originally committed as revision 6082 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 562978cdeb..e7fba1f2da 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -173,6 +173,7 @@ static uint16_t band_index_long[9][23]; #define TABLE_4_3_SIZE (8191 + 16)*4 static int8_t *table_4_3_exp; static uint32_t *table_4_3_value; +static uint32_t exp_table[512]; /* intensity stereo coef table */ static int32_t is_table[2][16]; static int32_t is_table_lsf[2][2][16]; @@ -428,6 +429,11 @@ static int decode_init(AVCodecContext * avctx) // av_log(NULL, AV_LOG_DEBUG, "%d %d %f\n", i, m, pow((double)i, 4.0 / 3.0)); table_4_3_exp[i] = -e; } + for(i=0; i<512; i++){ + int exponent= i-400; + double f= pow(1, 4.0 / 3.0) * pow(2, exponent*0.25 + FRAC_BITS + 5); + exp_table[i]= lrintf(f); + } for(i=0;i<7;i++) { float f; @@ -1760,7 +1766,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, const static int idxtab[16]={3,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0}; int pos= s_index+idxtab[code]; code ^= 8>>idxtab[code]; - v = l3_unscale(1, exponents[pos]); + v = exp_table[ exponents[pos] + 400]; if(get_bits1(&s->gb)) v = -v; g->sb_hybrid[pos] = v; |