comparison mpegaudiodec.c @ 3610:d97b4709aaf0 libavcodec

optimizing high freq decode
author michael
date Thu, 24 Aug 2006 01:01:39 +0000
parents 6560c84eef72
children a20d179c79c3
comparison
equal deleted inserted replaced
3609:6560c84eef72 3610:d97b4709aaf0
1739 } 1739 }
1740 break; 1740 break;
1741 } 1741 }
1742 last_gb= s->gb; 1742 last_gb= s->gb;
1743 1743
1744 code = get_vlc2(&s->gb, vlc->table, vlc->bits, 2); 1744 code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
1745 dprintf("t=%d code=%d\n", g->count1table_select, code); 1745 dprintf("t=%d code=%d\n", g->count1table_select, code);
1746 if (code < 0) 1746 g->sb_hybrid[s_index+0]=
1747 return -1; 1747 g->sb_hybrid[s_index+1]=
1748 for(i=0;i<4;i++) { 1748 g->sb_hybrid[s_index+2]=
1749 if (code & (8 >> i)) { 1749 g->sb_hybrid[s_index+3]= 0;
1750 /* non zero value. Could use a hand coded function for 1750 while(code){
1751 'one' value */ 1751 const static int idxtab[16]={3,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};
1752 v = l3_unscale(1, exponents[s_index]); 1752 int pos= s_index+idxtab[code];
1753 if(get_bits1(&s->gb)) 1753 code ^= 8>>idxtab[code];
1754 v = -v; 1754 v = l3_unscale(1, exponents[pos]);
1755 } else { 1755 if(get_bits1(&s->gb))
1756 v = 0; 1756 v = -v;
1757 } 1757 g->sb_hybrid[pos] = v;
1758 g->sb_hybrid[s_index++] = v; 1758 }
1759 } 1759 s_index+=4;
1760 } 1760 }
1761 memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index)); 1761 memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index));
1762 return 0; 1762 return 0;
1763 } 1763 }
1764 1764