2
/******************************************************************
4
iLBC Speech Coder ANSI-C Source Code
8
Copyright (C) The Internet Society (2004).
11
******************************************************************/
16
#include "iLBC_define.h"
17
#include "constants.h"
20
/*----------------------------------------------------------------*
21
* decoding of the start state
22
*---------------------------------------------------------------*/
25
int idxForMax, /* (i) 6-bit index for the quantization of
27
int *idxVec, /* (i) vector of quantization indexes */
28
float *syntDenum, /* (i) synthesis filter denumerator */
34
float *out, /* (o) the decoded state vector */
35
int len /* (i) length of a state vector */
37
float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp,
38
numerator[LPC_FILTERORDER+1];
39
float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout;
42
/* decoding of the maximum value */
44
maxVal = state_frgqTbl[idxForMax];
45
maxVal = (float)pow(10,maxVal)/(float)4.5;
47
/* initialization of buffers and coefficients */
49
memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float));
50
memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float));
51
for (k=0; k<LPC_FILTERORDER; k++) {
52
numerator[k]=syntDenum[LPC_FILTERORDER-k];
54
numerator[LPC_FILTERORDER]=syntDenum[0];
55
tmp = &tmpbuf[LPC_FILTERORDER];
56
fout = &foutbuf[LPC_FILTERORDER];
58
/* decoding of the sample values */
60
for (k=0; k<len; k++) {
63
tmp[k] = maxVal*state_sq3Tbl[idxVec[tmpi]];
66
/* circular convolution with all-pass filter */
68
memset(tmp+len, 0, len*sizeof(float));
69
ZeroPoleFilter(tmp, numerator, syntDenum, 2*len,
70
LPC_FILTERORDER, fout);
72
out[k] = fout[len-1-k]+fout[2*len-1-k];