Commit 2be00d2a authored by michael's avatar michael

avoid reading exponent twice


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6085 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 92e0cd79
...@@ -1703,6 +1703,8 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, ...@@ -1703,6 +1703,8 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
/* read huffcode and compute each couple */ /* read huffcode and compute each couple */
for(;j>0;j--) { for(;j>0;j--) {
int exponent;
if (get_bits_count(&s->gb) >= end_pos) if (get_bits_count(&s->gb) >= end_pos)
break; break;
y = get_vlc2(&s->gb, vlc->table, 7, 3); y = get_vlc2(&s->gb, vlc->table, 7, 3);
...@@ -1716,20 +1718,22 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, ...@@ -1716,20 +1718,22 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
x = y >> 4; x = y >> 4;
y = y & 0x0f; y = y & 0x0f;
exponent= exponents[s_index];
dprintf("region=%d n=%d x=%d y=%d exp=%d\n", dprintf("region=%d n=%d x=%d y=%d exp=%d\n",
i, g->region_size[i] - j, x, y, exponents[s_index]); i, g->region_size[i] - j, x, y, exponent);
if (x) { if (x) {
#if 0 #if 0
if (x == 15) if (x == 15)
x += get_bitsz(&s->gb, linbits); x += get_bitsz(&s->gb, linbits);
v = l3_unscale(x, exponents[s_index]); v = l3_unscale(x, exponent);
#else #else
if (x < 15){ if (x < 15){
v = expval_table[ exponents[s_index] + 400 ][ x ]; v = expval_table[ exponent + 400 ][ x ];
// v = expval_table[ (exponent&3) + 400 ][ x ] >> FFMIN(0 - (exponent>>2), 31);
}else{ }else{
x += get_bitsz(&s->gb, linbits); x += get_bitsz(&s->gb, linbits);
v = l3_unscale(x, exponents[s_index]); v = l3_unscale(x, exponent);
} }
#endif #endif
if (get_bits1(&s->gb)) if (get_bits1(&s->gb))
...@@ -1742,13 +1746,13 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, ...@@ -1742,13 +1746,13 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
#if 0 #if 0
if (y == 15) if (y == 15)
y += get_bitsz(&s->gb, linbits); y += get_bitsz(&s->gb, linbits);
v = l3_unscale(y, exponents[s_index]); v = l3_unscale(y, exponent);
#else #else
if (y < 15){ if (y < 15){
v = expval_table[ exponents[s_index] + 400 ][ y ]; v = expval_table[ exponent + 400 ][ y ];
}else{ }else{
y += get_bitsz(&s->gb, linbits); y += get_bitsz(&s->gb, linbits);
v = l3_unscale(y, exponents[s_index]); v = l3_unscale(y, exponent);
} }
#endif #endif
if (get_bits1(&s->gb)) if (get_bits1(&s->gb))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment