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

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

?? sp_enc.cpp

?? 實現了錄音,放音功能!在evc4.0下編譯功過,wince5.0下能正常錄音,放音,暫停錄放音!
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
}
//#endif

/*
* Pitch_ol
*
*
* Parameters:
*    mode           I: AMR mode
*    vadSt          B: VAD state struct
*    signal         I: signal used to compute the open loop pitch
*                                                 [[-pit_max]:[-1]]
*    pit_min        I: minimum pitch lag
*    pit_max        I: maximum pitch lag
*    L_frame        I: length of frame to compute pitch
*    dtx            I: DTX flag
*    idx            I: frame index
*
* Function:
*    Compute the open loop pitch lag.
*
*    Open-loop pitch analysis is performed twice per frame (each 10 ms)
*    to find two estimates of the pitch lag in each frame.
*    Open-loop pitch analysis is performed as follows.
*    In the first step, 3 maxima of the correlation:
*
*          79
*    O(k) = SUM Sw(n)*Sw(n-k)
*          n=0
*
*    are found in the three ranges:
*       pit_min     ...      2*pit_min-1
*       2*pit_min   ...      4*pit_min-1
*       4*pit_min   ...      pit_max
*
*    The retained maxima O(t(i)), i = 1, 2, 3, are normalized by dividing by
*
*    SQRT[SUM[POW(Sw(n-t(i)), 2]], i = 1, 2, 3,
*         n
*
*    respectively.
*    The normalized maxima and corresponding delays are denoted by
*    (LP_ORDER(i), t(i)), i = 1, 2, 3. The winner, Top, among the three normalized
*    correlations is selected by favouring the delays with the values
*    in the lower range. This is performed by weighting the normalized
*    correlations corresponding to the longer delays. The best
*    open-loop delay Top is determined as follows:
*
*    Top = t(1)
*    LP_ORDER(Top) = LP_ORDER(1)
*    if LP_ORDER(2) > 0.85 * LP_ORDER(Top)
*       LP_ORDER(Top) = LP_ORDER(2)
*       Top = t(2)
*    end
*    if LP_ORDER(3) > 0.85 * LP_ORDER(Top)
*       LP_ORDER(Top) = LP_ORDER(3)
*       Top = t(3)
*    end
*
* Returns:
*    void
*/
static INT32 Pitch_ol( enum Mode mode, vadState *vadSt, float signal[], INT32 pit_min, 
					   INT32 pit_max, INT16 L_frame, INT32 dtx, INT16 idx )
{
	float corr[PIT_MAX + 1];
	float max1, max2, max3, p_max1, p_max2, p_max3;
	float *corr_ptr;
	INT32 i, j;
	/*
	#ifdef VAD2
	float r01, r02, r03;
	float rmax1, rmax2, rmax3;
	#else
	*/
	float corr_hp_max;
	//#endif
	
	
	//#ifndef VAD2
	if ( dtx )
	{
		/* update tone detection */
		if ( ( mode == MR475 ) || ( mode == MR515 ) )
		{
			vad_tone_detection_update( vadSt, 1 );
		}
		else 
		{
			vad_tone_detection_update( vadSt, 0 );
		}
	}
	//#endif
	
	corr_ptr = &corr[pit_max];
	
	/*        79             */
	/* O(k) = SUM Sw(n)*Sw(n-k)   */
	/*        n=0               */
	comp_corr( signal, L_frame, pit_max, pit_min, corr_ptr );
	
	/*
	#ifdef VAD2
	/ * Find a maximum for each section.	* /
	/ * Maxima 1	* /
	j = pit_min << 2;
	p_max1 =
	Lag_max( corr_ptr, signal, L_frame, pit_max, j, &max1, dtx, &rmax1, &r01 );
	
	  / * Maxima 2	* /
	  i = j - 1;
	  j = pit_min << 1;
	  p_max2 = Lag_max( corr_ptr, signal, L_frame, i, j, &max2, dtx, &rmax2, &r02 );
	  
		/ * Maxima 3	* /
		i = j - 1;
		p_max3 =
		Lag_max( corr_ptr, signal, L_frame, i, pit_min, &max3, dtx, &rmax3, &r03 );
		#else
	*/
	/* Find a maximum for each section.	*/
	/* Maxima 1	*/
	j = pit_min << 2;
	p_max1 = Lag_max( vadSt, corr_ptr, signal, L_frame, pit_max, j, &max1, dtx );
	
	/* Maxima 2 */
	i = j - 1;
	j = pit_min << 1;
	p_max2 = Lag_max( vadSt, corr_ptr, signal, L_frame, i, j, &max2, dtx );
	
	/* Maxima 3 */
	i = j - 1;
	p_max3 = Lag_max( vadSt, corr_ptr, signal, L_frame, i, pit_min, &max3, dtx );
	
	if ( dtx ) {
		if ( idx == 1 ) {
			/* calculate max high-passed filtered correlation of all lags */
			hp_max( corr_ptr, signal, L_frame, pit_max, pit_min, &corr_hp_max );
			
			/* update complex background detector */
			vadSt->best_corr_hp = corr_hp_max * 0.5F;
		}
	}
	//#endif
	
	/* The best open-loop delay */
	if ( ( max1 * 0.85F ) < max2 )
	{
		max1 = max2;
		p_max1 = p_max2;
		/*
		#ifdef VAD2
		if (dtx) {
		rmax1 = rmax2;
		r01 = r02;
		}
		#endif
		*/
	}
	
	if ( ( max1 * 0.85F ) < max3 )
	{
		p_max1 = p_max3;
		/*
		#ifdef VAD2
		if (dtx) {
		rmax1 = rmax3;
		r01 = r03;
		}
		#endif
		*/
	}
	/*
	#ifdef VAD2
	if (dtx) {
	vadSt->Rmax += rmax1;   / * Save max correlation * /
	vadSt->R0   += r01;     / * Save max energy * /
	}
	#endif
	*/
	return( INT32 )p_max1;
}


/*
* Lag_max_wght
*
*
* Parameters:
*    vadSt          B: vad structure
*    corr           I: correlation vector
*    signal         I: signal
*    L_frame        I: length of frame to compute pitch
*    old_lag        I: old open-loop lag
*    cor_max        O: maximum correlation
*    wght_flg       I: weighting function flag
*    gain_flg       O: open-loop flag
*    dtx            I: dtx on/off
*
* Function:
*    Find the lag that has maximum correlation of signal in a given delay range.
*    maximum lag = 143
*    minimum lag = 20
*
* Returns:
*    p_max             lag found
*/
static INT32 Lag_max_wght( vadState *vadSt, float corr[], float signal[], INT32 old_lag,
						   INT32 *cor_max, INT32 wght_flg, float *gain_flg, INT32 dtx )
{
	float t0, t1, max;
	float *psignal, *p1signal;
	const float *ww, *we;
	INT32 i, j, p_max;
	
	
	ww = &corrweight[250];
	we = &corrweight[266 - old_lag];
	max = -FLT_MAX;
	p_max = PIT_MAX;
	
	/* see if the neigbouring emphasis is used */
	if ( wght_flg > 0 )
	{
		/* find maximum correlation with weighting */
		for ( i = PIT_MAX; i >= PIT_MIN; i-- ) 
		{
			/* Weighting of the correlation function. */
			t0 = corr[ - i] * *ww--;
			/* Weight the neighbourhood of the old lag. */
			t0 *= *we--;
			
			if ( t0 >= max ) 
			{
				max = t0;
				p_max = i;
			}
		}
		
	}
	else 
	{
		/* find maximum correlation with weighting */
		for ( i = PIT_MAX; i >= PIT_MIN; i-- )
		{
			/* Weighting of the correlation function. */
			t0 = corr[ - i] * *ww--;
			
			if ( t0 >= max )
			{
				max = t0;
				p_max = i;
			}
		}
		
	}
	psignal = &signal[0];
	p1signal = &signal[ - p_max];
	t0 = 0;
	t1 = 0;
	
	/* Compute energy */
	for ( j = 0; j < FRAME_SIZE_BY2; j++, psignal++, p1signal++ )
	{
		t0 += *psignal * *p1signal;
		t1 += *p1signal * *p1signal;
	}
	
	if ( dtx )
	{
	/*
	#ifdef VAD2
	vadSt->Rmax += t0;   / * Save max correlation * /
	vadSt->R0   += t1;   / * Save max energy * /
	#else
		*/
		/* update and detect tone */
		vad_tone_detection_update( vadSt, 0 );
		vad_tone_detection( vadSt, t0, t1 );
		//#endif
	}
	
	/*
    * gain flag is set according to the open_loop gain
    * is t2/t1 > 0.4 ?
    */
	*gain_flg = t0 - ( t1 * 0.4F );
	*cor_max = 0;
	return( p_max );
}


/*
* gmed_n
*
*
* Parameters:
*    ind               I: values
*    n                 I: The number of gains
*
* Function:
*    Calculates N-point median.
*
* Returns:
*    index of the median value
*/
static INT32 gmed_n( INT32 ind[], INT32 n )
{
	INT32 i, j, ix = 0;
	INT32 max;
	INT32 medianIndex;
	INT32 tmp[9];
	INT32 tmp2[9];
	
	
	for ( i = 0; i < n; i++ ) 
	{
		tmp2[i] = ind[i];
	}
	
	for ( i = 0; i < n; i++ ) 
	{
		max = -32767;
		
		for ( j = 0; j < n; j++ ) 
		{
			if ( tmp2[j] >= max ) 
			{
				max = tmp2[j];
				ix = j;
			}
		}
		tmp2[ix] = -32768;
		tmp[i] = ix;
	}
	medianIndex = tmp[( n >>1 )];
	return( ind[medianIndex] );
}


/*
* Pitch_ol_wgh
*
*
* Parameters:
*    old_T0_med     O: old Cl lags median
*    wght_flg       I: weighting function flag
*    ada_w          B:
*    vadSt          B: VAD state struct
*    signal         I: signal used to compute the open loop pitch
*                                                  [[-pit_max]:[-1]]
*    old_lags       I: history with old stored Cl lags
*    ol_gain_flg    I: OL gain flag
*    idx            I: frame index
*    dtx            I: DTX flag
*
* Function:
*    Open-loop pitch search with weight
*
*    Open-loop pitch analysis is performed twice per frame (every 10 ms)
*    for the 10.2 kbit/s mode to find two estimates of the pitch lag
*    in each frame. The open-loop pitch analysis is done in order to simplify
*    the pitch analysis and confine the closed loop pitch search to
*    a small number of lags around the open-loop estimated lags.
*    Open-loop pitch estimation is based on the weighted speech signal
*    which is obtained by filtering the input speech signal through
*    the weighting filter.
*    The correlation of weighted speech is determined.
*    The estimated pitch-lag is the delay that maximises
*    the weighted autocorrelation function. To enhance  pitch-lag analysis
*    the autocorrelation function estimate is modified by a weighting window.
*    The weighting emphasises relevant pitch-lags, thus increasing
*    the likelihood of selecting the correct delay.
*    minimum pitch lag = 20
*    maximum pitch lag = 143
*
* Returns:
*    p_max1            open loop pitch lag
*/
static INT32 Pitch_ol_wgh( INT32 *old_T0_med, INT16 *wght_flg, float *ada_w, 
						   vadState *vadSt, float signal[], INT32 old_lags[], 
						   float ol_gain_flg[], INT16 idx, INT32 dtx )
{
	float corr[PIT_MAX + 1];
	//#ifndef VAD2
	float corr_hp_max;
	//#endif
	float *corrPtr;
	INT32 i, max1, p_max1;
	
	
	/* calculate all coreelations of signal, from pit_min to pit_max */
	corrPtr = &corr[PIT_MAX];
	comp_corr( signal, FRAME_SIZE_BY2, PIT_MAX, PIT_MIN, corrPtr );
	p_max1 = Lag_max_wght( vadSt, corrPtr, signal, *old_T0_med,
		&max1, *wght_flg, &ol_gain_flg[idx], dtx );
	
	if ( ol_gain_flg[idx] > 0 )
	{
		/* Calculate 5-point median of previous lags */
		/* Shift buffer */
		for ( i = 4; i > 0; i-- )
		{
			old_lags[i] = old_lags[i - 1];
		}
		old_lags[0] = p_max1;
		*old_T0_med = gmed_n( old_lags, 5 );
		*ada_w = 1;
	}
	else
	{
		*old_T0_med = p_max1;
		*ada_w = *ada_w * 0.9F;
	}
	
	if ( *ada_w < 0.3 ) 
	{
		*wght_flg = 0;
	}
	else
	{
		*wght_flg = 1;
	}
	
	//#ifndef VAD2
	if ( dtx )
	{
		if ( idx == 1 )
		{
			/* calculate max high-passed filtered correlation of all lags */
			hp_max( corrPtr, signal, FRAME_SIZE_BY2, PIT_MAX, PIT_MIN, &corr_hp_max );
			
			/* update complex background detector */
			vadSt->best_corr_hp = corr_hp_max * 0.5F;
		}
	}
	//#endif
	return( p_max1 );
}


/*
* ol_ltp
*
*
* Parameters:
*    mode              I: AMR mode
*    vadSt             B: VAD state struct
*    wsp               I: signal used to compute the OL pitch
*    T_op              O: open loop pitch lag
*    ol_gain_flg       I: OL gain flag
*    old_T0_med        O: old Cl lags median
*    wght_flg          I: weighting function flag
*    ada_w             B:
*    old_lags          I: history with old stored Cl lags
*    ol_gain_flg       I: OL gain flag
*    dtx               I: DTX flag
*    idx               I: frame index
*
* Function:
*    Compute the open loop pitch lag.
*
*    Open-loop pitch analysis is performed in order to simplify
*    the pitch analysis and confine the closed-loop pitch search to
*    a small number of lags around the open-loop estimated lags.
*    Open-loop pitch estimation is based on the weighted speech signal Sw(n)
*    which is obtained by filtering the input speech signal through
*    the weighting filter W(z) = A(z/g1) / A(z/g2). That is,
*    in a subframe of size L, the weighted speech is given by:
*
*                10
*    Sw(n) = S(n) + SUM[ a(i) * g1(i) * S(n-i) ]
*                i=1
*                   10
*                - SUM[ a(i) * g2(i) * Sw(n-i) ], n = 0, ..., L-1
*                  i=1
*
* Returns:
*    void
*/
static void ol_ltp( enum Mode mode, vadState *vadSt, float wsp[], INT32 *T_op,
							   float ol_gain_flg[], INT32 *old_T0_med, INT16 *wght_flg, 
							   float *ada_w, INT32 *old_lags, INT32 dtx, INT16 idx )
{
	if ( mode != MR102 )
	{
		ol_gain_flg[0] = 0;
		ol_gain_flg[1] = 0;
	}
	
	if ( ( mode == MR475 ) || ( mode == MR515 ) ) 
	{
		*T_op = Pitch_ol( mode, vadSt, wsp, PIT_MIN, PIT_MAX, FRAME_SIZE, dtx, idx );
	}
	else 
	{
		if ( mode <= MR795 ) 
		{
									   *T_op = Pitch_ol( mode, vadSt, wsp, PIT_MIN, PIT_MAX, FRAME_SIZE_BY2, dtx, idx );
		}
		else if ( mode == MR102 )
		{
									   *T_op = Pitch_ol_wgh( old_T0_med, wght_flg, ada_w, vadSt,
										   wsp, old_lags, ol_gain_flg, idx, dtx );
		}
		else 
		{
									   *T_op = Pitch_ol( mode, vadSt, wsp, PIT_MIN_MR122, 
										   PIT_MAX, FRAME_SIZE_BY2, dtx, idx );
		}
	}
}


/*
* subframePreProc
*
*
* Parameters:
*    mode           I: AMR mode
*    gamma1         I: spectral exp. factor 1
*    gamma1_12k2    I: spectral exp. factor 1 for EFR
*    gamma2         I: spectral exp. factor 2
*    A              I: A(z) unquantized for the 4 subframes
*    Aq             I: A(z)   quantized for the 4 subframes
*    speech         I: speech segment
*    mem_err        I: pointer to error signal
*    mem_w0         I: memory of weighting filter
*    zero           I: pointer to zero vector
*    ai_zero        O: history of weighted synth. filter
*    exc            O: INT32 term prediction residual
*    h1             O: impulse response
*    xn             O: target vector for pitch search
*    res2           O: INT32 term prediction residual
*    error          O: error of LPC synthesis filter
*
* Function:
*    Subframe preprocessing
*
*    Impulse response computation:
*       The impulse response, h(n), of the weighted synthesis filter
*
*       H(z) * W(z) = A(z/g1) / ( A'(z) * A(z/g2) )
*
*       is computed each subframe. This impulse response is needed for
*       the search of adaptive and fixed codebooks. The impulse response h(n)
*       is computed by filtering the vector of coefficients of
*       the filter A(z/g1) extended by zeros through the two filters
*       1/A'(z) and 1/A(z/g2).
*
*    Target signal computation:
*       The target signal for adaptive codebook search is usually computed
*       by subtracting the zero input response of
*       the weighted synthesis filter H(z) * W(z) from the weighted
*       speech signal Sw(n). This is performed on a 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久久久久久夜| 中文字幕在线观看一区二区| 国产成+人+日韩+欧美+亚洲| 亚洲不卡一区二区三区| 国产日产欧美一区二区三区| 91精品国产91久久久久久一区二区 | 欧美日本视频在线| av网站一区二区三区| 国产精品18久久久久| 精品一区中文字幕| 99精品视频在线观看| 精品久久国产字幕高潮| 日韩一区二区免费电影| 制服丝袜激情欧洲亚洲| 欧美日韩在线免费视频| 欧美在线色视频| 色婷婷av久久久久久久| 91成人看片片| 欧美日本在线观看| 欧美精品在线一区二区| 欧美精品电影在线播放| 欧美一级日韩一级| 精品国产sm最大网站| 亚洲精品国产第一综合99久久| 91麻豆精品国产91久久久资源速度| 一本到不卡精品视频在线观看 | 欧美高清视频一二三区| 欧美剧情电影在线观看完整版免费励志电影| 色综合中文字幕| 色系网站成人免费| 成人免费毛片a| 91视频免费播放| 欧美三级电影网| 日韩亚洲欧美一区二区三区| 日韩欧美在线一区二区三区| 精品少妇一区二区三区在线视频| 精品国产免费一区二区三区香蕉 | 一本色道久久综合亚洲aⅴ蜜桃| 99国产精品国产精品久久| 一本一道久久a久久精品综合蜜臀| 欧美视频中文字幕| 日韩欧美色电影| 中文字幕 久热精品 视频在线| 成人做爰69片免费看网站| 91免费观看视频| 7777精品伊人久久久大香线蕉完整版 | 色狠狠桃花综合| 亚洲视频一区二区在线观看| 亚洲国产一二三| 国产一区二区三区四| 99国产精品久| 欧美www视频| 亚洲乱码中文字幕综合| 免费观看一级特黄欧美大片| 成人视屏免费看| 欧美另类videos死尸| 欧美激情一区不卡| 日韩激情中文字幕| 99久久99久久精品国产片果冻 | 欧美日韩一级二级三级| 日韩一区二区在线播放| 国产精品美女久久久久aⅴ | 中文在线免费一区三区高中清不卡| 亚洲不卡在线观看| 亚洲成a人片在线不卡一二三区| 国产精品自拍在线| 精品视频色一区| 国产精品国产三级国产aⅴ原创| 日本不卡123| 欧美在线你懂的| 中文字幕一区二区三区在线观看 | 久久久久亚洲蜜桃| 亚洲三级久久久| 国产另类ts人妖一区二区| 欧美日韩国产系列| 亚洲乱码精品一二三四区日韩在线 | 日本一区二区在线不卡| 日韩在线观看一区二区| 在线免费观看日本欧美| 中日韩av电影| 91精品国产色综合久久不卡蜜臀 | 欧美中文一区二区三区| 久久久国产精品麻豆| 免费在线欧美视频| 在线电影国产精品| 亚洲一区二区欧美| 色香蕉久久蜜桃| 亚洲乱码中文字幕| 日本二三区不卡| 亚洲麻豆国产自偷在线| 成人av资源在线观看| 欧美激情综合五月色丁香| 国产精品综合av一区二区国产馆| 精品播放一区二区| 国产一区二区不卡在线| 久久女同性恋中文字幕| 久久精品欧美日韩| 精品一区二区免费视频| 欧美一区二区三区在线看| 在线不卡a资源高清| 午夜精品一区二区三区免费视频| 91精品1区2区| 亚洲国产精品视频| 欧美大片在线观看| 亚洲品质自拍视频网站| 色婷婷av一区二区三区软件| 1区2区3区精品视频| 91老师片黄在线观看| 亚洲免费观看高清在线观看| 在线观看日韩一区| 手机精品视频在线观看| 5月丁香婷婷综合| 免费观看在线色综合| 国产午夜亚洲精品不卡| 成人高清在线视频| 一区二区三区在线免费| 欧美丰满美乳xxx高潮www| 久久精品国产一区二区| 日本一区二区高清| 18欧美亚洲精品| 欧美三级中文字幕| 久久99久国产精品黄毛片色诱| 精品国产91久久久久久久妲己 | 91超碰这里只有精品国产| 亚洲国产视频一区| 日韩免费视频一区二区| 成人丝袜18视频在线观看| 亚洲福利视频三区| 日韩免费看的电影| 色综合久久天天| 日韩视频永久免费| av动漫一区二区| 日本视频免费一区| 国产精品青草久久| 欧美一区二视频| 99视频精品在线| 婷婷六月综合亚洲| 国产精品久久久久久久久动漫| 欧美性生活久久| 国产二区国产一区在线观看| 亚洲综合色视频| 国产农村妇女精品| 日韩欧美视频一区| 欧美三级资源在线| 久久久精品天堂| 欧美一二区视频| 精品一区二区三区在线播放视频| 一区二区三区欧美视频| 国产精品的网站| 日韩二区三区四区| 91精品国产高清一区二区三区蜜臀 | 欧美怡红院视频| 国产在线观看免费一区| 亚洲最色的网站| 欧美精品久久久久久久多人混战 | 亚洲欧美电影院| 久久久精品免费免费| 欧美挠脚心视频网站| 91视视频在线直接观看在线看网页在线看 | 久久精品在线观看| 7777精品伊人久久久大香线蕉的| av高清久久久| 成人国产免费视频| 国产精品一区二区久久精品爱涩| 日日夜夜免费精品| 亚洲午夜成aⅴ人片| 中文字幕一区二区5566日韩| 精品日韩欧美在线| 欧美一区二区视频网站| 欧美性生活一区| 欧美影视一区在线| 欧美日韩国产片| 99国产精品99久久久久久| 92精品国产成人观看免费 | 精品999在线播放| 欧美日韩国产高清一区二区三区 | 久久精品欧美一区二区三区麻豆 | 国产在线精品不卡| 久久电影国产免费久久电影| 欧美在线三级电影| 亚洲免费成人av| 亚洲免费av在线| 亚洲在线视频一区| 亚洲成人高清在线| 蜜臀精品一区二区三区在线观看 | 91国产丝袜在线播放| 成人av网址在线| proumb性欧美在线观看| 国产不卡在线播放| eeuss国产一区二区三区| 成人ar影院免费观看视频| 成人丝袜18视频在线观看| jlzzjlzz亚洲日本少妇| 成人激情小说乱人伦| 99这里都是精品| 欧美制服丝袜第一页| 欧美精品第1页| 欧美精品一区二区精品网| 国产欧美日韩卡一| 亚洲欧美成人一区二区三区|