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

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

?? rpe.c

?? GSM模塊函數GSM模塊函數GSM模塊函數GSM模塊函數GSM模塊函數GSM模塊函數GSM模塊函數GSM模塊函數
?? C
字號:
/* * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. *//* $Header: /cvsroot/linphone/linphone/gsmlib/rpe.c,v 1.1.1.1 2001/11/19 19:50:12 smorlat Exp $ */#include <stdio.h>#include <assert.h>#include "private.h"#include "gsm.h"#include "proto.h"/*  4.2.13 .. 4.2.17  RPE ENCODING SECTION *//* 4.2.13 */static void Weighting_filter P2((e, x),	register word	* e,		/* signal [-5..0.39.44]	IN  */	word		* x		/* signal [0..39]	OUT */)/* *  The coefficients of the weighting filter are stored in a table *  (see table 4.4).  The following scaling is used: * *	H[0..10] = integer( real_H[ 0..10] * 8192 );  */{	/* word			wt[ 50 ]; */	register longword	L_result;	register int		k /* , i */ ;	/*  Initialization of a temporary working array wt[0...49]	 */	/* for (k =  0; k <=  4; k++) wt[k] = 0;	 * for (k =  5; k <= 44; k++) wt[k] = *e++;	 * for (k = 45; k <= 49; k++) wt[k] = 0;	 *	 *  (e[-5..-1] and e[40..44] are allocated by the caller,	 *  are initially zero and are not written anywhere.)	 */	e -= 5;	/*  Compute the signal x[0..39]	 */ 	for (k = 0; k <= 39; k++) {		L_result = 8192 >> 1;		/* for (i = 0; i <= 10; i++) {		 *	L_temp   = GSM_L_MULT( wt[k+i], gsm_H[i] );		 *	L_result = GSM_L_ADD( L_result, L_temp );		 * }		 */#undef	STEP#define	STEP( i, H )	(e[ k + i ] * (longword)H)		/*  Every one of these multiplications is done twice --		 *  but I don't see an elegant way to optimize this. 		 *  Do you?		 */#ifdef	STUPID_COMPILER		L_result += STEP(	0, 	-134 ) ;		L_result += STEP(	1, 	-374 )  ;	               /* + STEP(	2, 	0    )  */		L_result += STEP(	3, 	2054 ) ;		L_result += STEP(	4, 	5741 ) ;		L_result += STEP(	5, 	8192 ) ;		L_result += STEP(	6, 	5741 ) ;		L_result += STEP(	7, 	2054 ) ;	 	       /* + STEP(	8, 	0    )  */		L_result += STEP(	9, 	-374 ) ;		L_result += STEP(	10, 	-134 ) ;#else		L_result +=		  STEP(	0, 	-134 ) 		+ STEP(	1, 	-374 ) 	     /* + STEP(	2, 	0    )  */		+ STEP(	3, 	2054 ) 		+ STEP(	4, 	5741 ) 		+ STEP(	5, 	8192 ) 		+ STEP(	6, 	5741 ) 		+ STEP(	7, 	2054 ) 	     /* + STEP(	8, 	0    )  */		+ STEP(	9, 	-374 ) 		+ STEP(10, 	-134 )		;#endif		/* L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x2) *)		 * L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x4) *)		 *		 * x[k] = SASR( L_result, 16 );		 */		/* 2 adds vs. >>16 => 14, minus one shift to compensate for		 * those we lost when replacing L_MULT by '*'.		 */		L_result = SASR( L_result, 13 );		x[k] =  (  L_result < MIN_WORD ? MIN_WORD			: (L_result > MAX_WORD ? MAX_WORD : L_result ));	}}/* 4.2.14 */static void RPE_grid_selection P3((x,xM,Mc_out),	word		* x,		/* [0..39]		IN  */ 	word		* xM,		/* [0..12]		OUT */	word		* Mc_out	/*			OUT */)/* *  The signal x[0..39] is used to select the RPE grid which is *  represented by Mc. */{	/* register word	temp1;	*/	register int		/* m, */  i;	register longword	L_result, L_temp;	longword		EM;	/* xxx should be L_EM? */	word			Mc;	longword		L_common_0_3;	EM = 0;	Mc = 0;	/* for (m = 0; m <= 3; m++) {	 *	L_result = 0;	 *	 *	 *	for (i = 0; i <= 12; i++) {	 *	 *		temp1    = SASR( x[m + 3*i], 2 );	 *	 *		assert(temp1 != MIN_WORD);	 *	 *		L_temp   = GSM_L_MULT( temp1, temp1 );	 *		L_result = GSM_L_ADD( L_temp, L_result );	 *	}	 * 	 *	if (L_result > EM) {	 *		Mc = m;	 *		EM = L_result;	 *	}	 * }	 */#undef	STEP#define	STEP( m, i )		L_temp = SASR( x[m + 3 * i], 2 );	\				L_result += L_temp * L_temp;	/* common part of 0 and 3 */	L_result = 0;	STEP( 0, 1 ); STEP( 0, 2 ); STEP( 0, 3 ); STEP( 0, 4 );	STEP( 0, 5 ); STEP( 0, 6 ); STEP( 0, 7 ); STEP( 0, 8 );	STEP( 0, 9 ); STEP( 0, 10); STEP( 0, 11); STEP( 0, 12);	L_common_0_3 = L_result;	/* i = 0 */	STEP( 0, 0 );	L_result <<= 1;	/* implicit in L_MULT */	EM = L_result;	/* i = 1 */	L_result = 0;	STEP( 1, 0 );	STEP( 1, 1 ); STEP( 1, 2 ); STEP( 1, 3 ); STEP( 1, 4 );	STEP( 1, 5 ); STEP( 1, 6 ); STEP( 1, 7 ); STEP( 1, 8 );	STEP( 1, 9 ); STEP( 1, 10); STEP( 1, 11); STEP( 1, 12);	L_result <<= 1;	if (L_result > EM) {		Mc = 1;	 	EM = L_result;	}	/* i = 2 */	L_result = 0;	STEP( 2, 0 );	STEP( 2, 1 ); STEP( 2, 2 ); STEP( 2, 3 ); STEP( 2, 4 );	STEP( 2, 5 ); STEP( 2, 6 ); STEP( 2, 7 ); STEP( 2, 8 );	STEP( 2, 9 ); STEP( 2, 10); STEP( 2, 11); STEP( 2, 12);	L_result <<= 1;	if (L_result > EM) {		Mc = 2;	 	EM = L_result;	}	/* i = 3 */	L_result = L_common_0_3;	STEP( 3, 12 );	L_result <<= 1;	if (L_result > EM) {		Mc = 3;	 	EM = L_result;	}	/**/	/*  Down-sampling by a factor 3 to get the selected xM[0..12]	 *  RPE sequence.	 */	for (i = 0; i <= 12; i ++) xM[i] = x[Mc + 3*i];	*Mc_out = Mc;}/* 4.12.15 */static void APCM_quantization_xmaxc_to_exp_mant P3((xmaxc,exp_out,mant_out),	word		xmaxc,		/* IN 	*/	word		* exp_out,	/* OUT	*/	word		* mant_out )	/* OUT  */{	word	exp, mant;	/* Compute exponent and mantissa of the decoded version of xmaxc	 */	exp = 0;	if (xmaxc > 15) exp = SASR(xmaxc, 3) - 1;	mant = xmaxc - (exp << 3);	if (mant == 0) {		exp  = -4;		mant = 7;	}	else {		while (mant <= 7) {			mant = mant << 1 | 1;			exp--;		}		mant -= 8;	}	assert( exp  >= -4 && exp <= 6 );	assert( mant >= 0 && mant <= 7 );	*exp_out  = exp;	*mant_out = mant;}static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out),	word		* xM,		/* [0..12]		IN	*/	word		* xMc,		/* [0..12]		OUT	*/	word		* mant_out,	/* 			OUT	*/	word		* exp_out,	/*			OUT	*/	word		* xmaxc_out	/*			OUT	*/){	int	i, itest;	word	xmax, xmaxc, temp, temp1, temp2;	word	exp, mant;	/*  Find the maximum absolute value xmax of xM[0..12].	 */	xmax = 0;	for (i = 0; i <= 12; i++) {		temp = xM[i];		temp = GSM_ABS(temp);		if (temp > xmax) xmax = temp;	}	/*  Qantizing and coding of xmax to get xmaxc.	 */	exp   = 0;	temp  = SASR( xmax, 9 );	itest = 0;	for (i = 0; i <= 5; i++) {		itest |= (temp <= 0);		temp = SASR( temp, 1 );		assert(exp <= 5);		if (itest == 0) exp++;		/* exp = add (exp, 1) */	}	assert(exp <= 6 && exp >= 0);	temp = exp + 5;	assert(temp <= 11 && temp >= 0);	xmaxc = gsm_add( SASR(xmax, temp), exp << 3 );	/*   Quantizing and coding of the xM[0..12] RPE sequence	 *   to get the xMc[0..12]	 */	APCM_quantization_xmaxc_to_exp_mant( xmaxc, &exp, &mant );	/*  This computation uses the fact that the decoded version of xmaxc	 *  can be calculated by using the exponent and the mantissa part of	 *  xmaxc (logarithmic table).	 *  So, this method avoids any division and uses only a scaling	 *  of the RPE samples by a function of the exponent.  A direct 	 *  multiplication by the inverse of the mantissa (NRFAC[0..7]	 *  found in table 4.5) gives the 3 bit coded version xMc[0..12]	 *  of the RPE samples.	 */	/* Direct computation of xMc[0..12] using table 4.5	 */	assert( exp <= 4096 && exp >= -4096);	assert( mant >= 0 && mant <= 7 ); 	temp1 = 6 - exp;		/* normalization by the exponent */	temp2 = gsm_NRFAC[ mant ];  	/* inverse mantissa 		 */	for (i = 0; i <= 12; i++) {		assert(temp1 >= 0 && temp1 < 16);		temp = xM[i] << temp1;		temp = GSM_MULT( temp, temp2 );		temp = SASR(temp, 12);		xMc[i] = temp + 4;		/* see note below */	}	/*  NOTE: This equation is used to make all the xMc[i] positive.	 */	*mant_out  = mant;	*exp_out   = exp;	*xmaxc_out = xmaxc;}/* 4.2.16 */static void APCM_inverse_quantization P4((xMc,mant,exp,xMp),	register word	* xMc,	/* [0..12]			IN 	*/	word		mant,	word		exp,	register word	* xMp)	/* [0..12]			OUT 	*//*  *  This part is for decoding the RPE sequence of coded xMc[0..12] *  samples to obtain the xMp[0..12] array.  Table 4.6 is used to get *  the mantissa of xmaxc (FAC[0..7]). */{	int	i;	word	temp, temp1, temp2, temp3;	longword	ltmp;	assert( mant >= 0 && mant <= 7 ); 	temp1 = gsm_FAC[ mant ];	/* see 4.2-15 for mant */	temp2 = gsm_sub( 6, exp );	/* see 4.2-15 for exp  */	temp3 = gsm_asl( 1, gsm_sub( temp2, 1 ));	for (i = 13; i--;) {		assert( *xMc <= 7 && *xMc >= 0 ); 	/* 3 bit unsigned */		/* temp = gsm_sub( *xMc++ << 1, 7 ); */		temp = (*xMc++ << 1) - 7;	        /* restore sign   */		assert( temp <= 7 && temp >= -7 ); 	/* 4 bit signed   */		temp <<= 12;				/* 16 bit signed  */		temp = GSM_MULT_R( temp1, temp );		temp = GSM_ADD( temp, temp3 );		*xMp++ = gsm_asr( temp, temp2 );	}}/* 4.2.17 */static void RPE_grid_positioning P3((Mc,xMp,ep),	word		Mc,		/* grid position	IN	*/	register word	* xMp,		/* [0..12]		IN	*/	register word	* ep		/* [0..39]		OUT	*/)/* *  This procedure computes the reconstructed long term residual signal *  ep[0..39] for the LTP analysis filter.  The inputs are the Mc *  which is the grid position selection and the xMp[0..12] decoded *  RPE samples which are upsampled by a factor of 3 by inserting zero *  values. */{	int	i = 13;	assert(0 <= Mc && Mc <= 3);        switch (Mc) {                case 3: *ep++ = 0;                case 2:  do {                                *ep++ = 0;                case 1:         *ep++ = 0;                case 0:         *ep++ = *xMp++;                         } while (--i);        }        while (++Mc < 4) *ep++ = 0;	/*	int i, k;	for (k = 0; k <= 39; k++) ep[k] = 0;	for (i = 0; i <= 12; i++) {		ep[ Mc + (3*i) ] = xMp[i];	}	*/}/* 4.2.18 *//*  This procedure adds the reconstructed long term residual signal *  ep[0..39] to the estimated signal dpp[0..39] from the long term *  analysis filter to compute the reconstructed short term residual *  signal dp[-40..-1]; also the reconstructed short term residual *  array dp[-120..-41] is updated. */#if 0	/* Has been inlined in code.c */void Gsm_Update_of_reconstructed_short_time_residual_signal P3((dpp, ep, dp),	word	* dpp,		/* [0...39]	IN	*/	word	* ep,		/* [0...39]	IN	*/	word	* dp)		/* [-120...-1]  IN/OUT 	*/{	int 		k;	for (k = 0; k <= 79; k++) 		dp[ -120 + k ] = dp[ -80 + k ];	for (k = 0; k <= 39; k++)		dp[ -40 + k ] = gsm_add( ep[k], dpp[k] );}#endif	/* Has been inlined in code.c */void Gsm_RPE_Encoding P5((S,e,xmaxc,Mc,xMc),	struct gsm_state * S,	word	* e,		/* -5..-1][0..39][40..44	IN/OUT  */	word	* xmaxc,	/* 				OUT */	word	* Mc,		/* 			  	OUT */	word	* xMc)		/* [0..12]			OUT */{	word	x[40];	word	xM[13], xMp[13];	word	mant, exp;	Weighting_filter(e, x);	RPE_grid_selection(x, xM, Mc);	APCM_quantization(	xM, xMc, &mant, &exp, xmaxc);	APCM_inverse_quantization(  xMc,  mant,  exp, xMp);	RPE_grid_positioning( *Mc, xMp, e );}void Gsm_RPE_Decoding P5((S, xmaxcr, Mcr, xMcr, erp),	struct gsm_state	* S,	word 		xmaxcr,	word		Mcr,	word		* xMcr,  /* [0..12], 3 bits 		IN	*/	word		* erp	 /* [0..39]			OUT 	*/){	word	exp, mant;	word	xMp[ 13 ];	APCM_quantization_xmaxc_to_exp_mant( xmaxcr, &exp, &mant );	APCM_inverse_quantization( xMcr, mant, exp, xMp );	RPE_grid_positioning( Mcr, xMp, erp );}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区在线免费观看| 2021国产精品久久精品| 欧美一区二区在线免费观看| 久久久99精品免费观看不卡| 亚洲成人午夜影院| 97国产精品videossex| 精品毛片乱码1区2区3区 | 精品日韩欧美一区二区| 中文字幕亚洲精品在线观看| 久久99国产精品久久99果冻传媒| 欧美性做爰猛烈叫床潮| 国产精品不卡一区| 国产一区二区三区观看| 欧美肥胖老妇做爰| 亚洲免费电影在线| www.亚洲在线| 日本一二三不卡| 国产成人精品午夜视频免费 | 日本欧美一区二区在线观看| 色综合 综合色| 综合av第一页| 成人深夜在线观看| 国产亚洲短视频| 韩国三级在线一区| 日韩一区二区三区精品视频| 亚洲国产欧美在线| 欧美午夜精品免费| 亚洲一区二区精品视频| 欧美在线不卡视频| 亚洲一区二区欧美日韩| 欧洲一区在线观看| 亚洲成人免费在线观看| 欧美专区日韩专区| 亚洲国产日韩一区二区| 欧美丰满一区二区免费视频| 午夜精品久久久久影视| 欧美日韩高清不卡| 美女性感视频久久| 精品免费日韩av| 国产成a人无v码亚洲福利| 国产欧美一区二区精品仙草咪| 丁香啪啪综合成人亚洲小说| 中文字幕一区在线| 色欲综合视频天天天| 亚洲大片一区二区三区| 欧美一区二区三区人| 国产在线国偷精品产拍免费yy| 国产亚洲欧美日韩俺去了| 国产精品亚洲一区二区三区妖精 | 国产乱理伦片在线观看夜一区| 精品国产a毛片| 国产.精品.日韩.另类.中文.在线.播放| 欧美高清在线精品一区| 91欧美激情一区二区三区成人| 亚洲一级二级三级| 欧美一区二区二区| 成人教育av在线| 夜夜夜精品看看| 日韩欧美国产wwwww| 成人免费av网站| 亚洲愉拍自拍另类高清精品| 日韩一级片在线播放| 成人性视频免费网站| 亚洲成人激情av| 久久久精品国产免大香伊| aaa欧美色吧激情视频| 日韩高清中文字幕一区| 国产拍欧美日韩视频二区| 在线观看亚洲精品| 精品一区二区三区久久久| 亚洲欧美日韩精品久久久久| 欧美一区二区视频在线观看2022| 国产成人午夜99999| 午夜伦理一区二区| 中文字幕在线一区免费| 日韩一二在线观看| 97久久精品人人做人人爽50路| 蜜桃一区二区三区在线| 亚洲激情六月丁香| 久久久久久99久久久精品网站| 在线免费观看不卡av| 国产精品456露脸| 日韩经典中文字幕一区| 国产精品福利一区二区三区| 日韩久久精品一区| 欧美日韩在线播放三区| 91在线码无精品| 国产一区欧美二区| 日本中文一区二区三区| 亚洲蜜臀av乱码久久精品| 国产亚洲综合在线| 精品国偷自产国产一区| 欧美色综合网站| 91一区二区三区在线观看| 成人在线视频一区二区| 精品无码三级在线观看视频| 亚洲国产美国国产综合一区二区| 国产精品视频在线看| 久久综合九色欧美综合狠狠| 日韩一级完整毛片| 7777精品伊人久久久大香线蕉完整版 | 亚洲人成精品久久久久| 中文字幕精品一区| 久久精品免视看| 亚洲精品在线观| 精品国产伦一区二区三区免费| 69成人精品免费视频| 在线免费一区三区| 欧美伊人久久久久久久久影院| jlzzjlzz亚洲日本少妇| 成人小视频在线观看| 国产精品99久久久久久宅男| 韩国精品一区二区| 国产乱码精品1区2区3区| 国产一区二区剧情av在线| 国产一区二区精品在线观看| 国产一区不卡视频| 国产专区综合网| 精品一区二区三区在线视频| 久久国产精品99精品国产 | 亚洲欧洲另类国产综合| 亚洲日本中文字幕区| 亚洲美女少妇撒尿| 亚洲午夜三级在线| 日本欧美一区二区| 黄色小说综合网站| 成人精品电影在线观看| 色婷婷狠狠综合| 欧美日韩中文字幕一区二区| 56国语精品自产拍在线观看| 日韩精品中午字幕| 欧美高清在线一区二区| 亚洲品质自拍视频| 午夜精品久久久| 九色综合狠狠综合久久| 国产69精品久久99不卡| 91丨porny丨户外露出| 欧美日韩国产综合一区二区| 91麻豆精品国产91| 久久久精品天堂| 亚洲日本韩国一区| 亚洲高清视频中文字幕| 久久99热狠狠色一区二区| 国产精品主播直播| 色偷偷久久一区二区三区| 欧美一区二区私人影院日本| 欧美国产精品一区| 午夜电影网亚洲视频| 国产成人综合自拍| 欧洲另类一二三四区| 精品剧情v国产在线观看在线| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日本精品视频一区二区三区| 91精品国产综合久久婷婷香蕉 | 国产精品自在在线| 色偷偷一区二区三区| 日韩精品资源二区在线| 有码一区二区三区| 精品一区二区三区欧美| 色哟哟在线观看一区二区三区| 日韩免费高清av| 一二三区精品视频| 风间由美一区二区三区在线观看| 欧美性xxxxxx少妇| 国产精品污污网站在线观看| 日本欧美在线观看| 91精品福利视频| 国产日韩欧美综合一区| 日日骚欧美日韩| 91电影在线观看| 久久精品欧美日韩| 麻豆一区二区三| 欧美视频一区二区三区四区| 中文一区二区完整视频在线观看| 免费精品视频在线| 欧美日韩国产欧美日美国产精品| 国产精品午夜免费| 国产精品亚洲一区二区三区在线 | 国产日本欧洲亚洲| 免费人成在线不卡| 欧美性生活大片视频| 亚洲三级电影网站| 成人少妇影院yyyy| 久久久噜噜噜久久人人看 | 亚洲精品一区二区三区蜜桃下载 | 亚洲午夜在线视频| 99re在线精品| 中文字幕中文字幕在线一区 | 日韩精品亚洲一区二区三区免费| av在线播放不卡| 国产精品天美传媒| 国产成人精品综合在线观看| 久久先锋影音av鲁色资源| 精品一区二区三区av| 日韩欧美一级二级三级久久久| 日本va欧美va瓶| 日韩小视频在线观看专区| 免费在线观看日韩欧美| 欧美一二三四在线| 蜜臀精品一区二区三区在线观看 |