summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-05-11 21:31:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-05-11 21:31:54 +0000
commit3b7117b73a2b88e8c36ed9bd23324370b027f2ee (patch)
tree7bf5e6109ba2f366df77a853fc7f076b181d6b0c /libavcodec/mpegaudiodec.c
parent4b070a7a613f680075ea6ca01303293b94b60523 (diff)
Do the same sign flip optimization to the low freq decoder.
as with the high freq 10-20 cycles faster Originally committed as revision 23099 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 2279b8daaa..b12939f566 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1454,7 +1454,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
/* read huffcode and compute each couple */
for(;j>0;j--) {
int exponent, x, y;
- INTFLOAT v;
+ int v;
int pos= get_bits_count(&s->gb);
if (pos >= end_pos){
@@ -1481,37 +1481,36 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
x = y >> 5;
y = y & 0x0f;
if (x < 15){
- v = RENAME(expval_table)[ exponent ][ x ];
-// v = RENAME(expval_table)[ (exponent&3) ][ x ] >> FFMIN(0 - (exponent>>2), 31);
+ READ_FLIP_SIGN(g->sb_hybrid+s_index, RENAME(expval_table)[ exponent ]+x)
}else{
x += get_bitsz(&s->gb, linbits);
v = l3_unscale(x, exponent);
+ if (get_bits1(&s->gb))
+ v = -v;
+ g->sb_hybrid[s_index] = v;
}
- if (get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[s_index] = v;
if (y < 15){
- v = RENAME(expval_table)[ exponent ][ y ];
+ READ_FLIP_SIGN(g->sb_hybrid+s_index+1, RENAME(expval_table)[ exponent ]+y)
}else{
y += get_bitsz(&s->gb, linbits);
v = l3_unscale(y, exponent);
+ if (get_bits1(&s->gb))
+ v = -v;
+ g->sb_hybrid[s_index+1] = v;
}
- if (get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[s_index+1] = v;
}else{
x = y >> 5;
y = y & 0x0f;
x += y;
if (x < 15){
- v = RENAME(expval_table)[ exponent ][ x ];
+ READ_FLIP_SIGN(g->sb_hybrid+s_index+!!y, RENAME(expval_table)[ exponent ]+x)
}else{
x += get_bitsz(&s->gb, linbits);
v = l3_unscale(x, exponent);
+ if (get_bits1(&s->gb))
+ v = -v;
+ g->sb_hybrid[s_index+!!y] = v;
}
- if (get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[s_index+!!y] = v;
g->sb_hybrid[s_index+ !y] = 0;
}
s_index+=2;