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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lpc_lib.c

?? MELPe 1200 bps, fixed point
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* ================================================================== */
/*                                                                    */ 
/*    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.                                            */
/*                                                                    */ 
/* ================================================================== */

/*

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.

*/

/* =========================== */
/* lpc_lib.c: LPC subroutines. */
/* =========================== */

/*	compiler include files	*/

#include <stdio.h>

#include "sc1200.h"
#include "macro.h"
#include "mathhalf.h"
#include "mathdp31.h"
#include "math_lib.h"
#include "mat_lib.h"
#include "lpc_lib.h"
#include "constant.h"
#include "global.h"
#include "dsp_sub.h"


#define ALMOST_ONE_Q14		16382                            /* ((1 << 14)-2) */
#define ONE_Q25				33554431L                            /* (1 << 25) */
#define ONE_Q26				67108864L                            /* (1 << 26) */
#define LOW_LIMIT			54  /* lower limit of return value for lpc_aejw() */
                                 /* to prevent overflow of weighting function */
#define MAX_LOOPS			10
#define DFTLENGTH			512
#define DFTLENGTH_D2		(DFTLENGTH/2)
#define DFTLENGTH_D4		(DFTLENGTH/4)

/* Prototype */

static void		lsp_to_freq(Shortword lsp[], Shortword freq[], Shortword order);
static Shortword	lpc_refl2pred(Shortword refc[], Shortword lpc[],
								  Shortword order);


/* LPC_ACOR                                                                   */
/*		Compute autocorrelations based on windowed speech frame               */
/*                                                                            */
/*	Synopsis: lpc_acor(input, window, r, hf_correction, order, npts)          */
/*		Input:                                                                */
/*			input- input vector (npts samples, s[0..npts-1])                  */
/*			win_cof- window vector (npts samples, s[0..npts-1])               */
/*			hf_correction- high frequency correction value                    */
/*			order- order of lpc filter                                        */
/*			npts- number of elements in window                                */
/*		Output:                                                               */
/*			autocorr- output autocorrelation vector (order + 1 samples,       */
/*                    autocorr[0..order])                                     */
/*                                                                            */
/*	Q values: input - Q0, win_cof - Q15, hf_correction - Q15                  */

void lpc_acor(Shortword input[], const Shortword win_cof[],
			  Shortword autocorr[], Shortword hf_correction, Shortword order,
			  Shortword npts)
{
	/* Lag window coefficients */
	static const Shortword		lagw_cof[EN_FILTER_ORDER - 1] = {
		32756, 32721, 32663, 32582, 32478, 32351, 32201, 32030, 31837, 31622,
		31387, 31131, 30855, 30560, 30246, 29914
	};
	register Shortword	i, j;
	Longword	L_temp;
	Shortword	*inputw;
	Shortword	norm_var, scale_fact, temp;


	/* window optimized for speed and readability.  does windowing and        */
	/* autocorrelation sequentially and in the usual manner                   */

	inputw = v_get(npts);
	for (i = 0; i < npts; i++){
		inputw[i] = mult(win_cof[i], shr(input[i], 4));
	}

	/* Find scaling factor */
	L_temp = L_v_magsq(inputw, npts, 0, 1);
	if (L_temp){
		norm_var = norm_l(L_temp);
		norm_var = sub(4, shr(norm_var, 1));
		if (norm_var < 0)
			norm_var = 0;
	} else
		norm_var = 0;

	for (i = 0; i < npts; i++){
		inputw[i] = shr(mult(win_cof[i], input[i]), norm_var);
	}

	/* Compute r[0] */
	L_temp = L_v_magsq(inputw, npts, 0, 1);
	if (L_temp > 0){
		/* normalize with 1 bit of headroom */
		norm_var = norm_l(L_temp);
		norm_var = sub(norm_var, 1);
		L_temp = L_shl(L_temp, norm_var);

		/* High frequency correction */
		L_temp = L_add(L_temp, L_mpy_ls(L_temp, hf_correction));

		/* normalize result */
		temp = norm_s(extract_h(L_temp));
		L_temp = L_shl(L_temp, temp);
		norm_var = add(norm_var, temp);
		autocorr[0] = round(L_temp);

		/* Multiply by 1/autocorr[0] for full normalization */
		scale_fact = divide_s(ALMOST_ONE_Q14, autocorr[0]);
		L_temp = L_shl(L_mpy_ls(L_temp, scale_fact), 1);
		autocorr[0] = round(L_temp);

	} else {
		norm_var = 0;
		autocorr[0] = ONE_Q15;                                    /* 1 in Q15 */
		scale_fact = 0;
	}

	/* Compute remaining autocorrelation terms */
	for (j = 1; j <= order; j++){
		L_temp = 0;
		for (i = j; i < npts; i++)
			L_temp = L_mac(L_temp, inputw[i], inputw[i - j]);
		L_temp = L_shl(L_temp, norm_var);

		/* Scaling */
		L_temp = L_shl(L_mpy_ls(L_temp, scale_fact), 1);

		/* Lag windowing */
		L_temp = L_mpy_ls(L_temp, lagw_cof[j - 1]);

		autocorr[j] = round(L_temp);
	}
	v_free(inputw);
}


/* Name: lpc_aejw- Compute square of A(z) evaluated at exp(jw)                */
/* Description:                                                               */
/*		Compute the magnitude squared of the z-transform of                   */
/*                                                                            */
/*		A(z) = 1 + a(1)z^-1 + ... + a(p)z^-p                                  */
/*                                                                            */
/*		evaluated at z = exp(jw)                                              */
/*	 Inputs:                                                                  */
/*		lpc (a)- LPC filter (a[0] is undefined, a[1..p])                      */
/*		omega (w)- radian frequency                                           */
/*		order (p)- predictor order                                            */
/*	 Returns:                                                                 */
/* 		|A(exp(jw))|^2                                                        */
/*	 See_Also: cos(3), sin(3)                                                 */
/*	 Includes:                                                                */
/*		lpc.h                                                                 */
/*	 Systems and Info. Science Lab                                            */
/*	 Copyright (c) 1995 by Texas Instruments, Inc.	All rights reserved.      */
/*                                                                            */
/* Q values:                                                                  */
/*      lpc - Q12, omega - Q15, return - Q19                                  */

Longword lpc_aejw(Shortword lpc[], Shortword omega, Shortword order)
{
	register Shortword	i;
	Shortword	c_re, c_im;
	Shortword	cs, sn, temp;
	Shortword	temp1, temp2;
	Longword	L_temp;


	if (order == 0)
		return((Longword) ONE_Q19);

	/* use horners method                                                     */
	/* A(exp(jw)) = 1+ e(-jw)[a(1) + e(-jw)[a(2) + e(-jw)[a(3) +..            */
	/*				...[a(p-1) + e(-jw)a(p)]]]]                               */

	cs = cos_fxp(omega);                                          /* Q15 */
	sn = negate(sin_fxp(omega));                               /* Q15 */

	temp1 = lpc[order - 1];
	c_re = shr(mult(cs, temp1), 3);                            /* -> Q9 */
	c_im = shr(mult(sn, temp1), 3);                            /* -> Q9 */

	for (i = sub(order, 2); i >= 0; i--){
		/* add a[i] */
		temp = shr(lpc[i], 3);
		c_re = add(c_re, temp);

		/* multiply by exp(-jw) */
		temp = c_im;
		temp1 = mult(cs, temp);                                /* temp1 in Q9 */
		temp2 = mult(sn, c_re);                               /* temp2 in Q9 */
		c_im = add(temp1, temp2);
		temp1 = mult(cs, c_re);                            /* temp1 in Q9 */
		temp2 = mult(sn, temp);                           /* temp2 in Q9 */
		c_re = sub(temp1, temp2);
	}

	/* add one */
	c_re = add(c_re, ONE_Q9);

	/* L_temp in Q19 */
	L_temp = L_add(L_mult(c_re, c_re), L_mult(c_im, c_im));
	if (L_temp < LOW_LIMIT)
		L_temp = (Longword) LOW_LIMIT;

	return(L_temp);
}


/* Name: lpc_bwex- Move the zeros of A(z) toward the origin.                  */
/*	Aliases: lpc_bw_expand                                                    */
/*	Description:                                                              */
/*		Expand the zeros of the LPC filter by gamma, which                    */
/*		moves each zero radially into the origin.                             */
/*                                                                            */
/*		for j = 1 to p                                                        */
/*			aw[j] = a[j]*gamma^j                                              */
/*		(Can also be used to perform an exponential windowing procedure).     */
/*	Inputs:                                                                   */
/*		lpc (a)- lpc vector (order p, a[1..p])                                */
/*		gamma- the bandwidth expansion factor                                 */
/*		order (p)- order of lpc filter                                        */
/*	Outputs:                                                                  */
/*		aw- the bandwidth expanded LPC filter                                 */
/*	Returns: NULL                                                             */
/*	See_Also: lpc_lagw(3l)                                                    */
/*	Includes:                                                                 */
/*		lpc.h                                                                 */
/*                                                                            */
/*	Systems and Info. Science Lab                                             */
/*	Copyright (c) 1995 by Texas Instruments, Inc.  All rights reserved.       */
/*                                                                            */
/*	Q values: lpc[], aw[] - Q12, gamma - Q15, gk - Q15                        */

Shortword lpc_bwex(Shortword lpc[], Shortword aw[], Shortword gamma,
				   Shortword order)
{
	register Shortword	i;
	Shortword	gk;                                              /* gk is Q15 */

	gk = gamma;

	for (i = 0; i < order; i++){
		aw[i] = mult(lpc[i], gk);
		gk = mult(gk, gamma);
	}
	return(0);
}


/* Name: lpc_clmp- Sort and ensure minimum separation in LSPs.                */
/*	Aliases: lpc_clamp                                                        */
/*	Description:                                                              */
/*		Ensure that all LSPs are ordered and separated                        */
/*		by at least delta.	The algorithm isn't guarenteed                    */
/*		to work, so it prints an error message when it fails                  */
/*		to sort the LSPs properly.                                            */
/*	Inputs:                                                                   */
/*		lsp (w)- lsp vector (order p, w[1..p])                                */
/*		delta- the clamping factor                                            */
/*		order (p)- order of lpc filter                                        */
/*	Outputs:                                                                  */
/*		lsp (w)- the sorted and clamped lsps                                  */
/*	Returns: NULL                                                             */
/*	See_Also:                                                                 */
/*	Includes:                                                                 */
/*		lpc.h                                                                 */
/*	Bugs:                                                                     */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
自拍偷拍欧美精品| 精品乱人伦小说| 亚洲综合在线观看视频| 在线综合亚洲欧美在线视频| 日韩一区二区三区在线| 亚洲黄色免费电影| 国产成人福利片| 欧美日本在线视频| 中文字幕在线免费不卡| 美女视频一区二区| 91香蕉视频污| 日韩欧美视频在线 | 精品国产一区二区精华| 中文字幕亚洲欧美在线不卡| 蜜桃精品在线观看| 色综合久久天天| 久久婷婷国产综合国色天香| 亚洲电影在线免费观看| 国产在线视视频有精品| 91免费国产在线| 精品国产91洋老外米糕| 亚洲色欲色欲www| 欧美aaa在线| 国产精品夜夜嗨| 精品国一区二区三区| 国产精品传媒入口麻豆| 日本 国产 欧美色综合| 99在线精品视频| 精品对白一区国产伦| 亚洲韩国精品一区| 国产激情一区二区三区| 欧美精品在线一区二区三区| 国产精品福利一区二区| 国产一区二区三区在线观看免费视频 | 欧美日韩三级视频| 亚洲蜜臀av乱码久久精品蜜桃| 国产成人亚洲精品青草天美| 欧美精品第1页| 亚洲一区二区三区中文字幕| 成人av网站免费| 久久午夜国产精品| 久久99久久99小草精品免视看| 欧美日韩在线亚洲一区蜜芽| 成人欧美一区二区三区| 成人网页在线观看| 国产欧美日韩久久| 国产成人免费网站| 欧美高清在线一区二区| 国产盗摄女厕一区二区三区| 精品国精品国产| 亚洲高清视频的网址| 91久久精品国产91性色tv| 最新高清无码专区| 99精品偷自拍| 亚洲一区二区在线免费看| 91在线观看地址| 一个色在线综合| 欧美午夜精品理论片a级按摩| 亚洲欧美一区二区久久| 色综合中文字幕| 亚洲在线免费播放| 欧美军同video69gay| 日韩**一区毛片| 日韩小视频在线观看专区| 美女视频免费一区| 91女神在线视频| 99久久夜色精品国产网站| 日韩女同互慰一区二区| 日本午夜一区二区| 日韩一区二区三区四区五区六区| 国产一区在线观看麻豆| 中文一区在线播放 | 精品国产精品一区二区夜夜嗨| 免费看欧美女人艹b| 久久夜色精品国产噜噜av| 成人黄色综合网站| 亚洲国产成人porn| 欧美精品一二三| 国产福利一区二区三区在线视频| 中文字幕一区免费在线观看 | 欧美大肚乱孕交hd孕妇| 国产精品一区二区视频| 亚洲欧美国产毛片在线| 6080亚洲精品一区二区| 成人综合婷婷国产精品久久蜜臀 | 中文欧美字幕免费| 成人激情小说乱人伦| 一区二区三区在线观看视频| 欧美电影在线免费观看| 另类欧美日韩国产在线| 欧美成人精品福利| 97精品电影院| 美女在线观看视频一区二区| 中文字幕乱码日本亚洲一区二区 | 亚洲综合成人在线| 欧美精品一区二区精品网| 色综合久久天天综合网| 国产一区二区主播在线| 一区二区高清视频在线观看| 26uuu亚洲综合色| 久久亚洲精华国产精华液| 麻豆国产精品一区二区三区 | 国内成+人亚洲+欧美+综合在线| 久久精品夜色噜噜亚洲a∨| 国产成人综合自拍| 亚洲欧美激情在线| 91精品国产一区二区三区| 懂色av一区二区在线播放| 亚洲v精品v日韩v欧美v专区| 国产精品色呦呦| 精品伦理精品一区| 欧美高清性hdvideosex| 91视频xxxx| 国产suv精品一区二区6| 欧美电影免费观看高清完整版在线观看| 95精品视频在线| 高清成人免费视频| 精彩视频一区二区| 国产一区二区三区久久久 | 国产欧美久久久精品影院| 欧美一区二区三区公司| 欧美自拍偷拍一区| 91亚洲精华国产精华精华液| 国产成人亚洲综合a∨猫咪| 精品一区二区在线视频| 日本午夜精品视频在线观看| 亚洲一区二区三区视频在线播放| 中文字幕在线不卡| 国产精品色一区二区三区| 国产欧美日韩不卡免费| 久久精品一区二区三区四区| 337p日本欧洲亚洲大胆精品| 日韩女优制服丝袜电影| 日韩欧美三级在线| 日韩精品专区在线影院重磅| 制服丝袜日韩国产| 欧美精三区欧美精三区| 6080亚洲精品一区二区| 欧美一区二区观看视频| 欧美大片免费久久精品三p| 日韩三级在线观看| 精品国产伦一区二区三区观看方式| 日韩一级免费观看| 精品久久久久久久久久久久包黑料| 欧美mv日韩mv| 欧美一区二区三区啪啪| 欧美最猛黑人xxxxx猛交| 色噜噜狠狠成人中文综合| 一本到不卡免费一区二区| 成人国产在线观看| 91捆绑美女网站| 成人精品鲁一区一区二区| 国产成人免费在线观看不卡| 国产成人亚洲综合a∨猫咪| 欧美大黄免费观看| 国产成人精品免费网站| 国产精品一区二区三区乱码| 国产一区激情在线| 99re视频精品| 在线成人小视频| 国产欧美中文在线| 亚洲伦理在线精品| 日本一区中文字幕| 在线观看日韩毛片| 91精品欧美一区二区三区综合在| 久久综合狠狠综合久久激情| 中文字幕+乱码+中文字幕一区| 一区二区三区国产精品| 日本女优在线视频一区二区| 国产精品123| 欧美怡红院视频| 久久久九九九九| 亚洲一区二区综合| 黑人巨大精品欧美一区| av电影一区二区| 欧美一区二区三区在线看 | 成人黄色在线视频| 欧美绝品在线观看成人午夜影视 | 欧美电影在哪看比较好| 国产女人18水真多18精品一级做| 亚洲成a人片在线不卡一二三区| 韩国v欧美v日本v亚洲v| 91女人视频在线观看| 日韩欧美自拍偷拍| 一区二区三区欧美激情| 国产成人在线观看免费网站| 欧美日韩高清一区二区三区| 日本一二三不卡| 美日韩黄色大片| 欧美三日本三级三级在线播放| 日本一区免费视频| 青草av.久久免费一区| 91亚洲国产成人精品一区二三| 精品少妇一区二区三区在线视频| 亚洲精品国久久99热| 国产成人亚洲综合色影视| 欧美中文字幕一二三区视频| 久久欧美一区二区| 日韩视频在线你懂得| 亚洲午夜久久久久久久久电影院|