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

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

?? classify.c

?? MELPe 1200 bps, fixed point
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ================================================================== */
/*                                                                    */ 
/*    Microsoft Speech coder     ANSI-C Source Code                   */
/*    SC1200 1200 bps speech coder                                    */
/*    Fixed Point Implementation      Version 7.0                     */
/*    Copyright (C) 2000, Microsoft Corp.                             */
/*    All rights reserved.                                            */
/*                                                                    */ 
/* ================================================================== */

/*------------------------------------------------------------------*/
/*																	*/
/* File:		classify.c											*/
/*																	*/
/* Description: classification routines								*/
/*																	*/
/*------------------------------------------------------------------*/


#include "sc1200.h"
#include "cprv.h"
#include "global.h"
#include "mat_lib.h"
#include "macro.h"
#include "mathhalf.h"
#include "constant.h"
#include "math_lib.h"
#include "dsp_sub.h"
#include "coeff.h"
#include "melp_sub.h"


#define PITCH_RANGE				5
#define SQRT_PIT_SUBFRAME_Q11	19429       /* sqrt(PIT_SUBFRAME) * (1 << 11) */
#define SILENCE_DB_Q11			6144          /* Originally 30.  subEnergy is */
                                     /* changed to 1/10 of its floating point */
                                          /* counterpart.  30/10 * (1 << 11). */
#define TWO_Q11					4096                         /* 2 * (1 << 11) */
#define THREE_Q11				6144                         /* 3 * (1 << 11) */
#define FIVE_Q11				10240                        /* 5 * (1 << 11) */
#define M_TEN_Q11				-20480
#define X04_Q15					13107                      /* 0.4 * (1 << 15) */
#define X045_Q15				14746                     /* 0.45 * (1 << 15) */
#define X05_Q12					2048                       /* 0.5 * (1 << 12) */
#define X055_Q15				18022                     /* 0.55 * (1 << 15) */
#define X06_Q15					19661                      /* 0.6 * (1 << 15) */
#define X065_Q15				21299                     /* 0.65 * (1 << 15) */
#define X14_Q11					2867                       /* 1.4 * (1 << 15) */
#define X15_Q11					3072                       /* 1.5 * (1 << 11) */
#define X16_Q11					3277                       /* 1.6 * (1 << 11) */
#define LOG2_Q11				617                 /* log10(2.0) * (1 << 11) */
#define ONE_OV_SQRT2_Q15		23170                /* 1/sqrt(2) * (1 << 15) */

const Shortword     enlpf_coef[EN_FILTER_ORDER] = {                    /* Q14 */
	/* the coefs of the filter (NOT h) */
	6764,  4336,  -274, -2536, -1491,
	  24,  -228, -1370, -1502,  -480,
	 383,   390,    57,   -18,   104,
	 132,    51 
};
const Shortword     enhpf_coef[EN_FILTER_ORDER] = {                    /* Q14 */
	/* the coefs of the filter (NOT h) */
	7783, -5211,   439,  1707,  -483,
	-978,   564,   630,  -861,   214,
     205,   -86,   -82,    43,    26,
	 -18,     2 
};

/* ========== Prototypes ========== */

static Shortword	zeroCrosCount(Shortword speech[]);
static Shortword	bandEn(Shortword autocorr[], Shortword band);
static void		frac_cor(Shortword inbuf[], Shortword pitch, Shortword *cor);


/****************************************************************************
**
** Function:		classify()
**
** Description: 	classification routine
**
** Arguments:
**
**	Shortword inbuf[]		speech buffer (Q0)
**	classParam *classStat	classification structure
**  Shortword autocorr[]	autocorrelation coefficients (normalized, Q value
**                          irrelevant)
**
** Return value:	None
**
*****************************************************************************/
void classify(Shortword inbuf[], classParam *classStat, Shortword autocorr[])
{
	register Shortword	i, j;
	static BOOLEAN	firstTime = TRUE;
	static Shortword	bpfdel[BPF_ORD + BPF_ORD/3];
	static Shortword	back_sigbuf[PIT_COR_LEN - PIT_SUBFRAME];
	const Shortword		*ptr_bpf_num, *ptr_bpf_den;
	Shortword	classy, sum1_shift = 0;
	Longword	L_sum1, L_sum2;                                         /* Q0 */
	Shortword	temp1, temp2, max;
	Longword	L_temp;
	Shortword	sigbuf_a[BPF_ORD/3 + PIT_COR_LEN];
	Shortword	sigbuf_b[BPF_ORD/3 + PIT_COR_LEN];
	Shortword	*sigbuf_in, *sigbuf_out, *temp_sigbuf;
	Shortword	sigbuf_len;
	Shortword	inspeech[PIT_SUBFRAME];     /* Normalized buffer for inbuf[]. */
	Shortword	lowhighBandDiff;                                       /* Q12 */
	Shortword	zeroCrosRateDiff;                                      /* Q15 */
	Shortword	subEnergyDiff;                                         /* Q11 */
	Shortword	lowBandCorx;      /* low band pcor moved from classParam, Q15 */


	if (firstTime){
		voicedEn = FIVE_Q11;       /* Both voicedEn and silenceEn are 1/10 of */
		silenceEn = THREE_Q11;     /* their values in floating point version. */
		voicedCnt = 0;
		v_zap(bpfdel, BPF_ORD + BPF_ORD/3);
	}

	/* The following inline implementation of iir_2nd_s() is for the          */
	/* complexity reduction.  The memory bpfdel[] plays both the roles for    */
	/* bpf_delin[] and bpf_delout[] in the past as the output memory for      */
	/* stage i (bpf_delout[2*i]@2) is the input memory for stage (i+1)        */
	/* (bpf_delin[2*(i+1)]@2).                                                */

	if (firstTime){

		/* The first time we run the 3-stage filters, we have to compute the  */
		/* whole sequence of length PIT_COR_LEN (220).  After that, every     */
		/* time we only need to compute PIT_SUBFRAME (90) new ones and        */
		/* combine it with the result shifted from the previous run           */
		/* (back_sigbuf[]).                                                   */

		sigbuf_in = sigbuf_a;
		sigbuf_out = sigbuf_b;
		sigbuf_len = PIT_COR_LEN;

		v_equ(&(sigbuf_in[BPF_ORD/3]),
			  &(inbuf[(PIT_SUBFRAME - PIT_COR_LEN)/2]), sigbuf_len);
	} else {
		sigbuf_in = sigbuf_a + PIT_COR_LEN - PIT_SUBFRAME;
		sigbuf_out = sigbuf_b + PIT_COR_LEN - PIT_SUBFRAME;
		sigbuf_len = PIT_SUBFRAME;

		/* Whether back_sigbuf is assigned to sigbuf_in or sigbuf_out depends */
		/* on the oddity of BPF_ORD/2.                                        */

		v_equ(&(sigbuf_in[BPF_ORD/3]),
			  &(inbuf[(PIT_COR_LEN - PIT_SUBFRAME)/2]), sigbuf_len);
		v_equ(&(sigbuf_out[BPF_ORD/3 - PIT_COR_LEN + PIT_SUBFRAME]),
			  back_sigbuf, PIT_COR_LEN - PIT_SUBFRAME);
	}

	ptr_bpf_num = bpf_num;                   /* It will point to bpf_num[3*i] */
	ptr_bpf_den = bpf_den + 1;                         /* and bpf_den[3*i+1]. */
	for (i = 0; i < BPF_ORD/2; i++){
		/*	iir_2nd_s(&(sigbuf[BPF_ORD/3]), &bpf_den[i*3], &bpf_num[i*3],
				  &(sigbuf[BPF_ORD/3]), &bpf_delin[i*2], &bpf_delout[i*2],
				  sigbuf_len); */
		v_equ(sigbuf_in, &(bpfdel[2*i]), BPF_ORD/3);
		v_equ(sigbuf_out, &(bpfdel[2*i + 2]), BPF_ORD/3);
		for (j = BPF_ORD/3; j < add(sigbuf_len, BPF_ORD/3); j++){
			L_temp = L_mult(sigbuf_in[j], ptr_bpf_num[0]);
			L_temp = L_mac(L_temp, sigbuf_in[j - 1], ptr_bpf_num[1]);
			L_temp = L_mac(L_temp, sigbuf_in[j - 2], ptr_bpf_num[2]);

			L_temp = L_mac(L_temp, sigbuf_out[j - 1], ptr_bpf_den[0]);
			L_temp = L_mac(L_temp, sigbuf_out[j - 2], ptr_bpf_den[1]);

			L_temp = L_shl(L_temp, 2);

			sigbuf_out[j] = round(L_temp);
		}
		v_equ(&(bpfdel[2*i]), &(sigbuf_in[sigbuf_len]), BPF_ORD/3);

		temp_sigbuf = sigbuf_in;
		sigbuf_in = sigbuf_out;
		sigbuf_out = temp_sigbuf;

		ptr_bpf_num += 3;
		ptr_bpf_den += 3;
	}

	if (firstTime){
		firstTime = FALSE;
		sigbuf_out = sigbuf_in;    /* The loop is over and we switch it back. */
	} else
		sigbuf_out = sigbuf_in - (PIT_COR_LEN - PIT_SUBFRAME);

	v_equ(&(bpfdel[BPF_ORD]), &(sigbuf_out[PIT_COR_LEN]), BPF_ORD/3);

	v_equ(back_sigbuf, &(sigbuf_out[BPF_ORD/3 + PIT_SUBFRAME]),
		  PIT_COR_LEN - PIT_SUBFRAME);

	/* Compute subframe energy.  Note that L_sum1 can have a large dynamic    */
	/* range as sum1 can be as small as 0 and as large as                     */
	/* PIT_SUBFRAME * 32767^2 (in theory, though in reality almost            */
	/* impossible).  Because L_v_magsq() implements by adding all the         */
	/* Longword partial products before adjusting the Q value, we need to     */
	/* avoid overflow this temporary sum, which means making sure the input   */
	/* for L_v_magsq() is less than sqrt(LW_MAX/PIT_SUBFRAME) ~ 4884.  If we  */
	/* assume a single-frequency pure sinusoidal inbuf[], the limit is raised */
	/* to sqrt(2*LW_MAX/PIT_SUBFRAME) ~ 6908.  The input of classify() is     */
	/* basically raw speech (probably processed by NPP).                      */

	/*	sum1 = v_inner(inbuf, inbuf, PIT_SUBFRAME); */
	/* ------ Compute peakiness measure ------ */

	max = 0;
	L_sum2 = 0;
	for (i = 0; i < PIT_SUBFRAME; i++){
		temp1 = abs_s(inbuf[i]);
		if (max < temp1)
			max = temp1;
		L_sum2 = L_add(L_sum2, temp1);       /* L_sum2 is safe from overflow. */
	}

	if (max == 0){                                         /* All zero signal */
		L_sum1 = 0;
	} else if (max <= 4884){    /* Partial sum of L_v_magsq() not overflowing */
		L_sum1 = L_v_magsq(inbuf, PIT_SUBFRAME, 0, 0);
		sum1_shift = 0;
	} else {
		v_equ_shr(inspeech, inbuf, 3, PIT_SUBFRAME); /* (inbuf[] >> 3) < 4884 */
		L_sum1 = L_v_magsq(inspeech, PIT_SUBFRAME, 0, 0);
		sum1_shift = 6;
	}

	/* Adjust L_sum1 so it does not overflow a Shortword. */
	while (L_sum1 > SW_MAX){
		L_sum1 = L_shr(L_sum1, 2);
		sum1_shift = add(sum1_shift, 2);
	}

	/* Note that classStat->subEnergy is only 1/10 of its floating point      */
	/* counterpart.                                                           */

	if (L_sum1 == 0)
		classStat->subEnergy = M_TEN_Q11;
	else {
		/*	classStat->subEnergy = log10(L_sum1); */
		temp1 = log10_fxp(extract_l(L_sum1), 0);                       /* Q12 */
		temp1 = shr(temp1, 1);                                         /* Q11 */
		L_temp = L_mult(LOG2_Q11, sum1_shift);                         /* Q12 */
		temp2 = extract_l(L_shr(L_temp, 1));                           /* Q11 */
		classStat->subEnergy = add(temp1, temp2);                      /* Q11 */
	}

	/* ------ Compute zero crossing rate ------ */
	classStat->zeroCrosRate = zeroCrosCount(inbuf);

	/* If L_sum2 == 0, L_sum1 == 0 too and we can set classStat->peakiness to */
	/* 1.  We later compare it against 1.4, 1.5, 1.6 and 2.0, so 0 and 1      */
	/* makes no differences.                                                  */

	/* Now L_sum1*pow(2.0, sum1_shift) and L_sum2 are the square of the       */
	/* 2-norm and the 1-norm of inbuf[], respectively.  It can be proved that */
	/* the 2-norm is always no larger than the 1-norm and we can call         */
	/* divide_s() to find their quotient.  That is,                           */
    /*     || x ||_2  <=  || x ||_1  <=  sqrt(n)*|| x ||_2.                   */
    /* See "Matrix Computation" by Gene H. Golub and Charles F. van Loan.     */
    /* The peakiness is therefore between 1 and sqrt(PIT_SUBFRAME).           */

	if (L_sum2 == 0)
		classStat->peakiness = ONE_Q11;
	else {
		/*	classStat->peakiness =
				sqrt(L_sum1/PIT_SUBFRAME)/(L_sum2/PIT_SUBFRAME); */
		sum1_shift = add(sum1_shift, 15);                 /* L_sum1 Q0 -> Q15 */
		if (sum1_shift & 0x0001){                        /* sum1_shift is odd */
			temp1 = extract_l(L_shr(L_sum1, 1));                       /* Q15 */
			sum1_shift = add(sum1_shift, 1);
		} else                                          /* sum1_shift is even */
			temp1 = extract_l(L_sum1);                                 /* Q15 */
		sum1_shift = shr(sum1_shift, 1);
		temp1 = sqrt_Q15(temp1);                                   /* Q15 */

		/* (temp1 * 2^-15 * 2^sum1_shift) is || x ||_2 above, so              */
		/* L_shr(L_sum2, sum1_shift) is (|| x ||_1 / || x ||_2) * temp1 *     */
		/* 2^-15, guaranteed to fit in a Shortword.  However, the above       */
		/* result is upper-bounded by sqrt(PIT_SUBFRAME) and a Q0 could mean  */
		/* significant loss of precision.  We use Q8 for it and therefore we  */
		/* adjust sum1_shift beforehand.                                      */

		sum1_shift = sub(sum1_shift, 8);
		temp2 = extract_l(L_shr(L_sum2, sum1_shift));                   /* Q8 */
		temp1 = shr(temp1, 7);                                          /* Q8 */
		temp1 = divide_s(temp1, temp2);                                /* Q15 */

		/* The computation for classStat->peakiness is not accurate when the  */
		/* signal in the current frame is small.                              */

		classStat->peakiness = mult(SQRT_PIT_SUBFRAME_Q11, temp1);     /* Q11 */
	}

	/* ------ Compute band energy ------ */
	/* bandEn(autocorr, 0) is lowBandEn and bandEn(autocorr, 1) is highBandEn */
	lowhighBandDiff = sub(bandEn(autocorr, 0), bandEn(autocorr, 1));   /* Q12 */

	frac_cor(&(sigbuf_out[BPF_ORD/3]), classStat->pitch, &lowBandCorx);

	if (silenceEn > sub(voicedEn, X15_Q11))
		silenceEn = sub(voicedEn, X15_Q11);
                                           /* the noise level is way too high */
	zeroCrosRateDiff = sub(classStat->zeroCrosRate,
						   classStat[-1].zeroCrosRate);                /* Q15 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜一区二区| 久久久精品天堂| 欧美成人精品福利| 亚洲免费观看在线视频| 精彩视频一区二区三区| 色拍拍在线精品视频8848| 精品理论电影在线观看| 五月天激情小说综合| 99re在线视频这里只有精品| 精品国产污网站| 亚洲国产一区视频| 色综合欧美在线| 国产视频一区不卡| 久久99精品久久久久久动态图 | 亚洲最大的成人av| 国产毛片精品视频| 日韩一级精品视频在线观看| 一区二区免费在线播放| 欧美日韩国产123区| 国产精品婷婷午夜在线观看| 看电影不卡的网站| 91麻豆精品国产91久久久久| 亚洲午夜精品网| 一本到一区二区三区| 一色桃子久久精品亚洲| 国产a区久久久| 久久久精品综合| 狠狠色狠狠色综合系列| 久久一夜天堂av一区二区三区| 石原莉奈一区二区三区在线观看| 欧美色精品在线视频| 亚洲一区二区欧美日韩| 91豆麻精品91久久久久久| 亚洲色图在线播放| 色哟哟在线观看一区二区三区| 中文字幕在线免费不卡| 成人午夜视频网站| 国产精品传媒入口麻豆| 99国产精品一区| 一区二区三区在线不卡| 欧美日韩高清影院| 另类成人小视频在线| 精品免费日韩av| 国产一本一道久久香蕉| 欧美国产欧美综合| 91蜜桃网址入口| 亚洲五码中文字幕| 日韩一级精品视频在线观看| 国产麻豆一精品一av一免费 | 日韩精品一区二区三区在线观看| 日韩av电影免费观看高清完整版 | 日韩欧美国产高清| 国产精品一区二区久久精品爱涩| 欧美高清在线精品一区| 91在线国内视频| 婷婷综合在线观看| 久久久久久久久蜜桃| 成人h动漫精品一区二| 亚洲午夜久久久久| 2023国产精品| 色爱区综合激月婷婷| 日本aⅴ免费视频一区二区三区| 久久久亚洲欧洲日产国码αv| 成人av网在线| 日韩电影免费在线看| 亚洲国产精品黑人久久久 | 国产不卡高清在线观看视频| 中文字幕一区二区不卡| 欧美日韩欧美一区二区| 国产真实乱子伦精品视频| 亚洲欧美色图小说| 日韩欧美国产综合在线一区二区三区| 国产美女精品人人做人人爽| 亚洲成人av电影| 久久日韩粉嫩一区二区三区| 色乱码一区二区三区88| 国产一区二区三区日韩| 亚洲国产毛片aaaaa无费看| 久久久久高清精品| 欧美日韩黄视频| 粉嫩13p一区二区三区| 天堂va蜜桃一区二区三区漫画版| 国产欧美1区2区3区| 欧美精品 日韩| 91网上在线视频| 国产精品自在欧美一区| 偷窥国产亚洲免费视频| 久久99久久久久久久久久久| 综合久久国产九一剧情麻豆| 欧美v亚洲v综合ⅴ国产v| 在线精品视频一区二区| 国产91丝袜在线18| 精品一区免费av| 丝袜国产日韩另类美女| 一区二区三区产品免费精品久久75| 久久综合精品国产一区二区三区| 欧美久久久久久久久中文字幕| 99久久99久久久精品齐齐| 国产高清无密码一区二区三区| 蜜臀精品久久久久久蜜臀 | 欧美最猛性xxxxx直播| 不卡的av电影| 国产福利一区在线观看| 久久66热偷产精品| 免费成人av资源网| 日韩成人av影视| 天堂蜜桃91精品| 日韩在线一二三区| 肉色丝袜一区二区| 天堂久久久久va久久久久| 午夜欧美一区二区三区在线播放| 亚洲图片欧美色图| 亚洲一区欧美一区| 亚洲一区二区三区小说| 亚洲资源在线观看| 亚洲电影你懂得| 五月综合激情婷婷六月色窝| 天天色综合天天| 美女在线视频一区| 国产九色sp调教91| 国产91丝袜在线18| 97国产一区二区| 欧美在线观看你懂的| 欧美综合在线视频| 欧美一区二区三级| 精品成人私密视频| 国产午夜精品理论片a级大结局| 国产日韩欧美精品电影三级在线| 中文字幕+乱码+中文字幕一区| 欧美极品美女视频| 亚洲色图在线播放| 天天做天天摸天天爽国产一区| 久久国产婷婷国产香蕉| 国产精品456| 91蜜桃免费观看视频| 欧美日韩一区二区电影| 日韩欧美不卡一区| 国产欧美一区二区精品久导航 | 中文字幕在线观看一区| 亚洲色欲色欲www在线观看| 洋洋成人永久网站入口| 蜜臀国产一区二区三区在线播放 | 欧美精品在线一区二区三区| 日韩欧美黄色影院| 中文字幕高清一区| 亚洲国产色一区| 国产剧情一区二区三区| 色婷婷久久一区二区三区麻豆| 欧美肥大bbwbbw高潮| 国产三区在线成人av| 亚洲午夜免费视频| 国产风韵犹存在线视精品| 日本久久电影网| 精品国产精品网麻豆系列| 首页国产丝袜综合| 高清不卡在线观看av| 欧美色综合影院| 国产女同性恋一区二区| 亚洲影视资源网| 国产成人av网站| 制服丝袜中文字幕一区| 中文字幕在线不卡一区二区三区 | 日韩一区二区精品在线观看| 国产欧美一区二区精品性| 日韩激情视频在线观看| 成人av电影在线网| 欧美成人欧美edvon| 亚洲精品一二三区| 国产激情一区二区三区| 欧美日韩电影一区| 国产精品青草综合久久久久99| 日本亚洲视频在线| 91片黄在线观看| 国产欧美一区二区三区沐欲| 日本成人在线视频网站| 日本久久精品电影| 国产精品美女久久久久久久网站| 毛片av一区二区| 欧美日本韩国一区| 一区二区三区精品久久久| 国产精品综合久久| 26uuu国产日韩综合| 蜜臀国产一区二区三区在线播放| 欧美三级电影在线观看| 亚洲欧美一区二区久久| 不卡欧美aaaaa| 久久久电影一区二区三区| 蜜臀a∨国产成人精品| 欧美日韩aaaaa| 性做久久久久久| 91黄色小视频| 亚洲夂夂婷婷色拍ww47| 91丨porny丨首页| 国产精品久久久久一区| 国产福利精品一区二区| 国产欧美精品一区二区色综合朱莉| 国产一区二区在线免费观看| 精品va天堂亚洲国产| 九九视频精品免费| 久久久久99精品国产片|