1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

optimizing high freq decode

Originally committed as revision 6060 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-08-24 01:01:39 +00:00
parent daf4cd9ac3
commit 3c693e7743

View File

@ -1741,22 +1741,22 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
} }
last_gb= s->gb; last_gb= s->gb;
code = get_vlc2(&s->gb, vlc->table, vlc->bits, 2); code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
dprintf("t=%d code=%d\n", g->count1table_select, code); dprintf("t=%d code=%d\n", g->count1table_select, code);
if (code < 0) g->sb_hybrid[s_index+0]=
return -1; g->sb_hybrid[s_index+1]=
for(i=0;i<4;i++) { g->sb_hybrid[s_index+2]=
if (code & (8 >> i)) { g->sb_hybrid[s_index+3]= 0;
/* non zero value. Could use a hand coded function for while(code){
'one' value */ const static int idxtab[16]={3,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};
v = l3_unscale(1, exponents[s_index]); int pos= s_index+idxtab[code];
if(get_bits1(&s->gb)) code ^= 8>>idxtab[code];
v = -v; v = l3_unscale(1, exponents[pos]);
} else { if(get_bits1(&s->gb))
v = 0; v = -v;
} g->sb_hybrid[pos] = v;
g->sb_hybrid[s_index++] = v;
} }
s_index+=4;
} }
memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index)); memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index));
return 0; return 0;