亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mp3dec.c

?? 基于TI的DSP處理器TMS320VC5402的MP3壓縮和解壓縮源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
	    } else {

		/* 
		   Long block, use this formula:

		   xr[i] = sign(is[i])*|is[i]|^(4/3)*2^0.25*(global_gain - 210) *
		   2 ^ -(scalefac_multiplier * (scalefac_l[band] + preflag *
		   pretab[band]))

		   global_gain is already in *xr

		   The preflag when set applies a pre-emphasis value from
		   the pretab table. 

		   */

		/* xr[sb][ss] *= pow(2.0, -0.5 * (1.0+gr_info->scalefac_scale)
		 * ((*scalefac)[ch].l[cb]
		 + gr_info->preflag * pretab[cb]));
		 */

		t = (1 + gr->scalefac_scale) * (gr->scalefac_l[band]
						+ gr->preflag * pretab[band]);

		if(t >= 32) { /* Only 32 values in the table */
		    myxr = (mpfloat)0.0f;
		} else
		    myxr *= Granule_pow2table_m05[t];
		ISCALE(myxr);
	    }
	}

	/* apply the sign(is[i]) * |is[i]| ^ (4/3) formula */
	
	sign = (*is < 0) ? 1 : 0; 
	t = sign ? -*is : *is;       /* t = abs(is) */
	if(t >= 200)
	    t = 199;
	
	*xr = myxr * Granule_powerscaling[t];

/*	    *xr = myxr * (mpfloat)pow((float)t, (4.0f / 3.0f)); */

	ISCALE(*xr);
	/* restore the sign */

	if(sign)
	    *xr = -*xr;

	/* advance input and output */
	
	xr++;
	is++;

	/* check if we pass into the next window in short blocks */
	if(j && !--j) {
	    j = windowlength;
	    window++;
		needc = 1;
	}
    }    
}

/* apply the selected stereo processing to the 2 xr channels, producing
   a left and right output in lr.
*/

void
Granule_process_stereo(Granule *gr, Granule *grch1, 
		       Granule_floatfreqs xr[2],
		       Granule_floatfreqs lr[2], Frame *f)
{
    int sfb;
    int i, j, sb, ch;

    /* extract some stuff from the frame header */

    int stereo = f->channels;

    /* get the correct band-boundaries table */

    struct Frame_band *bands = &Frame_bands[f->sampling_frequency];

    /* decode what stereo mode we should process */

    int i_stereo = (f->mode == MODE_JOINT_STEREO) &&
	(f->mode_extension & 0x1);
    int ms_stereo = (f->mode == MODE_JOINT_STEREO) &&
	(f->mode_extension & 0x2); 

    /* ration and positions for stereo processing */
    int is_pos[576]; 
    mpfloat is_ratio[576];

    /* the following HUGE chunk of code decodes the stereo positions and
       rations in case of special stereo modes that don't transmit using
       normal left-right signals */

    /* clear the position table */
    for(i = 0; i < 576; i++)
	is_pos[i] = 7;
    
   if ((stereo == 2) && i_stereo) {

       /* Intensity stereo mode */

       if (gr->window_switching_flag && (gr->block_type == BLOCKTYPE_3WIN)) {
	   if(gr->mixed_block_flag) {
	       int max_sfb = 0;

	       /* mixed block */

	       /* in the short block part of the spectrum, find the highest
		  non-zero frequency - process each window separately */

	       for (j = 0; j < 3; j++) {
		   int sfbcnt;
		   sfbcnt = 2;

		   for(sfb = 12; sfb >= 3; sfb--) {
		       int lines;
		       
		       /* find the last frequency line with a non-zero value */
		       
		       lines = bands->s[sfb+1] - bands->s[sfb];
		       i = 3 * bands->s[sfb] + (j + 1) * lines - 1;
		       while(lines > 0) {
			   if(xr[1][i] != 0.0f ) {
			       sfbcnt = sfb;
			       sfb = -10;
			       lines = -10;
			   }
			   lines--;
			   i--;
		       }
		   }

		   sfb = sfbcnt + 1;
		   
		   if (sfb > max_sfb)
		       max_sfb = sfb;

		   while(sfb < 12) {
		       sb = bands->s[sfb+1] - bands->s[sfb];
		       i = 3 * bands->s[sfb] + j * sb;
		       for (; sb > 0; sb--) {
			   is_pos[i] = grch1->scalefac_s[sfb][j];
			   if (is_pos[i] != 7)
			       /* ## tabelize this tan */
			       is_ratio[i] = tan(is_pos[i] * (PI / 12));
			   i++;
		       }
		       sfb++;
		   }
		   sb = bands->s[11] - bands->s[10];
		   sfb = 3 * bands->s[10] + j * sb;
		   sb = bands->s[12] - bands->s[11];
		   i = 3 * bands->s[11] + j * sb;
		   for (; sb > 0; sb--) {
		       is_pos[i] = is_pos[sfb];
		       is_ratio[i] = is_ratio[sfb];
		       i++;
		   }
	       }
	       if (max_sfb <= 3) {
		   /* find the last non-zero frequency line in the lowest 
		      3 subbands */
		   i = 2 * 18 + 17;
		   sb = -1;
		   while (i >= 0) {
		       if (xr[1][i] != (mpfloat)0.0f) {
			   sb = i;
			   break;
		       }
		       i--;
		   }
		   i = 0;
		   while(bands->l[i] <= sb)
		       i++;
		   sfb = i;
		   i = bands->l[i];
		   for (; sfb < 8; sfb++) {
		       sb = bands->l[sfb + 1] - bands->l[sfb];
		       for (; sb > 0; sb--) {
			   is_pos[i] = grch1->scalefac_l[sfb];
			   if(is_pos[i] != 7)
			       /* ## tabelize this */
			       is_ratio[i] = tan(is_pos[i] * (PI / 12));
			   i++;
		       }
		   }
	       }

	   } else {

	       /* this is a pure short block */

	       for(j = 0; j < 3; j++) {
		   int sfbcnt;
		   sfbcnt = -1;
		   for(sfb = 12; sfb >= 0; sfb--) {
		       int lines;
		       lines = bands->s[sfb + 1] - bands->s[sfb];
		       i = 3 * bands->s[sfb] + (j + 1) * lines - 1;
		       while (lines > 0) {
			   if(xr[1][i] != 0.0 ) {
			       sfbcnt = sfb;
			       sfb = -10;
			       lines = -10;
			   }
			   lines--;
			   i--;
		       }
		   }
		   sfb = sfbcnt + 1;
		   while(sfb < 12) {
		       sb = bands->s[sfb + 1] - bands->s[sfb];
		       i = 3 * bands->s[sfb] + j * sb;
		       for (; sb > 0; sb--) {
			   is_pos[i] = grch1->scalefac_s[sfb][j];
			   if (is_pos[i] != 7)
			       /* ## tabelize this */
			       is_ratio[i] = tan(is_pos[i] * (PI / 12));
			   i++;
		       }
		       sfb++;
		   }
		   
		   sb = bands->s[11] - bands->s[10];
		   sfb = 3 * bands->s[10] + j * sb;
		   sb = bands->s[12] - bands->s[11];
		   i = 3 * bands->s[11] + j * sb;
		   for (; sb > 0; sb--) {
		       is_pos[i] = is_pos[sfb];
		       is_ratio[i] = is_ratio[sfb];
		       i++;
		   }
	       }
	   }
       } else {
	   /* long block */
	   /* find the highest non-zero frequency */
	   i = 31 * 18 + 17;
	   sb = 0;
	   while (i >= 0) {
	       if(xr[1][i] != 0.0) {
		   sb = i;
		   break;
	       }
	       i--;
	   }
	   i = 0;
	   while(bands->l[i] <= sb)
	       i++;
	   sfb = i;
	   i = bands->l[i];
	   for (; sfb < 21; sfb++) {
	       sb = bands->l[sfb + 1] - bands->l[sfb];
	       for (; sb > 0; sb--) {
		   is_pos[i] = grch1->scalefac_l[sfb];
		   if (is_pos[i] != 7)
		       /* ## tabelize this */
		       is_ratio[i] = tan(is_pos[i] * (PI / 12));
		   i++;
	       }
	   }
	   sfb = bands->l[20];
	   for (sb = 576 - bands->l[21]; sb > 0; sb--) {
	       is_pos[i] = is_pos[sfb];
	       is_ratio[i] = is_ratio[sfb];
	       i++;
	   }
       }
   }
   
   /* prepare for making output */

   for(ch = 0;ch < 2; ch++)
       for(i = 0; i < 576; i++)
	   lr[ch][i] = (mpfloat)0.0f;

   /* do the stereo matrixing */

   if(stereo == 2) 
       for(i = 0; i < 576; i++) {
	   if( is_pos[i] == 7 ) {
               if(ms_stereo) {
		   lr[0][i] = (xr[0][i] + xr[1][i]) / 1.41421356;
		   lr[1][i] = (xr[0][i] - xr[1][i]) / 1.41421356;
               } else {
		   /* dual-channel mode, the most common, just copy */
		   lr[0][i] = xr[0][i];
		   lr[1][i] = xr[1][i];
               }
	   } else if (i_stereo) {
               lr[0][i] = xr[0][i] * (mpfloat)(is_ratio[i] / (1.0f + is_ratio[i]));
               lr[1][i] = xr[0][i] * (mpfloat)(1.0f / (1.0f + is_ratio[i])); 
	   ISCALE(lr[0][i]);
	   ISCALE(lr[1][i]);
	   } else {
#ifndef DSP
                printf("Illegal stereo mode!\n");
#endif
	   }
       } else
	   /* single channel mode */
	   for(i = 0; i < 576; i++)
	       lr[0][i] = xr[0][i];
}

void
Granule_reorder(Granule *gr, Granule_floatfreqs xr, 
		Granule_floatfreqs xr2, Frame *f)
{
    /* get the correct band-boundaries table */
    
    struct Frame_band *bands = &Frame_bands[f->sampling_frequency];

    int sfb, bandstart, bandsize;
    int window, i, src, dst;

    /* check the block type - we only reorder short and mixed blocks */

    if(gr->window_switching_flag && gr->block_type == BLOCKTYPE_3WIN) {
	for(i = 0; i < 576; i++)
	    xr2[i] = (mpfloat)0.0f;
	if(gr->mixed_block_flag) {
	    
	    /* lowest 2 subbands are long blocks - pass through */
	    
	    for(i = 0; i < 2 * 18; i++)
		xr2[i] = xr[i];

	    /* reorder all 3-window bands */
	    
	    bandstart = bands->s[3];
	    bandsize = bands->s[4] - bandstart;
	    for(sfb = 3; sfb < 13; sfb++) {
		src = bandstart * 3;
		for(window = 0; window < 3; window++)
		    dst = bandstart * 3 + window;
		    for(i = 0; i < bandsize; i++) {
			xr2[dst] = xr[src++];
			dst += 3;
		    }
		bandstart = bands->s[sfb];
		bandsize = bands->s[sfb + 1] - bandstart;
	    }
	} else {

	    /* short block, reorder everything  */

	    bandstart = 0;
	    bandsize = bands->s[1];
	    for(sfb = 0; sfb < 13; sfb++) {
		src = bandstart * 3;
		for(window = 0; window < 3; window++) {
		    dst = bandstart * 3 + window;
		    for(i = 0; i < bandsize; i++) {
			xr2[dst] = xr[src++];
			dst += 3;
		    }
		}
		bandstart = bands->s[sfb + 1];
		bandsize = bands->s[sfb + 2] - bandstart;
	    }
	}
    } else
	/* long block, pass through */
	for(i = 0; i < 576; i++)
	    xr2[i] = xr[i];
}

/* make some alias reduction */
#ifndef DSP
void
Granule_antialias(Granule *gr, Granule_floatfreqs xr)
{
    int i, topband, subband, upper, lower;
    mpfloat u, l;

    if(gr->window_switching_flag && gr->block_type == BLOCKTYPE_3WIN)
	if(!gr->mixed_block_flag)
	    return;       /* dont antialias short blocks */
	else
	    topband = 2-1;  /* only antialias the long part of a mixed block */
    else
	topband = NUM_SUBBANDS - 1;

    /* for each subband-pair, do 8 alias-reduction butterflies */

    upper = 17;
    lower = 18;

    for(subband = 0; subband < topband; subband++) {
	for(i = 0; i < 8; i++) {
	    u = xr[upper];
	    l = xr[lower];
	    xr[upper] = u * Granule_alias_cs[i] -
		l * Granule_alias_ca[i];
	    ISCALE(xr[upper]);
	    xr[lower] = l * Granule_alias_cs[i] +
		u * Granule_alias_ca[i];
	    ISCALE(xr[lower]);
	    upper--;
	    lower++;
	}
	upper += 26;
	lower += 10;
    }
}
#endif

/* Every odd time sample of every odd subband is multiplied by -1 to 
   compensate for the frequency inversion of the polyphase synthesis
 */

void
Granule_freqinverse(Granule *gr, Granule_floatfreqs x)
{
    int sb, dct;
    x = &x[NUM_DCTBANDS];
    for(sb = 1; sb < NUM_SUBBANDS; sb += 2) {
	for(dct = 1; dct < NUM_DCTBANDS; dct += 2)
	    x[dct] = -x[dct];
	x = &x[2 * NUM_DCTBANDS];
    }
}


void
Granule_subband_synthesis(Granule *gr, int ch, Granule_floatfreqs s,
			  PCMSample *S)
{
    int i, j, t, k;
    mpfloat band[32];
    mpfloat *v, sum, *a, *b;

    if(ch)
	S = &S[1];

    /* We have 18 time-vectors of 32 subband magnitudes each. For every
       vector of 32 magnitudes, the subband synthesis generates 32
       PCM samples, so the result of 18 of these is 18*32=576 samples.
     */

    /* go through each time window */

    for(t = 0; t < 18; t++) {

	/* extract the subband strengths */

	v = &s[t];
	for(i = 0; i < 32; i++) {
	    band[i] = *v;
	    v = &v[18];
	}

	/* advance the buffer position */

	Granule_sbsynth_Vptr[ch] = (Granule_sbsynth_Vptr[ch] - 64) & 0x3ff;
	v = &Granule_sbsynth_V[ch][Granule_sbsynth_Vptr[ch]];

	fast_idct(band, v);
  
	/* 32*16=512 mac's */
	
	S = windowing(ch, S);
	
    }
}

/* 18 * (4096+1024) = 92160 MAC's per call, with 2 calls per frame and
   38 frames per second this is 7 million MAC's per second.

   18 * (384 * 2 + 1024) = 32256 MAC's per call using Lee's fast DCT! That
   is just 2.4 million MAC's per second!

	We need a buffer of 1024 floats per channel.

   */

void
Granule_subband_synthesis2(Granule *gr, Granule_floatfreqs s1,
			   Granule_floatfreqs s2,
			   PCMSample *S)
{
    int i, j, t, k, isum1, isum2;
    mpfloat band[64];
    mpfloat *v, *v2, sum, sum2, *a, *b;

    /* We have 18 time-vectors of 32 subband magnitudes each. For every
       vector of 32 magnitudes, the subband synthesis generates 32
       PCM samples, so the result of 18 of these is 18*32=576 samples.
     */

    /* go through each time window */

    for(t = 0; t < 18; t++) {

	/* extract the subband strengths */

	v = &s1[t];
	v2 = &s2[t];
	for(i = 0; i < 32; i++) {
	    band[i] = *v;
	    band[i+32] = *v2;
	    v = &v[18];
	    v2 = &v2[18];
	}

	/* advance the buffer position */

	Granule_sbsynth_Vptr[0] = (Granule_sbsynth_Vptr[0] - 64) & 0x3ff;
	v = &Granule_sbsynth_V[0][Granule_sbsynth_Vptr[0]];
	
	/* calculate 64 values for each channel and insert them into the 1024 wide buffer */

	fast_idct(band, v);
	fast_idct(&band[32], &v[1024]);
         
	/* 32*16*2=1024 mac's */
	
	/* windowing - calculate 32 samples. each sample is the sum of 16 terms */
	
	/*     15          */
	/* Sj = E W(j+32i) */
	/*    i=0          */
	
#ifdef USE_INLINE_ASM
__asm {
	push edi
	// grab the sample pointer
	mov edi, S

	xor ebx, ebx	// loop counter 
	ALIGN 4
window_loop:
	lea ecx, [Granule_sbsynth_D + ebx*4]	// ecx = &Granule_sbsynth_D[j]
	mov eax, ebx
	add eax, [Granule_sbsynth_Vptr]		// eax = j + Granule_sbsynth_Vptr[0]
	fldz	// sum1 = 0.0
	fldz	// sum2 = 0.0
	xor edx, edx	// filt_lp1 counter 

	ALIGN 4
filt_lp1:
	fld [ecx]	// get the window coefficient (D)
	fld st(0)	// duplicate it
	fmul dword ptr [Granule_sbsynth_V + eax*4]	// multiply by Granule_sbsynth_V[eax]
	faddp st(3), st
	fmul dword ptr [Granule_sbsynth_V + 4096 + eax*4]	// same for channel 2
	faddp st(1), st
	add eax, 96
	and eax, 0x3ff
	fld [128 + ecx]	// get the next D
	fld st(0)			// dup it
	fmul dword ptr [Granule_sbsynth_V + eax*4]
	faddp st(3), st
	fmul dword ptr [Granule_sbsynth_V + 4096 + eax*4]

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美写真视频网站| 一区二区三区不卡视频在线观看| 国产精品毛片高清在线完整版| 亚洲精品国产品国语在线app| 久久精品国产免费| 色乱码一区二区三区88 | 国产麻豆精品在线| 欧美日韩美少妇| 中文字幕不卡一区| 日韩精品一区二区三区视频 | 亚洲r级在线视频| 国内精品国产成人| 欧美亚洲尤物久久| 亚洲欧美日韩国产成人精品影院 | 日本sm残虐另类| 在线免费精品视频| 亚洲人成伊人成综合网小说| 成人网在线免费视频| 久久日韩粉嫩一区二区三区| 久久国产人妖系列| 日韩欧美成人激情| 蜜臀av一区二区| 91精品综合久久久久久| 日韩电影一区二区三区| 欧美日韩国产成人在线免费| 亚洲欧美日韩国产手机在线| 色诱亚洲精品久久久久久| 日韩美女视频一区| 色婷婷综合久久久中文一区二区| 国产精品国产三级国产普通话三级| 国产伦精品一区二区三区在线观看| 久久综合狠狠综合久久综合88| 久久不见久久见免费视频7| 日韩一级二级三级| 久久er99精品| 国产免费久久精品| gogogo免费视频观看亚洲一| 国产精品成人免费| 91激情五月电影| 亚洲r级在线视频| 欧美一区二视频| 激情五月播播久久久精品| 亚洲精品一区二区在线观看| 国产在线乱码一区二区三区| 国产日韩视频一区二区三区| 99国产精品99久久久久久| 亚洲一区二区中文在线| 这里是久久伊人| 精品中文字幕一区二区| 国产色一区二区| 日本韩国欧美在线| 久久福利视频一区二区| 国产欧美日韩综合精品一区二区| 91一区二区在线观看| 亚洲一区在线看| 精品国产伦理网| 一本到高清视频免费精品| 无吗不卡中文字幕| 国产色91在线| 欧美午夜在线一二页| 国内精品写真在线观看| 自拍偷在线精品自拍偷无码专区| 欧美日韩精品三区| 国产福利一区二区三区视频在线 | 蜜桃av一区二区在线观看| 久久久精品黄色| 欧美亚洲国产一区二区三区| 国内国产精品久久| 一区二区国产视频| 久久亚区不卡日本| 在线视频国产一区| 国产九色精品成人porny| 亚洲午夜激情网站| 国产精品青草久久| 欧美www视频| 欧美日韩免费电影| 91啪在线观看| 国产美女精品在线| 秋霞电影网一区二区| 亚洲欧美日韩精品久久久久| 久久亚洲精品国产精品紫薇| 88在线观看91蜜桃国自产| 91影院在线观看| 国产成人午夜99999| 秋霞午夜av一区二区三区| 亚洲欧洲日韩av| 中文字幕第一区第二区| 精品久久久久一区二区国产| 欧美伊人久久久久久久久影院| 波多野结衣中文一区| 国产激情91久久精品导航 | 久久久99精品免费观看不卡| 欧美一区二区视频在线观看| 91丨九色丨黑人外教| 国产成人在线电影| 极品销魂美女一区二区三区| 偷拍一区二区三区| 亚洲第一主播视频| 一区二区三区高清| 亚洲综合男人的天堂| 亚洲精品亚洲人成人网在线播放| 中文av一区二区| 久久久久久一级片| 久久影院视频免费| 精品国产污污免费网站入口 | 欧美精品在线观看一区二区| 色狠狠综合天天综合综合| 91蝌蚪porny| 色香蕉成人二区免费| 色综合久久久久综合体桃花网| 成人精品视频一区| av亚洲精华国产精华| 99视频精品免费视频| 99久久国产综合色|国产精品| 波多野结衣精品在线| 91老师片黄在线观看| 欧美视频精品在线观看| 欧美精品自拍偷拍| 欧美成人福利视频| 国产亚洲精品免费| 中文字幕在线视频一区| 一区二区欧美精品| 轻轻草成人在线| 国产精品一区二区你懂的| 成人午夜av在线| 色偷偷88欧美精品久久久| 欧美视频一区二| 精品日韩一区二区三区免费视频| 国产午夜亚洲精品午夜鲁丝片| 国产精品青草综合久久久久99| 亚洲码国产岛国毛片在线| 亚洲一区视频在线| 黑人巨大精品欧美一区| 成人亚洲精品久久久久软件| av在线播放成人| 欧美日韩国产美| 久久久午夜精品| 亚洲一区二区三区中文字幕在线| 日本一道高清亚洲日美韩| 国产精品综合二区| 欧美性视频一区二区三区| 欧美成人一区二区三区在线观看| 国产精品污网站| 日韩电影在线观看一区| 成人深夜福利app| 9191精品国产综合久久久久久| 欧美精品一区二区三区四区| 亚洲欧美在线视频| 日韩成人av影视| 99精品视频在线播放观看| 91精选在线观看| 成人欧美一区二区三区黑人麻豆 | 日韩欧美色电影| 国产精品天美传媒沈樵| 日韩国产欧美在线视频| 成人动漫一区二区三区| 91精品在线麻豆| 国产精品久久久久久久久图文区 | 国产精品视频你懂的| 午夜精品视频在线观看| 国产成人a级片| 日韩视频在线一区二区| 一区二区三区免费观看| 国产91精品一区二区麻豆网站| 欧美美女黄视频| 亚洲欧美日韩中文播放| 国产精品原创巨作av| 91麻豆精品国产91久久久久| 亚洲女同女同女同女同女同69| 国产一区二区电影| 91精品国产综合久久久久久漫画| 日韩理论电影院| 成人av在线一区二区三区| 久久综合网色—综合色88| 天天影视涩香欲综合网| 欧美在线影院一区二区| 中文欧美字幕免费| 国产一区二区三区综合| 91麻豆精品国产综合久久久久久| 一区二区在线观看免费| 成人av综合在线| 国产欧美日韩另类一区| 国产精品99久久久久久久女警| 日韩欧美国产不卡| 蜜臀va亚洲va欧美va天堂| 欧美精品一级二级| 天天综合色天天综合色h| 欧美日韩一区二区三区免费看| 亚洲欧洲性图库| 91丨九色丨尤物| 亚洲精品成a人| 在线观看视频91| 亚洲国产视频在线| 欧美日韩精品电影| 亚洲大片在线观看| 欧美老女人第四色| 蜜臀av性久久久久蜜臀aⅴ流畅| 在线电影国产精品| 蜜臀久久99精品久久久久宅男| 日韩欧美国产wwwww|