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

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

?? d_no_fer.c

?? 完整的EVRC壓縮解壓縮算法源碼,附帶一個簡單的例子程序。
?? C
字號:
/**********************************************************************
Each of the companies; Lucent, Motorola, Nokia, and Qualcomm (hereinafter 
referred to individually as "Source" or collectively as "Sources") do 
hereby state:

To the extent to which the Source(s) may legally and freely do so, the 
Source(s), upon submission of a Contribution, grant(s) a free, 
irrevocable, non-exclusive, license to the Third Generation Partnership 
Project 2 (3GPP2) and its Organizational Partners: ARIB, CCSA, TIA, TTA, 
and TTC, under the Source's copyright or copyright license rights in the 
Contribution, to, in whole or in part, copy, make derivative works, 
perform, display and distribute the Contribution and derivative works 
thereof consistent with 3GPP2's and each Organizational Partner's 
policies and procedures, with the right to (i) sublicense the foregoing 
rights consistent with 3GPP2's and each Organizational Partner's  policies 
and procedures and (ii) copyright and sell, if applicable) in 3GPP2's name 
or each Organizational Partner's name any 3GPP2 or transposed Publication 
even though this Publication may contain the Contribution or a derivative 
work thereof.  The Contribution shall disclose any known limitations on 
the Source's rights to license as herein provided.

When a Contribution is submitted by the Source(s) to assist the 
formulating groups of 3GPP2 or any of its Organizational Partners, it 
is proposed to the Committee as a basis for discussion and is not to 
be construed as a binding proposal on the Source(s).  The Source(s) 
specifically reserve(s) the right to amend or modify the material 
contained in the Contribution. Nothing contained in the Contribution 
shall, except as herein expressly provided, be construed as conferring 
by implication, estoppel or otherwise, any license or right under (i) 
any existing or later issuing patent, whether or not the use of 
information in the document necessarily employs an invention of any 
existing or later issued patent, (ii) any copyright, (iii) any 
trademark, or (iv) any other intellectual property right.

With respect to the Software necessary for the practice of any or 
all Normative portions of the Enhanced Variable Rate Codec (EVRC) as 
it exists on the date of submittal of this form, should the EVRC be 
approved as a Specification or Report by 3GPP2, or as a transposed 
Standard by any of the 3GPP2's Organizational Partners, the Source(s) 
state(s) that a worldwide license to reproduce, use and distribute the 
Software, the license rights to which are held by the Source(s), will 
be made available to applicants under terms and conditions that are 
reasonable and non-discriminatory, which may include monetary compensation, 
and only to the extent necessary for the practice of any or all of the 
Normative portions of the EVRC or the field of use of practice of the 
EVRC Specification, Report, or Standard.  The statement contained above 
is irrevocable and shall be binding upon the Source(s).  In the event 
the rights of the Source(s) in and to copyright or copyright license 
rights subject to such commitment are assigned or transferred, the 
Source(s) shall notify the assignee or transferee of the existence of 
such commitments.
*******************************************************************/
 
/*======================================================================*/
/*     Enhanced Variable Rate Codec - Bit-Exact C Specification         */
/*     Copyright (C) 1997-1998 Telecommunications Industry Association. */
/*     All rights reserved.                                             */
/*----------------------------------------------------------------------*/
/* Note:  Reproduction and use of this software for the design and      */
/*     development of North American Wideband CDMA Digital              */
/*     Cellular Telephony Standards is authorized by the TIA.           */
/*     The TIA does not authorize the use of this software for any      */
/*     other purpose.                                                   */
/*                                                                      */
/*     The availability of this software does not provide any license   */
/*     by implication, estoppel, or otherwise under any patent rights   */
/*     of TIA member companies or others covering any use of the        */
/*     contents herein.                                                 */
/*                                                                      */
/*     Any copies of this software or derivative works must include     */
/*     this and all other proprietary notices.                          */
/*======================================================================*/
/*  Memory Usage:                           				*/
/*      ROM:                            				*/
/*      Static/Global RAM:                      			*/
/*      Stack/Local RAM:                    				*/
/*----------------------------------------------------------------------*/

/*----------------------------------------------------------------------*/
/*  EVRC Decoder -- (called when no frame errors have occured.)         */
/*======================================================================*/
/*         ..Includes.                                                  */
/*----------------------------------------------------------------------*/

#include  <stdio.h>
#include  <string.h>
#include  <stdlib.h>

#include "mathadv.h"
#include "mathevrc.h"
#include "mathdp31.h"

#include  "d_globs.h"
#include  "globs.h"
#include  "macro.h"
#include  "proto.h"
#include  "rom.h"
#include  "acelp_pf.h"          /* for ACELP */

extern void decode_rate_1(short*, short, short*);
void pit_shrp(short *, short, short, short);
void Fix_delay_contour(long *);


/*======================================================================*/
/*         ..Decode bitstream data.                                     */
/*----------------------------------------------------------------------*/
void decode_no_fer(
			   short *codeBuf,
			   short post_filter,
			   short *outFbuf
)
{
	/*....(local) variables.... */
	register short i, j, n;
	register short *foutP;
	long delayi[3];
	short subframesize;
	short sum1;
	short sum_acb;

#define P75	24576
#define P20	6554

	/*....execute.... */
	for (i = 0; i < PACKWDSNUM; i++){
		PackedWords[i] = codeBuf[i];
		}

	/* Re-initialize PackWdsPtr */
	PackWdsPtr[0] = 16;
	PackWdsPtr[1] = 0;

	{
		fer_counter -= 1;
		if (fer_counter < 0)
			fer_counter = 0;
	}


	if (bit_rate == 1)
	{
		decode_rate_1(codeBuf, post_filter, outFbuf);
	}

	else
	{							/* If rate is 4kbps or 8kbps */

		if (bit_rate == 4)
			BitUnpack(&LPCflag, (unsigned short *) PackedWords, 1, PackWdsPtr);
		else
			LPCflag = 0;

		/* Bit-unpack the quantization indices */
		for (i = 0; i < knum; i++)
			BitUnpack(&SScratch[i], (unsigned short *) PackedWords,
					  lognsize[i], PackWdsPtr);

		{
			lspmaq_dec(ORDER, 1, knum, nsub, nsize, lsp, SScratch, bit_rate, lsptab);

                        /* Check for monotonic LSP */
			for (j = 1; j < ORDER; j++)
                            if (lsp[j] <= lsp[j - 1]) 
                            {
                                errorFlag = 1;
                                return;
                            }

                        /* Check for minimum separation of LSPs at the splits */
                        if( bit_rate == 3 )     /* Check Half Rate splits */
                        {
                            if(   (lsp[3] <= add(lsp[2],MIN_LSP_SEP))
                               || (lsp[6] <= add(lsp[5],MIN_LSP_SEP)))
                            {
                                errorFlag = 1;
                                return;
                            }
                        }
                        else                    
                        {                      /* Check Full Rate splits */
                            if(   (lsp[2] <= add(lsp[1],MIN_LSP_SEP))
                               || (lsp[4] <= add(lsp[3],MIN_LSP_SEP))
                               || (lsp[7] <= add(lsp[6],MIN_LSP_SEP)))
                            {
                                errorFlag = 1;
                                return;
                            }
                        }
		}


		BitUnpack(&idxppg, (unsigned short *) PackedWords, 7, PackWdsPtr);
		idxppg += DMIN;

		/* Check in delay is possible */
		if (idxppg > DMAX)
		{
			errorFlag = 1;
			return;
		}

		delay = idxppg;

        if (bit_rate == 4) {  /* check for full-rate */

            /* unpack delta_delay */
            BitUnpack(&idxppg, (unsigned short *) PackedWords, 5, PackWdsPtr);

#if ANSI_EVRC_DDELAY_CHECK
            /* check for out-of-range previous delay before Fix_delay_contour */
            if (idxppg != 0)
            {
                /* prev_delay = delay - delta_delta + 16 */
                n = sub(delay, sub(idxppg, 16));

                if (n < DMIN)
                {
                    errorFlag = 1;
                    return;
                }
                if (n > DMAX)
                {
                    errorFlag = 1;
                    return;
                }
            }
#endif

            /* Fix delay contour */
            if (fer_counter == 2 && idxppg != 0)
            {
                Fix_delay_contour(delayi);
            }
        }

		/* Smooth interpolation if the difference between delays is too big */
		if (abs(sub(delay, pdelayD)) > 15)
			pdelayD = delay;

		/* Update fer coefficients */
		ave_acb_gain = ave_fcb_gain = 0;

		foutP = outFbuf;
		for (i = 0; i < NoOfSubFrames; i++)
		{
			if (i < 2)
				subframesize = SubFrameSize - 1;
			else
				subframesize = SubFrameSize;

			Interpol(lspi, OldlspD, lsp, i, ORDER);

			/* Convert lsp to PC */
			lsp2a(pci, lspi);

			/* Bandwidth expansion after frame erasure only if LPCflag is set */
			if (bit_rate == 4)
			{
				if (LPCflag && fer_counter == 2)
					weight(pci, pci, P75, ORDER);
			}

			Interpol_delay(delayi, &pdelayD, &delay, i);


			/* Un-Pack bits */
			/* ACB delay gain */
			BitUnpack(&idxppg, (unsigned short *) PackedWords, 3, PackWdsPtr);

			/* FCB shape index 1 */
			if (bit_rate == 4)
			{
				BitUnpack(SScratch, (unsigned short *) PackedWords, 8, PackWdsPtr);
				fcbIndexVector[0] = *SScratch;
				BitUnpack(SScratch, (unsigned short *) PackedWords, 8, PackWdsPtr);
				fcbIndexVector[1] = *SScratch;
				BitUnpack(SScratch, (unsigned short *) PackedWords, 8, PackWdsPtr);
				fcbIndexVector[2] = *SScratch;
				BitUnpack(SScratch, (unsigned short *) PackedWords, 11, PackWdsPtr);
				fcbIndexVector[3] = *SScratch;
				/* FCB gain index */
				BitUnpack(&idxcbg, (unsigned short *) PackedWords, 5, PackWdsPtr);
			}
			else
			{
				BitUnpack(&idxcb, (unsigned short *) PackedWords, 10, PackWdsPtr);
				/* FCB gain index */
				BitUnpack(&idxcbg, (unsigned short *) PackedWords, 4, PackWdsPtr);
			}

			/* Compute adaptive codebook contribution */
			{
				sum_acb = ppvq[idxppg];
				ave_acb_gain = add(ave_acb_gain, mult_r(sum_acb, 10923));	/* (10923=1/NoOfSubFrames) */
			}

			acb_excitation(PitchMemoryD + ACBMemSize, sum_acb, delayi,
						   PitchMemoryD, subframesize);

			/* Compute fixed codebook contribution */
			ave_fcb_gain = add(ave_fcb_gain, mult_r(gnvq[idxcbg], 1365));	/* (1365=(1/3)/8) */

			/* Compute fixed codebook contribution */
			if ((bit_rate == 4))	/* full rate */
                dec8_35(fcbIndexVector, Scratch, subframesize);

			if ((bit_rate == 3))	/* half rate */
                dec3_10(idxcb, Scratch, subframesize);

			{
				if (sum_acb > 14744)
					sum_acb = 14744;
				if (sum_acb < 3276)
					sum_acb = 3276;
				sum_acb = shl(sum_acb, 1);


				/* get intrpolated delay for this subframe */
				/* n = extract_h(L_add(L_shr(L_add(delayi[1], delayi[0]), 1), 32768)); */
				/* n = extract_h(L_add(L_shr(L_add(delayi[1], delayi[0]), 1), 0x00008000L)); */
				n = round32(L_shr(L_add(delayi[1], delayi[0]), 1));
				if (n > subframesize)
					n = 200;

				/* To scale down by 8 to offset (sum1=gnvq[]),
				 * which has been scaled up by 8 */
				for (j = 0; j < SubFrameSize + 6; j++)
					Scratch[j] = shl(Scratch[j], 11);

				pit_shrp(Scratch, n, sum_acb, subframesize);

				sum1 = gnvq[idxcbg];
				for (j = 0; j < subframesize; j++)
					PitchMemoryD[j + ACBMemSize] = add(PitchMemoryD[j + ACBMemSize], mult_r(sum1, Scratch[j]));
			}

			{
				FadeScale = add(FadeScale, P20);
			}

			for (j = 0; j < ACBMemSize; j++)
				PitchMemoryD[j] = PitchMemoryD[j + subframesize];


			/* Synthesis of decoder output signal and postfilter output signal */
			iir(DECspeech, PitchMemoryD + ACBMemSize, pci, SynMemory, ORDER, subframesize);

			/* Postfilter */
			if (post_filter)
			{
				if (bit_rate == 4)
					apf(DECspeech, pci, DECspeechPF, L_shr(L_add(delayi[0], delayi[1]), 1), ALPHA, BETA, U, AGC, LTGAIN, ORDER, subframesize, bit_rate);
				else
					apf(DECspeech, pci, DECspeechPF, L_shr(L_add(delayi[0], delayi[1]), 1), HALF_ALPHA, BETA, HALF_U, AGC, LTGAIN, ORDER, subframesize, bit_rate);
			}
			else
			{
				for (j = 0; j < subframesize; j++)
					DECspeechPF[j] = DECspeech[j];
			}

			/* Write p.f. decoder output and variables to files */
			for (j = 0; j < subframesize; j++){
				*foutP++ = shl(DECspeechPF[j],1); /* adjust scaling */
				}
		}
		pdelayD = delay;
	}							/* Ends case for rate=4kbps or 8kbps */

	/* update decoder varaibles */
	for (i = 0; i < ORDER; i++)
		OldlspD[i] = lsp[i];
	lastrateD = bit_rate;

	decode_fcnt++;
	last_fer_flag = fer_flag;
}

void Fix_delay_contour(long *delayi)
{
register int i, j;
short subframesize;

		/* Fix delay countour of previous erased frame */
			j = sub(idxppg, 16);
			pdelayD_back = pdelayD;
			pdelayD = sub(delay, j);
			if (abs(sub(pdelayD, pdelayD_back)) > 15)
				pdelayD_back = pdelayD;

			for (i = 0; i < ACBMemSize; i++)
				PitchMemoryD[i] = PitchMemoryD_back[i];

#if 1
			for (i = 0; i < NoOfSubFrames; i++)
			{
				if (i < 2)
					subframesize = SubFrameSize - 1;
				else
					subframesize = SubFrameSize;

				/* Interpolate delay */
				Interpol_delay(delayi, &pdelayD_back, &pdelayD, i);

				/* Compute adaptive codebook contribution */
				acb_excitation(PitchMemoryD + ACBMemSize, ave_acb_gain, delayi,
							   PitchMemoryD, subframesize);

				for (j = 0; j < ACBMemSize; j++)
					PitchMemoryD[j] = PitchMemoryD[j + subframesize];
			}
#endif
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品传媒入口麻豆| 成人av影院在线| 亚洲午夜一区二区| 尤物视频一区二区| 亚洲久本草在线中文字幕| 一区二区三区日韩欧美精品| 亚洲女与黑人做爰| 婷婷丁香激情综合| 日韩—二三区免费观看av| 一区二区三区**美女毛片| 亚洲理论在线观看| 亚洲大型综合色站| 丝袜亚洲另类欧美综合| 蜜臀精品久久久久久蜜臀 | 日韩一区欧美小说| 成人欧美一区二区三区| 悠悠色在线精品| 美腿丝袜一区二区三区| 成人av电影免费观看| 欧美日韩一区二区三区四区五区 | 精品国一区二区三区| 久久午夜免费电影| 亚洲人成在线播放网站岛国| 日韩精品1区2区3区| 国产精品2024| 欧美唯美清纯偷拍| 久久婷婷久久一区二区三区| 亚洲视频一二区| 偷拍一区二区三区四区| 国产成人午夜99999| 色素色在线综合| 久久影视一区二区| 亚洲高清免费视频| 成人精品免费网站| 欧美精品xxxxbbbb| 一区在线中文字幕| 精品在线播放免费| 欧美在线观看视频一区二区| 久久日一线二线三线suv| 亚洲制服丝袜在线| 国产一区二区三区在线观看免费| 日本久久电影网| 国产日韩精品一区二区三区| 日韩精品一级二级 | 一本高清dvd不卡在线观看| 日韩视频123| 中文字幕一区二区三区不卡在线 | 欧美变态tickling挠脚心| 中文字幕一区二区三区四区不卡| 麻豆国产精品官网| 欧美体内she精高潮| 中文字幕亚洲一区二区av在线| 久久超碰97中文字幕| 欧美日韩国产电影| 亚洲精品高清在线| 91在线一区二区三区| 国产午夜亚洲精品午夜鲁丝片 | 亚洲精品一区在线观看| 玉米视频成人免费看| 99国产精品久久| 国产精品日产欧美久久久久| 久久成人久久爱| 精品欧美一区二区三区精品久久 | 一区二区三区中文字幕精品精品| 国产麻豆视频一区二区| 日韩一区二区免费在线观看| 一区二区三区欧美日韩| 色噜噜狠狠成人网p站| 亚洲欧美日韩国产一区二区三区| 高清国产一区二区三区| 欧美日免费三级在线| 洋洋av久久久久久久一区| 色诱亚洲精品久久久久久| 亚洲免费观看在线观看| 91一区二区三区在线播放| 欧美大片日本大片免费观看| 青青草国产成人av片免费| 欧美人动与zoxxxx乱| 视频在线观看一区| 精品国产伦一区二区三区观看体验 | 亚洲成人一区在线| 国产尤物一区二区在线 | 蜜臀99久久精品久久久久久软件| 成人av动漫在线| 亚洲人xxxx| 91麻豆免费视频| 一区二区三区中文字幕电影| 欧美日韩国产123区| 视频一区欧美精品| 欧美大胆人体bbbb| 悠悠色在线精品| 蜜臀av性久久久久蜜臀aⅴ流畅 | 成人成人成人在线视频| 一本久道中文字幕精品亚洲嫩 | 日韩欧美激情一区| 日韩国产成人精品| 久久一区二区三区四区| 国产98色在线|日韩| 亚洲免费观看高清完整版在线 | 国产精品素人一区二区| 色悠久久久久综合欧美99| 水野朝阳av一区二区三区| 久久久久久久免费视频了| 成人av电影观看| 日韩成人免费看| 国产欧美日韩亚州综合| 欧美怡红院视频| 久久精品国内一区二区三区| 国产午夜亚洲精品午夜鲁丝片| 色综合一区二区| 久久精品国产第一区二区三区| 国产精品传媒视频| 精品粉嫩超白一线天av| 一本一道综合狠狠老| 蜜桃av一区二区三区电影| 午夜电影网亚洲视频| 中文字幕精品一区| 欧美一区二区视频在线观看 | 一本色道久久综合狠狠躁的推荐| 久久精品国产精品亚洲红杏| 一区二区在线观看视频| 国产欧美一区二区三区在线看蜜臀| 欧美色网站导航| 波多野结衣中文字幕一区| 麻豆国产91在线播放| 午夜视频久久久久久| 中文字幕五月欧美| 久久久精品蜜桃| 欧美刺激脚交jootjob| 欧美色区777第一页| av电影一区二区| 国产成a人亚洲| 国产原创一区二区三区| 日本成人在线网站| 亚洲一区欧美一区| 自拍偷拍欧美激情| 中文字幕中文在线不卡住| 国产亚洲精品7777| 久久综合久久鬼色| 亚洲精品一区二区三区影院| 欧洲在线/亚洲| 在线欧美小视频| 色偷偷88欧美精品久久久| 91在线丨porny丨国产| 不卡在线视频中文字幕| 成人性视频免费网站| 国产一区二三区| 99精品国产99久久久久久白柏| 国内精品国产成人国产三级粉色| 五月激情综合婷婷| 日韩成人一级大片| 蓝色福利精品导航| 国产麻豆精品视频| 国产99久久久精品| 暴力调教一区二区三区| aaa欧美日韩| 色综合色狠狠综合色| 欧美优质美女网站| 欧美日韩中文一区| 日韩欧美中文一区| 26uuu国产在线精品一区二区| 精品三级在线观看| 久久中文字幕电影| 欧美激情自拍偷拍| 最好看的中文字幕久久| 亚洲另类一区二区| 亚洲综合另类小说| 视频一区欧美精品| 国产成人亚洲综合色影视| 成人午夜伦理影院| 97久久精品人人做人人爽| 99久免费精品视频在线观看| www.激情成人| 欧美性欧美巨大黑白大战| 欧美理论片在线| 日韩视频免费观看高清完整版 | 成人不卡免费av| 精品视频1区2区3区| 精品日韩99亚洲| 国产精品国产精品国产专区不蜜| 一区二区理论电影在线观看| 日本 国产 欧美色综合| 国产精品123区| 色婷婷国产精品综合在线观看| 欧美高清你懂得| 中文无字幕一区二区三区 | 亚洲综合一区二区三区| 蜜桃久久av一区| 91天堂素人约啪| 日韩精品专区在线影院观看| 亚洲欧洲国产日韩| 免费成人性网站| 色综合一个色综合亚洲| 久久久午夜精品| 视频在线观看91| 91视频com| 国产亲近乱来精品视频| 青椒成人免费视频| 色狠狠色狠狠综合| 国产午夜精品在线观看|