亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品久久久爽爽爽麻豆色哟哟| 国产成人免费9x9x人网站视频| 欧美精彩视频一区二区三区| 欧美一级一区二区| 欧美大片一区二区| 欧美一二三四区在线| 欧美一级片在线观看| 51午夜精品国产| 欧美一区二区成人6969| 精品国产乱码久久| 精品盗摄一区二区三区| 久久免费电影网| 中文字幕亚洲区| 一区二区三区四区蜜桃| 亚洲线精品一区二区三区八戒| 亚洲午夜私人影院| 久久疯狂做爰流白浆xx| 国产一区二区不卡老阿姨| 国产成人福利片| 色猫猫国产区一区二在线视频| 欧美无砖砖区免费| 日韩免费看网站| 国产精品入口麻豆九色| 亚洲精品日韩一| 日本伊人精品一区二区三区观看方式 | 精品蜜桃在线看| 欧美国产欧美综合| 午夜精品在线视频一区| 久久国产精品99久久久久久老狼| 成人午夜精品在线| 欧美做爰猛烈大尺度电影无法无天| 91麻豆精品国产无毒不卡在线观看 | 欧美一区在线视频| 亚洲国产高清在线观看视频| 一区二区三区在线播放| 国产精品一区一区三区| 在线亚洲一区观看| 欧美大片一区二区| 亚洲黄色小说网站| 狠狠色丁香九九婷婷综合五月| 91丝袜美女网| 精品久久久久一区| 亚洲国产日日夜夜| av午夜精品一区二区三区| 欧美一区二区三区在线电影| 中文字幕视频一区| 国产九色精品成人porny| 欧美在线视频不卡| 国产精品久久久久久久久晋中| 日韩成人dvd| 在线看日韩精品电影| 国产午夜精品一区二区三区嫩草| 亚洲成av人在线观看| 99精品视频在线观看| 久久久久久97三级| 看片网站欧美日韩| 欧美年轻男男videosbes| 亚洲四区在线观看| 东方aⅴ免费观看久久av| 欧美不卡一区二区三区| 日韩黄色小视频| 欧美日韩中文另类| 亚洲综合一区二区精品导航| voyeur盗摄精品| 中文无字幕一区二区三区| 精品夜夜嗨av一区二区三区| 欧美精品自拍偷拍| 亚洲国产你懂的| 欧美日本一区二区三区四区| 亚洲黄色尤物视频| 色av成人天堂桃色av| 中文字幕一区二区三区四区不卡| 高清shemale亚洲人妖| 2022国产精品视频| 国产精品亚洲成人| 欧美激情中文字幕一区二区| 国产一区二区免费视频| 精品国产免费人成在线观看| 狠狠色2019综合网| 精品国产乱子伦一区| 国产麻豆午夜三级精品| 2022国产精品视频| 成人免费毛片嘿嘿连载视频| 国产精品不卡一区二区三区| 99视频在线观看一区三区| 日韩毛片一二三区| 日本乱码高清不卡字幕| 视频在线在亚洲| 精品第一国产综合精品aⅴ| 国产成人午夜片在线观看高清观看| 欧美国产日韩a欧美在线观看| 成人av在线播放网站| 亚洲一区二区三区中文字幕| 在线成人小视频| 国产精品99久久久久久久女警| 国产精品久久一卡二卡| 在线亚洲欧美专区二区| 日韩中文字幕亚洲一区二区va在线| 日韩欧美一区中文| 成人免费看的视频| 亚洲gay无套男同| 精品国产露脸精彩对白| 91啪在线观看| 轻轻草成人在线| 国产精品久久久久婷婷| 欧美影院精品一区| 久久97超碰国产精品超碰| 国产亚洲美州欧州综合国| 成人黄色一级视频| 无吗不卡中文字幕| 国产精品乱码人人做人人爱 | 一区二区三区日本| 欧美日韩国产另类一区| 亚洲成av人片在线观看| 国产女人aaa级久久久级| 欧美日韩在线播放三区四区| 国产成人午夜精品5599| 性久久久久久久| 亚洲婷婷国产精品电影人久久| 日韩午夜在线影院| 欧美在线观看一区二区| 国产另类ts人妖一区二区| 五月综合激情婷婷六月色窝| 国产精品三级电影| 精品毛片乱码1区2区3区| 色av成人天堂桃色av| 成人性生交大片免费看在线播放| 亚洲成av人片一区二区梦乃| 国产精品久久免费看| 精品三级av在线| 欧美日韩在线亚洲一区蜜芽| 99久久国产综合精品色伊| 国产成人免费视频网站| 美女脱光内衣内裤视频久久网站| 伊人婷婷欧美激情| 欧美国产日本视频| 国产亚洲精品福利| 欧美精品一区二| 日韩欧美第一区| 欧美一区二区成人| 91精品国产免费久久综合| 欧美偷拍一区二区| 欧美在线观看18| 在线观看免费成人| 欧美羞羞免费网站| 91福利在线免费观看| 一本色道久久综合亚洲aⅴ蜜桃 | 国产亚洲综合av| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 久久亚洲精品国产精品紫薇| 91精品国产欧美一区二区| 欧美丰满少妇xxxxx高潮对白| 欧美三级中文字幕| 欧美浪妇xxxx高跟鞋交| 欧美日韩国产片| 欧美一卡2卡三卡4卡5免费| 91精品在线麻豆| 欧美不卡一区二区| 国产亚洲污的网站| 国产精品婷婷午夜在线观看| 国产精品久久久久aaaa| 国产精品毛片a∨一区二区三区| 国产精品美女一区二区三区| 国产精品不卡在线| 亚洲一区二区在线视频| 丝袜亚洲精品中文字幕一区| 秋霞午夜鲁丝一区二区老狼| 国产在线观看免费一区| 成人免费毛片a| 在线观看一区二区精品视频| 欧美片在线播放| 久久亚洲精精品中文字幕早川悠里| 国产欧美精品一区aⅴ影院| 一区二区三区在线观看视频| 视频一区视频二区在线观看| 韩国v欧美v日本v亚洲v| 成人黄色小视频| 欧美日韩国产综合一区二区三区| 日韩免费电影一区| 久久精品视频一区| 亚洲妇熟xx妇色黄| 韩国v欧美v亚洲v日本v| 91免费看`日韩一区二区| 777亚洲妇女| 国产精品免费人成网站| 亚洲成人av中文| 高清不卡在线观看av| 欧美色倩网站大全免费| 精品久久久久久无| 亚洲黄色小视频| 国产精品影视网| 欧美精品在线观看播放| 欧美激情一区二区三区在线| 亚洲成人午夜电影| 丁香另类激情小说| 欧美一区二区视频免费观看| 亚洲欧洲成人精品av97| 美洲天堂一区二卡三卡四卡视频 | 在线免费不卡电影| 久久精品亚洲一区二区三区浴池|