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

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

?? pit_lib.c

?? MELPe 1200 bps, fixed point
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*

2.4 kbps MELP Proposed Federal Standard speech coder

Fixed-point C code, version 1.0

Copyright (c) 1998, Texas Instruments, Inc.

Texas Instruments has intellectual property rights on the MELP
algorithm.	The Texas Instruments contact for licensing issues for
commercial and non-government use is William Gordon, Director,
Government Contracts, Texas Instruments Incorporated, Semiconductor
Group (phone 972 480 7442).

The fixed-point version of the voice codec Mixed Excitation Linear
Prediction (MELP) is based on specifications on the C-language software
simulation contained in GSM 06.06 which is protected by copyright and
is the property of the European Telecommunications Standards Institute
(ETSI). This standard is available from the ETSI publication office
tel. +33 (0)4 92 94 42 58. ETSI has granted a license to United States
Department of Defense to use the C-language software simulation contained
in GSM 06.06 for the purposes of the development of a fixed-point
version of the voice codec Mixed Excitation Linear Prediction (MELP).
Requests for authorization to make other use of the GSM 06.06 or
otherwise distribute or modify them need to be addressed to the ETSI
Secretariat fax: +33 493 65 47 16.

*/

/* ===================================== */
/* pit_lib.c: pitch analysis subroutines */
/* ===================================== */

#include "sc1200.h"
#include "mathhalf.h"
#include "mathdp31.h"
#include "mat_lib.h"
#include "math_lib.h"
#include "dsp_sub.h"
#include "pit_lib.h"
#include "constant.h"
#include "global.h"
#include "coeff.h"

#define PDECAY_Q15			31129                         /* 0.95 * (1 << 15) */
#define PDECAY_PITCH_Q7 	320            /* (0.05*DEFAULT_PITCH) * (1 << 7) */
#define NUM_MULT			8
#define SHORT_PITCH			3840                             /* 30 * (1 << 7) */
#define MAXFRAC				16384                          /* 2.0 * (1 << 13) */
#define MINFRAC				-8192                         /* -1.0 * (1 << 13) */
#define X05_Q13				4096                           /* 0.5 * (1 << 13) */

/* Added 1 to variables which appear in comparison statements to make it      */
/* bit-exact as tested version                                                */
#define UVMAX				(9011 + 1)                    /* 0.55 * (1 << 14) */
#define PCORR_THR			(9830 + 1)                     /* 0.6 * (1 << 14) */
#define PDOUBLE1			96                             /* 0.75 * (1 << 7) */
#define PDOUBLE2			64                              /* 0.5 * (1 << 7) */
#define PDOUBLE3			115                             /* 0.9 * (1 << 7) */
#define PDOUBLE4			89                              /* 0.7 * (1 << 7) */
#define LONG_PITCH			12800                        /* 100.0 * (1 << 7)) */
#define LPF_ORD_SOS			2

/* Prototypes */

static Shortword	double_chk(Shortword sig_in[], Shortword *pcorr,
							   Shortword pitch, Shortword pdouble,
							   Shortword pmin, Shortword pmax,
							   Shortword pmin_q7, Shortword pmax_q7,
							   Shortword lmin);

static void		double_ver(Shortword sig_in[], Shortword *pcorr,
						   Shortword pitch, Shortword pmin, Shortword pmax,
						   Shortword pmin_q7, Shortword pmax_q7,
						   Shortword lmin);


/*	double_chk.c: check for pitch doubling and also verify pitch multiple for */
/*                short pitches.                                              */
/*                                                                            */
/* Q values                                                                   */
/*     sig_in - Q0, pcorr - Q14, pitch - Q7, pdouble - Q7                     */

static Shortword	double_chk(Shortword sig_in[], Shortword *pcorr,
							   Shortword pitch, Shortword pdouble,
							   Shortword pmin, Shortword pmax,
							   Shortword pmin_q7, Shortword pmax_q7,
							   Shortword lmin)
{
	Shortword	mult, corr, thresh, temp_pit;
	Shortword	temp1, temp2;
	Longword	L_temp;


	pitch = frac_pch(sig_in, pcorr, pitch, 0, pmin, pmax, pmin_q7, pmax_q7,
					 lmin);

	/* compute threshold Q14*Q7>>8 */
	/* extra right shift to compensate left shift of L_mult */
	L_temp = L_mult(*pcorr, pdouble);
	L_temp = L_shr(L_temp, 8);
	thresh = extract_l(L_temp);                                        /* Q14 */

	/* Check pitch submultiples from shortest to longest */
	for (mult = NUM_MULT; mult >= 2; mult--){

		/* temp_pit = pitch / mult */
		temp1 = 0;
		temp2 = shl(mult, 11);                                         /* Q11 */
		temp_pit = pitch;
		while (temp_pit > temp2){
			temp_pit = shr(temp_pit, 1);
			temp1 = add(temp1, 1);
		}
		/* Q7*Q15/Q11 -> Q11 */
		temp2 = divide_s(temp_pit, temp2);
		temp1 = sub(4, temp1);
		/* temp_pit=pitch/mult in Q7 */
		temp_pit = shr(temp2, temp1);

		if (temp_pit >= pmin_q7){
			temp_pit = frac_pch(sig_in, &corr, temp_pit, 0, pmin, pmax,
								pmin_q7, pmax_q7, lmin);
			double_ver(sig_in, &corr, temp_pit, pmin, pmax, pmin_q7,
					   pmax_q7, lmin);

			/* stop if submultiple greater than threshold */
			if (corr > thresh){
				/* refine estimate one more time since previous window */
				/* may be off center slightly and temp_pit has moved */
				pitch = frac_pch(sig_in, pcorr, temp_pit, 0, pmin, pmax,
								 pmin_q7, pmax_q7, lmin);
				break;
			}
		}
	}

	/* Verify pitch multiples for short pitches */
	double_ver(sig_in, pcorr, pitch, pmin, pmax, pmin_q7, pmax_q7, lmin);

	/* Return full floating point pitch value and correlation*/
	return(pitch);
}


/* double_ver.c: verify pitch multiple for short pitches.                     */
/*                                                                            */
/* Q values                                                                   */
/*      pitch - Q7, pcorr - Q14                                               */

static void		double_ver(Shortword sig_in[], Shortword *pcorr,
						   Shortword pitch, Shortword pmin, Shortword pmax,
						   Shortword pmin_q7, Shortword pmax_q7,
						   Shortword lmin)
{
	Shortword	multiple;
	Shortword	corr, temp_pit;


	/* Verify pitch multiples for short pitches */
	multiple = 1;
	while (extract_l(L_shr(L_mult(pitch, multiple), 1)) < SHORT_PITCH){
		multiple = add(multiple, 1);
	}

	if (multiple > 1){
		temp_pit = extract_l(L_shr(L_mult(pitch, multiple), 1));
		temp_pit = frac_pch(sig_in, &corr, temp_pit, 0, pmin, pmax,
							pmin_q7, pmax_q7, lmin);

		/* use smaller of two correlation values */
		if (corr < *pcorr){
			*pcorr = corr;
		}
	}
}


/* f_pitch_scale.c: Scale pitch signal buffer for best precision              */

Shortword f_pitch_scale(Shortword sig_out[], Shortword sig_in[],
						Shortword length)
{
	register Shortword i;
	Shortword	scale;
	Shortword	*temp_buf;
	Longword	corr;
	Longword	L_temp, L_sum, L_margin;

	/* Compute signal buffer scale factor */
	scale = 0;

	/*	corr = L_v_magsq(sig_in, length, 0, 1); */
	L_sum = 0;
	L_margin = LW_MAX;
	temp_buf = sig_in;
	for (i = 0; i < length; i++){
		L_temp = L_mult(*temp_buf, *temp_buf);
		if (L_temp <= L_margin){
			L_sum = L_add(L_sum, L_temp);
			L_margin = L_sub(L_margin, L_temp);
		} else {
			L_margin = LW_MIN;
			break;
		}
		temp_buf ++;
	}
	corr = L_sum;

	if (L_margin == LW_MIN){

		/* allocate scratch buffer */
		temp_buf = v_get(length);

		/* saturation: right shift input signal and try again */
		scale = 5;
		v_equ_shr(temp_buf, sig_in, scale, length);
		corr = L_v_magsq(temp_buf, length, 0, 1);

		/* could add delta to compensate possible truncation error */

		/* free scratch buffer */
		v_free(temp_buf);
	}

	scale = sub(scale, shr(norm_l(corr), 1));

	/* Scale signal buffer */
	v_equ_shr(sig_out, sig_in, scale, length);

	/* return scale factor */
	return(scale);
}


/* find_pitch.c: Determine pitch value.                                       */
/*                                                                            */
/* Q values:                                                                  */
/*      sig_in - Q0, ipitch - Q0, *pcorr - Q14                                */
/*                                                                            */
/* WARNING: this function assumes the input buffer has been normalized by     */
/*          f_pitch_scale().                                                  */

Shortword find_pitch(Shortword sig_in[], Shortword *pcorr, Shortword lower,
					 Shortword upper, Shortword length)
{
	register Shortword	i;
	Shortword	cbegin, ipitch, even_flag;
	Shortword	s_corr, shift1a, shift1b, shift2, shift;
	Longword	c0_0, cT_T, corr;
	Longword	denom, max_denom, num, max_num;


	/* Find beginning of correlation window centered on signal */
	ipitch = lower;
	max_num = 0;
	max_denom = 1;
	even_flag = 1;
	/* cbegin = -((length+upper)/2) */
	cbegin = negate(shr(add(length, upper), 1));

	c0_0 = L_v_magsq(&sig_in[cbegin], length, 0, 1);
	cT_T = L_v_magsq(&sig_in[cbegin + upper], length, 0, 1);

	for (i = upper; i >= lower; i--){

		/* calculate normalized crosscorrelation */
		corr = L_v_inner(&sig_in[cbegin], &sig_in[cbegin + i], length, 0, 0, 1);

		/* calculate normalization for numerator and denominator */
		shift1a = norm_s(extract_h(c0_0));
		shift1b = norm_s(extract_h(cT_T));
		shift = add(shift1a, shift1b);
		shift2 = shr(shift, 1);               /* shift2 = half of total shift */
		if (shl(shift2, 1) != shift)
			shift1a = sub(shift1a, 1);

		/* check if current maximum value */
		if (corr > 0){
			s_corr = extract_h(L_shl(corr, shift2));
			num = extract_h(L_mult(s_corr, s_corr));
		} else
			num = 0;
		denom = extract_h(L_mult(extract_h(L_shl(c0_0, shift1a)),
								 extract_h(L_shl(cT_T, shift1b))));
		if (denom < 1)
			denom = 1;

		if (L_mult(extract_l(num), extract_l(max_denom)) >
			L_mult(extract_l(max_num), extract_l(denom))){
			max_denom = denom;
			max_num = num;
			ipitch = i;
		}

		/* update for next iteration */
		if (even_flag){
			even_flag = 0;
			c0_0 = L_msu(c0_0, sig_in[cbegin], sig_in[cbegin]);
			c0_0 = L_mac(c0_0, sig_in[cbegin + length],
						 sig_in[cbegin + length]);
			cbegin = add(cbegin, 1);
		} else {
			even_flag = 1;
			cT_T = L_msu(cT_T, sig_in[cbegin + i - 1 + length],
						 sig_in[cbegin + i - 1 + length]);
			cT_T = L_mac(cT_T, sig_in[cbegin + i - 1], sig_in[cbegin + i - 1]);
		}

	}

	/* Return pitch value and correlation*/
	*pcorr = shr(sqrt_fxp(divide_s(extract_l(max_num), extract_l(max_denom)),
								   15), 1);

	return(ipitch);
}


/* Name: frac_pch.c                                                           */
/* Description: Determine fractional pitch.                                   */
/* Inputs:                                                                    */
/*    sig_in - input signal                                                   */
/*    fpitch - initial floating point pitch estimate                          */
/*    range - range for local integer pitch search (0=none)                   */
/*    pmin - minimum allowed pitch value                                      */
/*    pmax - maximum allowed pitch value                                      */
/*    lmin - minimum correlation length                                       */
/* Outputs:                                                                   */
/*    pcorr - correlation at fractional pitch value                           */
/* Returns: fpitch - fractional pitch value                                   */
/*                                                                            */
/* Copyright (c) 1995 by Texas Instruments, Inc.  All rights reserved.        */
/*                                                                            */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品亚洲国内自在自线福利| 亚洲自拍偷拍欧美| 91精品国产91久久久久久最新毛片| 成人午夜看片网址| 99久久99久久久精品齐齐| 丁香婷婷综合激情五月色| 成人性视频免费网站| 成人激情图片网| 91丨九色丨蝌蚪富婆spa| 色激情天天射综合网| 在线免费不卡视频| 欧美精品一二三| 日韩欧美一级二级三级久久久| 日韩一区二区三区视频在线| 欧美不卡一区二区三区| 欧美高清在线视频| 亚洲欧美日韩国产一区二区三区| 一区二区三区在线观看网站| 亚洲成人综合在线| 久久国产精品72免费观看| 国产精品一线二线三线精华| a亚洲天堂av| 欧美性色欧美a在线播放| 在线不卡欧美精品一区二区三区| 日韩亚洲欧美综合| 国产欧美一区视频| 一区二区三区在线免费视频| 久久精品国产成人一区二区三区| 国产激情视频一区二区在线观看 | 欧美日韩mp4| 精品人在线二区三区| 成人欧美一区二区三区视频网页| 一区二区三区中文字幕精品精品| 美脚の诱脚舐め脚责91| 成人综合在线视频| 欧美一区二区三区精品| 久久综合99re88久久爱| 亚洲日本乱码在线观看| 麻豆国产精品777777在线| 国产成人av电影在线观看| 欧美在线你懂的| 国产欧美日韩激情| 首页国产欧美日韩丝袜| 99久久久精品| 久久嫩草精品久久久精品一| 亚洲成人黄色影院| 成人午夜伦理影院| 精品国产三级电影在线观看| 亚洲一区免费在线观看| 粉嫩蜜臀av国产精品网站| 欧美日韩久久久一区| 亚洲丝袜自拍清纯另类| 国产一区视频导航| 91精品中文字幕一区二区三区| 亚洲毛片av在线| 国产成人高清在线| 日韩欧美三级在线| 亚洲www啪成人一区二区麻豆| 成人毛片在线观看| 久久久高清一区二区三区| 奇米影视在线99精品| 欧美三级资源在线| 亚洲一区二区美女| 91亚洲精品乱码久久久久久蜜桃| 国产欧美一区二区在线| 国内精品在线播放| 日韩欧美亚洲国产另类| 天堂一区二区在线| 欧美久久久久免费| 日韩精品1区2区3区| 欧美日韩在线电影| 日韩综合小视频| 欧美日韩美少妇| 亚洲6080在线| 欧美一区二区私人影院日本| 日韩精品五月天| 制服.丝袜.亚洲.中文.综合| 五月激情六月综合| 91精品国产一区二区三区香蕉| 日韩高清欧美激情| 91精品国产日韩91久久久久久| 五月婷婷久久丁香| 欧美一区二区三区日韩视频| 免费人成黄页网站在线一区二区 | 国产精品自拍一区| 国产精品国产三级国产普通话蜜臀| 处破女av一区二区| 亚洲欧美电影院| 欧美一a一片一级一片| 日日夜夜免费精品视频| 精品裸体舞一区二区三区| 国产精品一区专区| 亚洲欧美国产高清| 欧美视频日韩视频在线观看| 青青草97国产精品免费观看无弹窗版| 91精品国产免费久久综合| 久久www免费人成看片高清| 久久综合久久鬼色中文字| 国产宾馆实践打屁股91| 一区二区久久久| 日韩欧美一二区| 波多野结衣中文字幕一区| 夜夜亚洲天天久久| 国产清纯白嫩初高生在线观看91| 成人一道本在线| 亚洲777理论| 欧美韩日一区二区三区四区| 欧美亚洲综合在线| 国产精品影视在线观看| 亚洲国产一二三| 久久久久久久av麻豆果冻| 92精品国产成人观看免费| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产三级精品三级| 欧美日本精品一区二区三区| 国产精品一区二区三区乱码| 一区二区三区在线视频观看58| 久久亚洲一级片| 欧美日韩在线不卡| 99国产精品久久久久久久久久| 日韩精品一区第一页| 亚洲色图另类专区| 久久亚洲免费视频| 欧美日韩国产天堂| 99精品视频在线观看| 国产精品一级片在线观看| 亚洲成av人影院| 中文字幕一区二区三区精华液| 欧美大白屁股肥臀xxxxxx| 欧美亚日韩国产aⅴ精品中极品| 国产成人自拍高清视频在线免费播放| 亚洲成a人在线观看| 亚洲免费视频成人| 国产精品家庭影院| 欧美国产一区在线| 精品国产3级a| 日韩三级视频中文字幕| 884aa四虎影成人精品一区| 91蜜桃视频在线| 成人av网址在线观看| 高清不卡在线观看av| 成人av电影在线网| 国产一区二区免费看| 免费精品99久久国产综合精品| 亚洲国产一区视频| 亚洲国产日韩a在线播放性色| 亚洲老妇xxxxxx| 中文字幕在线不卡| 亚洲欧美一区二区三区极速播放| 中文字幕精品在线不卡| 国产色婷婷亚洲99精品小说| 精品久久久久久久久久久久久久久久久 | 欧美一区二区三区视频在线| 91精品欧美久久久久久动漫 | 欧美午夜一区二区三区| 在线观看一区二区视频| 日本精品视频一区二区| 色素色在线综合| 欧美日韩精品欧美日韩精品一| 欧美精品日韩精品| 日韩一区二区在线看| 欧美成人精品福利| 国产无遮挡一区二区三区毛片日本| 久久精品一区二区三区不卡 | 色先锋aa成人| 欧美中文字幕久久| 欧美乱妇15p| 欧美成人三级在线| 国产亚洲一二三区| 日韩一区中文字幕| 日韩成人免费电影| 国产经典欧美精品| 在线视频欧美精品| 日韩欧美视频一区| 欧美国产精品一区| 一区二区在线免费| 精品一区二区三区的国产在线播放| 国产一区二区调教| 色网站国产精品| 欧美一级欧美一级在线播放| 久久精品夜夜夜夜久久| 一区二区三区免费| 另类调教123区 | 亚洲日本电影在线| 日韩av一级片| 成人丝袜18视频在线观看| 欧美日本视频在线| 欧美国产日产图区| 午夜精品久久久久| 色综合天天综合网国产成人综合天| 在线精品视频免费播放| 精品国产一区二区国模嫣然| 日韩美女视频一区| 韩国欧美国产1区| 在线中文字幕一区二区| 久久久久久黄色| 日韩成人免费在线| 欧洲一区二区三区免费视频| 久久先锋影音av| 亚洲6080在线|