18#ifdef USE_NEW_HUFFTABLE
48static real cos9[3],cos18[3];
49static real tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16];
50static real pow1_1[2][32],pow2_1[2][32],pow1_2[2][32],pow2_2[2][32];
59 unsigned part2_3_length;
61 unsigned scalefac_compress;
63 unsigned mixed_block_flag;
64 unsigned table_select[3];
69 unsigned region1start;
70 unsigned region2start;
72 unsigned scalefac_scale;
73 unsigned count1table_select;
83 struct {
struct gr_info_s
gr[2]; }
ch[2];
98 {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576},
99 {4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158},
100 {0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3},
101 {4,4,4,4,6,8,10,12,14,18,22,30,56}
104 {0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576},
105 {4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192},
106 {0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3},
107 {4,4,4,4,6,6,10,12,14,16,20,26,66}
110 {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
111 {4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26},
112 {0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3},
113 {4,4,4,4,6,8,12,16,20,26,34,42,12}
116 {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
117 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } ,
118 {0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} ,
119 {4,4,4,6,6,8,10,14,18,26,32,42,18 }
122 {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576},
123 {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 },
124 {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3},
125 {4,4,4,6,8,10,12,14,18,24,32,44,12 }
128 {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
129 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 },
130 {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3},
131 {4,4,4,6,8,10,12,14,18,24,30,40,18 }
134 {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
135 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
136 {0,12,24,36,54,78,108,144,186,240,312,402,522,576},
137 {4,4,4,6,8,10,12,14,18,24,30,40,18}
140 {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
141 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
142 {0,12,24,36,54,78,108,144,186,240,312,402,522,576},
143 {4,4,4,6,8,10,12,14,18,24,30,40,18}
146 {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576},
147 {12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2},
148 {0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576},
149 {8,8,8,12,16,20,24,28,36,2,2,2,26}
167 if(!fr->
p.down_sample)
return DOUBLE_TO_REAL(16384.0 *
pow((
double)2.0,-0.25 * (
double) (
i+210) ));
174#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
175 return gainpow2[
i+256];
187#if !defined(REAL_IS_FIXED) || !defined(PRECALC_TABLES)
193 const double Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
243 double t =
tan( (
double)
i *
M_PI / 12.0 );
254 double base =
pow(2.0,-0.25*(
j+1.0));
255 double p1=1.0,p2=1.0;
271 const int len[4] = { 36,36,12,36 };
282 const unsigned char *bdf;
287 switch_idx = (
j < 3) ? 8 : 6;
288 for(
i=0,
cb = 0;
cb < switch_idx ;
cb++,
i+=*bdf++)
298 int l = (*bdf++) >> 1;
299 for(lwin=0;lwin<3;lwin++)
314 int l = (*bdf++) >> 1;
315 for(lwin=0;lwin<3;lwin++)
328 for(
cb = 0;
cb < 22 ;
cb++)
330 *mp++ = (*bdf++) >> 1;
341 int n =
k +
j * 6 +
i * 36;
348 int n =
k +
j * 4 +
i * 16;
356 n_slen2[
n+500] =
i|(
j<<3) | (2<<12) | (1<<15);
363 int n =
l +
k * 4 +
j * 16 +
i * 80;
370 int n =
k +
j * 4 +
i * 20;
380 for(
i=-256;
i<118+4;
i++) fr->
gainpow2[
i+256] = gainpow2(fr,
i);
410 const int tabs[2][5] = { { 2,9,5,3,4 } , { 1,8,1,2,9 } };
411 const int *tab = tabs[fr->
lsf];
414 unsigned int needbits = 0;
416 needbits += stereo == 1 ? tab[2] : tab[3];
418 needbits += stereo*4;
420 needbits += tab[0]*stereo*(29+tab[4]+1+22+(!fr->
lsf?1:0)+2);
424 error2(
"%u bits for side info needed, only %li available"
468 if(!fr->
lsf)
for(ch=0; ch<stereo; ch++)
470 si->
ch[ch].gr[0].scfsi = -1;
474 for (gr=0; gr<tab[0]; gr++)
475 for (ch=0; ch<stereo; ch++)
477 register struct gr_info_s *gr_info = &(si->
ch[ch].gr[gr]);
479 gr_info->part2_3_length =
getbits(fr, 12);
480 gr_info->big_values =
getbits(fr, 9);
481 if(gr_info->big_values > 288)
484 gr_info->big_values = 288;
487 gr_info->pow2gain = fr->
gainpow2+256 - qss + powdiff;
489 gr_info->pow2gain += 2;
492 fr->
pinfo->qss[gr][ch] = qss;
494 gr_info->scalefac_compress =
getbits(fr, tab[4]);
495 if(gr_info->part2_3_length == 0)
497 if(gr_info->scalefac_compress > 0 &&
VERBOSE2)
498 error1(
"scalefac_compress should be zero instead of %i"
499 , gr_info->scalefac_compress );
500 gr_info->scalefac_compress = 0;
508 gr_info->mixed_block_flag =
get1bit(fr);
515 gr_info->table_select[2] = 0;
519 gr_info->full_gain[
i] = gr_info->pow2gain + sbg;
522 fr->
pinfo->sub_gain[gr][ch][
i] = sbg / 8;
526 if(gr_info->block_type == 0)
528 if(
NOQUIET)
error(
"Blocktype == 0 and window-switching == 1 not allowed.");
533 if( (!fr->
lsf || (gr_info->block_type == 2)) && !fr->
mpeg25)
535 gr_info->region1start = 36>>1;
536 gr_info->region2start = 576>>1;
543 if((gr_info->block_type == 2) && (!gr_info->mixed_block_flag) ) r0c = 5;
548 gr_info->region1start =
bandInfo[sfreq].longIdx[r0c+1] >> 1 ;
549 gr_info->region2start =
bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1;
553 gr_info->region1start = 54>>1;
554 gr_info->region2start = 576>>1;
566 gr_info->region1start =
bandInfo[sfreq].longIdx[r0c+1] >> 1 ;
569 if(r0c+1+r1c+1 > 22) gr_info->region2start = 576>>1;
570 else gr_info->region2start =
bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1;
572 gr_info->block_type = 0;
573 gr_info->mixed_block_flag = 0;
577 gr_info->scalefac_scale =
get1bit(fr);
578 gr_info->count1table_select =
get1bit(fr);
587 const unsigned char slen[2][16] =
589 {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4},
590 {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}
593 int num0 = slen[0][gr_info->scalefac_compress];
594 int num1 = slen[1][gr_info->scalefac_compress];
596 if(gr_info->part2_3_length == 0)
604 if(gr_info->block_type == 2)
607 numbits = (num0 + num1) * 18
608 - (gr_info->mixed_block_flag ? num0 : 0);
609 if(numbits > gr_info->part2_3_length)
612 if(gr_info->mixed_block_flag)
624 *scf++ = 0; *scf++ = 0; *scf++ = 0;
629 int scfsi = gr_info->scfsi;
633 numbits = (num0 + num1) * 10 + num0;
634 if(numbits > gr_info->part2_3_length)
645 numbits = !(scfsi & 0x8) * num0 * 6
646 + !(scfsi & 0x4) * num0 * 5
647 + !(scfsi & 0x2) * num1 * 5
648 + !(scfsi & 0x1) * num1 * 5;
649 if(numbits > gr_info->part2_3_length)
686 const unsigned char *pnt;
687 int i,
j,
n=0,numbits=0;
688 unsigned int slen, slen2;
690 const unsigned char stab[3][6][4] =
693 { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0},
694 { 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0}
697 { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0},
698 {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0}
701 { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0},
702 { 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0}
707 slen =
i_slen2[gr_info->scalefac_compress>>1];
709 slen =
n_slen2[gr_info->scalefac_compress];
711 gr_info->preflag = (slen>>15) & 0x1;
714 if( gr_info->block_type == 2 )
717 if(gr_info->mixed_block_flag)
n++;
720 pnt = stab[
n][(slen>>12)&0x7];
722 if(gr_info->part2_3_length == 0)
732 int num = slen2 & 0x7;
735 numbits += pnt[
i] *
num;
737 if(numbits > gr_info->part2_3_length)
742 int num = slen & 0x7;
749 for(
j=0;
j<(
int)(pnt[
i]);
j++) *scf++ = 0;
753 for(
i=0;
i<
n;
i++) *scf++ = 0;
760 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
761 {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0}
776#define MASK_STYPE long
777#define MASK_UTYPE unsigned long
778#define MASK_TYPE MASK_STYPE
779#define MSB_MASK (mask < 0)
782#define MASK_STYPE int32_t
783#define MASK_UTYPE uint32_t
784#define MASK_TYPE MASK_UTYPE
785#define MSB_MASK ((MASK_UTYPE)mask & (MASK_UTYPE)1<<(sizeof(MASK_TYPE)*8-1))
787#define BITSHIFT ((sizeof(MASK_TYPE)-1)*8)
788#define REFRESH_MASK \
789 while(num < BITSHIFT) { \
790 mask |= ((MASK_UTYPE)getbyte(fr))<<(BITSHIFT-num); \
797 int shift = 1 + gr_info->scalefac_scale;
800 int part2remain = gr_info->part2_3_length - part2bits;
803 int gainpow2_scale_idx = 378;
809 if(gr_info->part2_3_length > 0)
823 int bv = gr_info->big_values;
824 int region1 = gr_info->region1start;
825 int region2 = gr_info->region2start;
826 l3 = ((576>>1)-bv)>>1;
845 l[1] = region2 -
l[0];
851#define CHECK_XRPNT if(xrpnt >= &xr[SBLIMIT][0]) \
854 error2("attempted xrpnt overflow (%p !< %p)", (void*) xrpnt, (void*) &xr[SBLIMIT][0]); \
858 if(gr_info->block_type == 2)
862 int step=0,lwin=3,
cb=0;
863 register real v = 0.0;
866 if(gr_info->mixed_block_flag)
885 const struct newhuff *
h =
ht+gr_info->table_select[
i];
893 xrpnt = ((
real *) xr) + (*
m++);
899 gainpow2_scale_idx = (
int)(gr_info->pow2gain + (*scf <<
shift) - fr->
gainpow2);
901 v = gr_info->pow2gain[(*scf++) <<
shift];
907 gainpow2_scale_idx = (
int)(gr_info->full_gain[lwin] + (*scf <<
shift) - fr->
gainpow2);
909 v = gr_info->full_gain[lwin][(*scf++) <<
shift];
914 const short *
val =
h->table;
916#ifdef USE_NEW_HUFFTABLE
940 if(
x == 15 &&
h->linbits)
965 if(
y == 15 &&
h->linbits)
992 for(;l3 && (part2remain+
num > 0);l3--)
998 h =
htc+gr_info->count1table_select;
1009 if(part2remain+
num <= 0)
1023 xrpnt = ((
real *) xr) + (*
m++);
1029 gainpow2_scale_idx = (
int)(gr_info->pow2gain + (*scf <<
shift) - fr->
gainpow2);
1031 v = gr_info->pow2gain[(*scf++) <<
shift];
1037 gainpow2_scale_idx = (
int)(gr_info->full_gain[lwin] + (*scf <<
shift) - fr->
gainpow2);
1039 v = gr_info->full_gain[lwin][(*scf++) <<
shift];
1046 if( (
a & (0x8>>
i)) )
1049 if(part2remain+
num <= 0)
1078 xrpnt = ((
real *) xr) + *
m++;
1086 gr_info->maxband[0] =
max[0]+1;
1087 gr_info->maxband[1] =
max[1]+1;
1088 gr_info->maxband[2] =
max[2]+1;
1089 gr_info->maxbandl =
max[3]+1;
1093 rmax = (rmax >
max[2] ? rmax :
max[2]) + 1;
1101 const unsigned char *pretab =
pretab_choice[gr_info->preflag];
1104 int *
m =
map[sfreq][2];
1105 register real v = 0.0;
1112 const struct newhuff *
h =
ht+gr_info->table_select[
i];
1128 gainpow2_scale_idx = (
int)(gr_info->pow2gain + (*scf <<
shift) - fr->
gainpow2);
1130 v = gr_info->pow2gain[(*(scf++) + (*pretab++)) <<
shift];
1134 const short *
val =
h->table;
1136#ifdef USE_NEW_HUFFTABLE
1161 if(
x == 15 &&
h->linbits)
1166 num -=
h->linbits+1;
1167 mask <<=
h->linbits;
1185 if(
y == 15 &&
h->linbits)
1190 num -=
h->linbits+1;
1191 mask <<=
h->linbits;
1211 for(;l3 && (part2remain+
num > 0);l3--)
1213 const struct newhuff *
h =
htc+gr_info->count1table_select;
1214 const short *
val =
h->table;
1225 if(part2remain+
num <= 0)
1246 gainpow2_scale_idx = (
int)(gr_info->pow2gain + (*scf <<
shift) - fr->
gainpow2);
1248 v = gr_info->pow2gain[((*scf++) + (*pretab++)) <<
shift];
1254 if( (
a & (0x8>>
i)) )
1257 if(part2remain+
num <= 0)
1270 gr_info->maxbandl =
max+1;
1271 gr_info->maxb = fr->
longLimit[sfreq][gr_info->maxbandl];
1283 gr_info->maxband[0] =
1284 gr_info->maxband[1] =
1285 gr_info->maxband[2] =
1286 gr_info->maxbandl = 1;
1290 while(xrpnt < &xr[
SBLIMIT][0])
1293 while( part2remain > 16 )
1298 if(part2remain > 0)
skipbits(fr, part2remain);
1299 else if(part2remain < 0)
1302 error1(
"Can't rewind stream by %d bits!",-part2remain);
1320 const real *tabs[3][2][2] =
1322 { { tan1_1,tan2_1 } , { tan1_2,tan2_2 } },
1323 { { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } },
1324 { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } }
1327 tab = lsf + (gr_info->scalefac_compress & lsf);
1328 tab1 = tabs[tab][ms_stereo][0];
1329 tab2 = tabs[tab][ms_stereo][1];
1333 int p = gr_info->scalefac_compress & 0x1;
1360 if(gr_info->block_type == 2)
1363 if( gr_info->mixed_block_flag ) do_l = 1;
1365 for(lwin=0;lwin<3;lwin++)
1368 int is_p,
sb,
idx,sfb = gr_info->maxband[lwin];
1369 if(sfb > 3) do_l = 0;
1373 is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag];
1392 is_p = scalefac[11*3+lwin-gr_info->mixed_block_flag];
1396 is_p = scalefac[10*3+lwin-gr_info->mixed_block_flag];
1416 int sfb = gr_info->maxbandl;
1418 if(sfb > 21)
return;
1421 for( ; sfb<8; sfb++ )
1424 int is_p = scalefac[sfb];
1442 int sfb = gr_info->maxbandl;
1444 if(sfb > 21)
return;
1447 for ( ; sfb<21; sfb++)
1450 is_p = scalefac[sfb];
1465 is_p = scalefac[20];
1486 if(gr_info->block_type == 2)
1488 if(!gr_info->mixed_block_flag)
return;
1492 else sblim = gr_info->maxb-1;
1501 for(
sb=sblim;
sb;
sb--,xr1+=10)
1509 register real bu = *--xr2,bd = *xr1;
1586 tmp[1] = tmp[7] = t2 - t0;
1587 tmp[4] = t2 + t0 + t0;
1601 tmp[2] = tmp[6] = t3 - t0 - t2;
1602 tmp[0] = tmp[8] = t3 + t0 + t1;
1603 tmp[3] = tmp[5] = t3 - t1 + t2;
1614 real t0 = t1 + t2 + t3;
1635 real t0, t1, t2, t3, t4, t5, t6, t7;
1641 t4 =
in[0] - t1 - t1;
1643 tmp[4] = t4 + t2 + t2;
1678 real t0, t1, t2, t3, t4, t5, t6, t7;
1684 t4 =
in[1] - t1 - t1;
1721 tmpval = tmp[(v)] + tmp[17-(v)]; \
1722 out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \
1723 out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \
1724 tmpval = tmp[(v)] - tmp[17-(v)]; \
1725 ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \
1726 ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); }
1729 register real *out2 = o2;
1730 register real *
w = wintab;
1731 register real *out1 = o1;
1732 register real *ts = tsbuf;
1749#define MACRO0(v) { \
1751 out2[9+(v)] = REAL_MUL((tmp = sum0 + sum1), w[27+(v)]); \
1752 out2[8-(v)] = REAL_MUL(tmp, w[26-(v)]); } \
1754 ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(sum0, w[8-(v)]); \
1755 ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(sum0, w[9+(v)]);
1756#define MACRO1(v) { \
1758 sum0 = tmp1a + tmp2a; \
1759 sum1 = REAL_MUL((tmp1b + tmp2b), tfcos36[(v)]); \
1761#define MACRO2(v) { \
1763 sum0 = tmp2a - tmp1a; \
1764 sum1 = REAL_MUL((tmp2b - tmp1b), tfcos36[(v)]); \
1768 register real *out2 = o2;
1769 register real *
w = wintab;
1770 register real *out1 = o1;
1771 register real *ts = tsbuf;
1773 real ta33,ta66,tb33,tb66;
1781 real tmp1a,tmp2a,tmp1b,tmp2b;
1792 real tmp1a,tmp2a,tmp1b,tmp2b;
1803 real tmp1a,tmp2a,tmp1b,tmp2b;
1814 real tmp1a,tmp2a,tmp1b,tmp2b;
1826 sum0 =
in[2*0+0] -
in[2*2+0] +
in[2*4+0] -
in[2*6+0] +
in[2*8+0];
1840#define DCT12_PART1 \
1842 in5 += (in4 = in[4*3]); \
1843 in4 += (in3 = in[3*3]); \
1844 in3 += (in2 = in[2*3]); \
1845 in2 += (in1 = in[1*3]); \
1846 in1 += (in0 = in[0*3]); \
1848 in5 += in3; in3 += in1; \
1850 in2 = REAL_MUL(in2, COS6_1); \
1851 in3 = REAL_MUL(in3, COS6_1);
1853#define DCT12_PART2 \
1854 in0 += REAL_MUL(in4, COS6_2); \
1859 in1 += REAL_MUL(in5, COS6_2); \
1861 in5 = REAL_MUL((in1 + in3), tfcos12[0]); \
1862 in1 = REAL_MUL((in1 - in3), tfcos12[2]); \
1871 real in0,in1,in2,in3,in4,in5;
1872 register real *out1 = rawout1;
1879 real tmp0,tmp1 = (in0 - in4);
1907 real in0,in1,in2,in3,in4,in5;
1908 register real *out2 = rawout2;
1913 real tmp0,tmp1 = (in0 - in4);
1919 out2[5-1] =
REAL_MUL(tmp0, wi[11-1]);
1920 out2[0+1] =
REAL_MUL(tmp0, wi[6+1]);
1927 out2[5-0] =
REAL_MUL(in2, wi[11-0]);
1928 out2[0+0] =
REAL_MUL(in2, wi[6+0]);
1929 out2[0+2] =
REAL_MUL(in3, wi[6+2]);
1930 out2[5-2] =
REAL_MUL(in3, wi[11-2]);
1941 real in0,in1,in2,in3,in4,in5;
1942 register real *out2 = rawout2;
1943 out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0;
1948 real tmp0,tmp1 = (in0 - in4);
1954 out2[11-1] =
REAL_MUL(tmp0, wi[11-1]);
1955 out2[6 +1] =
REAL_MUL(tmp0, wi[6+1]);
1956 out2[0+1] +=
REAL_MUL(tmp1, wi[1]);
1957 out2[5-1] +=
REAL_MUL(tmp1, wi[5-1]);
1962 out2[11-0] =
REAL_MUL(in2, wi[11-0]);
1963 out2[6 +0] =
REAL_MUL(in2, wi[6+0]);
1964 out2[6 +2] =
REAL_MUL(in3, wi[6+2]);
1965 out2[11-2] =
REAL_MUL(in3, wi[11-2]);
1968 out2[5-0] +=
REAL_MUL(in0, wi[5-0]);
1970 out2[5-2] +=
REAL_MUL(in4, wi[5-2]);
1981 real *rawout1,*rawout2;
1993 if(gr_info->mixed_block_flag)
1997 opt_dct36(fr)(fsIn[1],rawout1+18,rawout2+18,
win1[0],tspnt+1);
1998 rawout1 += 36; rawout2 += 36; tspnt += 2;
2001 bt = gr_info->block_type;
2004 for(;
sb<gr_info->maxb;
sb+=2,tspnt+=2,rawout1+=36,rawout2+=36)
2006 dct12(fsIn[
sb] ,rawout1 ,rawout2 ,
win[2] ,tspnt);
2007 dct12(fsIn[
sb+1],rawout1+18,rawout2+18,
win1[2],tspnt+1);
2012 for(;
sb<gr_info->maxb;
sb+=2,tspnt+=2,rawout1+=36,rawout2+=36)
2037 for(ch = 0; ch < stereo1; ++ch)
2039 struct gr_info_s *gr_infos = &(si->
ch[ch].gr[gr]);
2040 fr->
pinfo->big_values[gr][ch] = gr_infos->big_values;
2041 fr->
pinfo->scalefac_scale[gr][ch] = gr_infos->scalefac_scale;
2042 fr->
pinfo->mixed[gr][ch] = gr_infos->mixed_block_flag;
2043 fr->
pinfo->blocktype[gr][ch] = gr_infos->block_type;
2044 fr->
pinfo->mainbits[gr][ch] = gr_infos->part2_3_length;
2045 fr->
pinfo->preflag[gr][ch] = gr_infos->preflag;
2047 fr->
pinfo->scfsi[ch] = gr_infos->scfsi;
2050 for(ch = 0; ch < stereo1; ++ch)
2052 struct gr_info_s *gr_infos = &(si->
ch[ch].gr[gr]);
2053 ifqstep = (fr->
pinfo->scalefac_scale[gr][ch] == 0) ? .5 : 1.0;
2054 if(2 == gr_infos->block_type)
2056 for(
i = 0;
i < 3; ++
i)
2058 for(
sb = 0;
sb < 12; ++
sb)
2065 fr->
pinfo->sfb_s[gr][ch][
j] = -ifqstep *
2066 fr->
pinfo->sfb_s[gr][ch][
j - gr_infos->mixed_block_flag];
2067 fr->
pinfo->sfb_s[gr][ch][
j] -= 2 *
2068 (fr->
pinfo->sub_gain[gr][ch][
i]);
2070 fr->
pinfo->sfb_s[gr][ch][3 *
sb +
i] =
2071 -2 * (fr->
pinfo->sub_gain[gr][ch][
i]);
2075 for(
sb = 0;
sb < 21; ++
sb)
2079 if (gr_infos->preflag)
2081 fr->
pinfo->sfb[gr][ch][
sb] *= -ifqstep;
2083 fr->
pinfo->sfb[gr][ch][21] = 0;
2088 for(ch = 0; ch < stereo1; ++ch)
2101 int gr, ch,
ss,clip=0;
2102 int scalefacs[2][39];
2106 int ms_stereo,i_stereo;
2108 int stereo1,granules;
2122 ms_stereo = (fr->
mode_ext & 0x2)>>1;
2125 else ms_stereo = i_stereo = 0;
2127 granules = fr->
lsf ? 1 : 2;
2133 if(
NOQUIET)
error(
"bad frame - unable to get valid sideinfo");
2145 for(
gr=0;
gr<granules;
gr++)
2153 struct gr_info_s *gr_info = &(sideinfo.
ch[0].gr[gr]);
2159 "part2_3_length (%u) too large for available bit count (%li)"
2171 error(
"not enough bits for scale factors");
2179 fr->
pinfo->sfbits[gr][0] = part2bits;
2181 fr->
pinfo->sfb_s[gr][0][
i] = scalefacs[0][
i];
2188 error(
"dequantization failed!");
2194 error(
"bit deficit after dequant");
2201 struct gr_info_s *gr_info = &(sideinfo.
ch[1].gr[gr]);
2211 error(
"not enough bits for scale factors");
2219 fr->
pinfo->sfbits[gr][1] = part2bits;
2221 fr->
pinfo->sfb_s[gr][1][
i] = scalefacs[1][
i];
2228 error(
"dequantization failed!");
2234 error(
"bit deficit after dequant");
2241 unsigned int maxb = sideinfo.
ch[0].gr[gr].maxb;
2242 if(sideinfo.
ch[1].gr[gr].maxb > maxb) maxb = sideinfo.
ch[1].gr[gr].maxb;
2248 ((
real *)hybridIn[0])[
i] = tmp0 + tmp1;
2249 ((
real *)hybridIn[1])[
i] = tmp0 - tmp1;
2253 if(i_stereo)
III_i_stereo(hybridIn,scalefacs[1],gr_info,sfreq,ms_stereo,fr->
lsf);
2255 if(ms_stereo || i_stereo || (single ==
SINGLE_MIX) )
2257 if(gr_info->maxb > sideinfo.
ch[0].gr[gr].maxb)
2258 sideinfo.
ch[0].gr[gr].maxb = gr_info->maxb;
2260 gr_info->maxb = sideinfo.
ch[0].gr[gr].maxb;
2268 register real *in0 = (
real *) hybridIn[0],*in1 = (
real *) hybridIn[1];
2270 *in0 = (*in0 + *in1++);
2276 register real *in0 = (
real *) hybridIn[0],*in1 = (
real *) hybridIn[1];
2289 for(ch=0;ch<stereo1;ch++)
2291 struct gr_info_s *gr_info = &(sideinfo.
ch[ch].gr[gr]);
2293 III_hybrid(hybridIn[ch], hybridOut[ch], ch,gr_info, fr);
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
double pow(double x, double y)
#define backbits(fr, nob)
static unsigned int getbits(mpg123_handle *fr, int number_of_bits)
#define skipbits(fr, nob)
#define getbits_fast(fr, nob)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static const struct newhuff htc[]
static const struct newhuff ht[]
static const short tab2[]
static const short tab1[]
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define init_layer3_stuff
#define init_layer3_gainpow2_mmx
#define absynth_1to1_i486
#define init_layer3_gainpow2
static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT], int ch, struct gr_info_s *gr_info, mpg123_handle *fr)
static unsigned char pretab_choice[2][22]
static int * mapend[9][3]
static int mapbuf0[9][152]
static int mapbuf1[9][156]
static int III_get_scale_factors_2(mpg123_handle *fr, int *scf, struct gr_info_s *gr_info, int i_stereo)
static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT], int *scf, struct gr_info_s *gr_info, int sfreq, int part2bits)
static void III_antialias(real xr[SBLIMIT][SSLIMIT], struct gr_info_s *gr_info)
static unsigned int i_slen2[256]
static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT], int *scalefac, struct gr_info_s *gr_info, int sfreq, int ms_stereo, int lsf)
static void fill_pinfo_side(mpg123_handle *fr, struct III_sideinfo *si, int gr, int stereo1)
static void dct12(real *in, real *rawout1, real *rawout2, register real *wi, register real *ts)
static int III_get_scale_factors_1(mpg123_handle *fr, int *scf, struct gr_info_s *gr_info, int ch, int gr)
static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si, int stereo, int ms_stereo, long sfreq, int single)
static unsigned int n_slen2[512]
static const struct bandInfoStruct bandInfo[9]
static int mapbuf2[9][44]
static HMODULE MODULEINFO DWORD cb
#define REAL_SCALE_LAYER3(x, y)
#define DOUBLE_TO_REAL_15(x)
#define DOUBLE_TO_REAL_POW43(x)
#define REAL_MUL_15(x, y)
#define DOUBLE_TO_REAL(x)
#define REAL_MUL_SCALE_LAYER3(x, y, z)
#define MPG_MD_JOINT_STEREO
#define DOUBLE_TO_REAL_SCALE_LAYER3(x, y)
struct III_sideinfo::@4260 ch[2]
unsigned char longDiff[22]
unsigned short shortIdx[14]
unsigned char shortDiff[13]
unsigned short longIdx[23]
func_synth_mono synth_mono
struct mpg123_pars_struct p
struct mpg123_handle_struct::@3463 layer3
struct mpg123_moreinfo * pinfo
func_synth_stereo synth_stereo
unsigned int bitreservoir
real hybrid_block[2][2][SBLIMIT *SSLIMIT]
unsigned char * wordpointer
static unsigned int block