15 #include "iLBC_define.h"
18 #include "constants.h"
35 float temp[BLOCKL_MAX], lp[LPC_FILTERORDER + 1];
36 float lp2[LPC_FILTERORDER + 1];
37 float r[LPC_FILTERORDER + 1];
39 is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl;
40 memcpy(iLBCenc_inst->lpc_buffer+is,data,
41 iLBCenc_inst->blockl*
sizeof(
float));
45 for (k = 0; k < iLBCenc_inst->lpc_n; k++) {
49 if (k < (iLBCenc_inst->lpc_n - 1)) {
50 window(temp, lpc_winTbl,
51 iLBCenc_inst->lpc_buffer, BLOCKL_MAX);
53 window(temp, lpc_asymwinTbl,
54 iLBCenc_inst->lpc_buffer + is, BLOCKL_MAX);
57 autocorr(r, temp, BLOCKL_MAX, LPC_FILTERORDER);
58 window(r, r, lpc_lagwinTbl, LPC_FILTERORDER + 1);
60 levdurb(lp, temp, r, LPC_FILTERORDER);
61 bwexpand(lp2, lp, LPC_CHIRP_SYNTDENUM, LPC_FILTERORDER+1);
63 a2lsf(lsf + k*LPC_FILTERORDER, lp2);
65 is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl;
66 memmove(iLBCenc_inst->lpc_buffer,
67 iLBCenc_inst->lpc_buffer+LPC_LOOKBACK+BLOCKL_MAX-is,
81 void LSFinterpolate2a_enc(
89 float lsftmp[LPC_FILTERORDER];
91 interpolate(lsftmp, lsf1, lsf2, coef, length);
99 void SimpleInterpolateLSF(
116 int i, pos, lp_length;
117 float lp[LPC_FILTERORDER + 1], *lsf2, *lsfdeq2;
120 lsfdeq2 = lsfdeq + length;
121 lp_length = length + 1;
123 if (iLBCenc_inst->mode==30) {
132 LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq,
133 lsf_weightTbl_30ms[0], length);
134 memcpy(syntdenum,lp,lp_length*
sizeof(
float));
135 LSFinterpolate2a_enc(lp, lsfold, lsf,
136 lsf_weightTbl_30ms[0], length);
137 bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, lp_length);
143 for (i = 1; i < iLBCenc_inst->nsub; i++) {
144 LSFinterpolate2a_enc(lp, lsfdeq, lsfdeq2,
145 lsf_weightTbl_30ms[i], length);
146 memcpy(syntdenum + pos,lp,lp_length*
sizeof(
float));
148 LSFinterpolate2a_enc(lp, lsf, lsf2,
149 lsf_weightTbl_30ms[i], length);
150 bwexpand(weightdenum + pos, lp,
151 LPC_CHIRP_WEIGHTDENUM, lp_length);
157 for (i = 0; i < iLBCenc_inst->nsub; i++) {
158 LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq,
159 lsf_weightTbl_20ms[i], length);
160 memcpy(syntdenum+pos,lp,lp_length*
sizeof(
float));
161 LSFinterpolate2a_enc(lp, lsfold, lsf,
162 lsf_weightTbl_20ms[i], length);
163 bwexpand(weightdenum+pos, lp,
164 LPC_CHIRP_WEIGHTDENUM, lp_length);
171 if (iLBCenc_inst->mode==30) {
172 memcpy(lsfold, lsf2, length*
sizeof(
float));
173 memcpy(lsfdeqold, lsfdeq2, length*
sizeof(
float));
176 memcpy(lsfold, lsf, length*
sizeof(
float));
177 memcpy(lsfdeqold, lsfdeq, length*
sizeof(
float));
199 SplitVQ(lsfdeq, index, lsf, lsfCbTbl, LSF_NSPLIT,
200 dim_lsfCbTbl, size_lsfCbTbl);
204 SplitVQ(lsfdeq + LPC_FILTERORDER, index + LSF_NSPLIT,
205 lsf + LPC_FILTERORDER, lsfCbTbl, LSF_NSPLIT,
206 dim_lsfCbTbl, size_lsfCbTbl);
225 float lsf[LPC_FILTERORDER * LPC_N_MAX];
226 float lsfdeq[LPC_FILTERORDER * LPC_N_MAX];
228 SimpleAnalysis(lsf, data, iLBCenc_inst);
229 SimplelsfQ(lsfdeq, lsf_index, lsf, iLBCenc_inst->lpc_n);
234 LSF_check(lsfdeq, LPC_FILTERORDER, iLBCenc_inst->lpc_n);
235 SimpleInterpolateLSF(syntdenum, weightdenum,
236 lsf, lsfdeq, iLBCenc_inst->lsfold,
237 iLBCenc_inst->lsfdeqold, LPC_FILTERORDER, iLBCenc_inst);