Asterisk - The Open Source Telephony Project  18.5.0
iLBC_decode.c
Go to the documentation of this file.
1 
2  /******************************************************************
3 
4  iLBC Speech Coder ANSI-C Source Code
5 
6  iLBC_decode.c
7 
8  Copyright (C) The Internet Society (2004).
9  All Rights Reserved.
10 
11  ******************************************************************/
12 
13  #include <math.h>
14  #include <stdlib.h>
15 
16  #include "iLBC_define.h"
17  #include "StateConstructW.h"
18  #include "LPCdecode.h"
19  #include "iCBConstruct.h"
20  #include "doCPLC.h"
21  #include "helpfun.h"
22  #include "constants.h"
23  #include "packing.h"
24  #include "string.h"
25  #include "enhancer.h"
26  #include "hpOutput.h"
27  #include "syntFilter.h"
28 
29  /*----------------------------------------------------------------*
30  * Initiation of decoder instance.
31  *---------------------------------------------------------------*/
32 
33  short initDecode( /* (o) Number of decoded
34  samples */
35  iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
36  int mode, /* (i) frame size mode */
37  int use_enhancer /* (i) 1 to use enhancer
38  0 to run without
39  enhancer */
40  ){
41  int i;
42 
43  iLBCdec_inst->mode = mode;
44 
45 
46 
47 
48 
49  if (mode==30) {
50  iLBCdec_inst->blockl = BLOCKL_30MS;
51  iLBCdec_inst->nsub = NSUB_30MS;
52  iLBCdec_inst->nasub = NASUB_30MS;
53  iLBCdec_inst->lpc_n = LPC_N_30MS;
54  iLBCdec_inst->no_of_bytes = NO_OF_BYTES_30MS;
55  iLBCdec_inst->no_of_words = NO_OF_WORDS_30MS;
57  /* ULP init */
58  iLBCdec_inst->ULP_inst=&ULP_30msTbl;
59  }
60  else if (mode==20) {
61  iLBCdec_inst->blockl = BLOCKL_20MS;
62  iLBCdec_inst->nsub = NSUB_20MS;
63  iLBCdec_inst->nasub = NASUB_20MS;
64  iLBCdec_inst->lpc_n = LPC_N_20MS;
65  iLBCdec_inst->no_of_bytes = NO_OF_BYTES_20MS;
66  iLBCdec_inst->no_of_words = NO_OF_WORDS_20MS;
68  /* ULP init */
69  iLBCdec_inst->ULP_inst=&ULP_20msTbl;
70  }
71  else {
72  exit(2);
73  }
74 
75  memset(iLBCdec_inst->syntMem, 0,
76  LPC_FILTERORDER*sizeof(float));
77  memcpy((*iLBCdec_inst).lsfdeqold, lsfmeanTbl,
78  LPC_FILTERORDER*sizeof(float));
79 
80  memset(iLBCdec_inst->old_syntdenum, 0,
81  ((LPC_FILTERORDER + 1)*NSUB_MAX)*sizeof(float));
82  for (i=0; i<NSUB_MAX; i++)
83  iLBCdec_inst->old_syntdenum[i*(LPC_FILTERORDER+1)]=1.0;
84 
85  iLBCdec_inst->last_lag = 20;
86 
87  iLBCdec_inst->prevLag = 120;
88  iLBCdec_inst->per = 0.0;
89  iLBCdec_inst->consPLICount = 0;
90  iLBCdec_inst->prevPLI = 0;
91  iLBCdec_inst->prevLpc[0] = 1.0;
92  memset(iLBCdec_inst->prevLpc+1,0,
93  LPC_FILTERORDER*sizeof(float));
94  memset(iLBCdec_inst->prevResidual, 0, BLOCKL_MAX*sizeof(float));
95  iLBCdec_inst->seed=777;
96 
97 
98 
99 
100 
101 
102  memset(iLBCdec_inst->hpomem, 0, 4*sizeof(float));
103 
104  iLBCdec_inst->use_enhancer = use_enhancer;
105  memset(iLBCdec_inst->enh_buf, 0, ENH_BUFL*sizeof(float));
106  for (i=0;i<ENH_NBLOCKS_TOT;i++)
107  iLBCdec_inst->enh_period[i]=(float)40.0;
108 
109  iLBCdec_inst->prev_enh_pl = 0;
110 
111  return (iLBCdec_inst->blockl);
112  }
113 
114  /*----------------------------------------------------------------*
115  * frame residual decoder function (subrutine to iLBC_decode)
116  *---------------------------------------------------------------*/
117 
118  void Decode(
119  iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
120  structure */
121  float *decresidual, /* (o) decoded residual frame */
122  int start, /* (i) location of start
123  state */
124  int idxForMax, /* (i) codebook index for the
125  maximum value */
126  int *idxVec, /* (i) codebook indexes for the
127  samples in the start
128  state */
129  float *syntdenum, /* (i) the decoded synthesis
130  filter coefficients */
131  int *cb_index, /* (i) the indexes for the
132  adaptive codebook */
133  int *gain_index, /* (i) the indexes for the
134  corresponding gains */
135  int *extra_cb_index, /* (i) the indexes for the
136  adaptive codebook part
137  of start state */
138  int *extra_gain_index, /* (i) the indexes for the
139  corresponding gains */
140  int state_first /* (i) 1 if non adaptive part
141  of start state comes
142  first 0 if that part
143  comes last */
144  ){
145  float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML];
146  int k, meml_gotten, Nfor, Nback, i;
147  int diff, start_pos;
148  int subcount, subframe;
149 
150 
151 
152 
153 
154 
155  diff = STATE_LEN - iLBCdec_inst->state_short_len;
156 
157  if (state_first == 1) {
158  start_pos = (start-1)*SUBL;
159  } else {
160  start_pos = (start-1)*SUBL + diff;
161  }
162 
163  /* decode scalar part of start state */
164 
165  StateConstructW(idxForMax, idxVec,
166  &syntdenum[(start-1)*(LPC_FILTERORDER+1)],
167  &decresidual[start_pos], iLBCdec_inst->state_short_len);
168 
169 
170  if (state_first) { /* put adaptive part in the end */
171 
172  /* setup memory */
173 
174  memset(mem, 0,
175  (CB_MEML-iLBCdec_inst->state_short_len)*sizeof(float));
176  memcpy(mem+CB_MEML-iLBCdec_inst->state_short_len,
177  decresidual+start_pos,
178  iLBCdec_inst->state_short_len*sizeof(float));
179 
180  /* construct decoded vector */
181 
182  iCBConstruct(
183  &decresidual[start_pos+iLBCdec_inst->state_short_len],
184  extra_cb_index, extra_gain_index, mem+CB_MEML-stMemLTbl,
185  stMemLTbl, diff, CB_NSTAGES);
186 
187  }
188  else {/* put adaptive part in the beginning */
189 
190  /* create reversed vectors for prediction */
191 
192  for (k=0; k<diff; k++) {
193  reverseDecresidual[k] =
194  decresidual[(start+1)*SUBL-1-
195  (k+iLBCdec_inst->state_short_len)];
196  }
197 
198  /* setup memory */
199 
200  meml_gotten = iLBCdec_inst->state_short_len;
201  for (k=0; k<meml_gotten; k++){
202  mem[CB_MEML-1-k] = decresidual[start_pos + k];
203 
204 
205 
206 
207 
208  }
209  memset(mem, 0, (CB_MEML-k)*sizeof(float));
210 
211  /* construct decoded vector */
212 
213  iCBConstruct(reverseDecresidual, extra_cb_index,
214  extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl,
215  diff, CB_NSTAGES);
216 
217  /* get decoded residual from reversed vector */
218 
219  for (k=0; k<diff; k++) {
220  decresidual[start_pos-1-k] = reverseDecresidual[k];
221  }
222  }
223 
224  /* counter for predicted sub-frames */
225 
226  subcount=0;
227 
228  /* forward prediction of sub-frames */
229 
230  Nfor = iLBCdec_inst->nsub-start-1;
231 
232  if ( Nfor > 0 ){
233 
234  /* setup memory */
235 
236  memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float));
237  memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL,
238  STATE_LEN*sizeof(float));
239 
240  /* loop over sub-frames to encode */
241 
242  for (subframe=0; subframe<Nfor; subframe++) {
243 
244  /* construct decoded vector */
245 
246  iCBConstruct(&decresidual[(start+1+subframe)*SUBL],
247  cb_index+subcount*CB_NSTAGES,
248  gain_index+subcount*CB_NSTAGES,
249  mem+CB_MEML-memLfTbl[subcount],
250  memLfTbl[subcount], SUBL, CB_NSTAGES);
251 
252  /* update memory */
253 
254  memmove(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
255  memcpy(mem+CB_MEML-SUBL,
256 
257 
258 
259 
260 
261  &decresidual[(start+1+subframe)*SUBL],
262  SUBL*sizeof(float));
263 
264  subcount++;
265 
266  }
267 
268  }
269 
270  /* backward prediction of sub-frames */
271 
272  Nback = start-1;
273 
274  if ( Nback > 0 ) {
275 
276  /* setup memory */
277 
278  meml_gotten = SUBL*(iLBCdec_inst->nsub+1-start);
279 
280  if ( meml_gotten > CB_MEML ) {
281  meml_gotten=CB_MEML;
282  }
283  for (k=0; k<meml_gotten; k++) {
284  mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k];
285  }
286  memset(mem, 0, (CB_MEML-k)*sizeof(float));
287 
288  /* loop over subframes to decode */
289 
290  for (subframe=0; subframe<Nback; subframe++) {
291 
292  /* construct decoded vector */
293 
294  iCBConstruct(&reverseDecresidual[subframe*SUBL],
295  cb_index+subcount*CB_NSTAGES,
296  gain_index+subcount*CB_NSTAGES,
297  mem+CB_MEML-memLfTbl[subcount], memLfTbl[subcount],
298  SUBL, CB_NSTAGES);
299 
300  /* update memory */
301 
302  memmove(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
303  memcpy(mem+CB_MEML-SUBL,
304  &reverseDecresidual[subframe*SUBL],
305  SUBL*sizeof(float));
306 
307  subcount++;
308  }
309 
310 
311 
312 
313 
314  /* get decoded residual from reversed vector */
315 
316  for (i=0; i<SUBL*Nback; i++)
317  decresidual[SUBL*Nback - i - 1] =
318  reverseDecresidual[i];
319  }
320  }
321 
322  /*----------------------------------------------------------------*
323  * main decoder function
324  *---------------------------------------------------------------*/
325 
327  float *decblock, /* (o) decoded signal block */
328  unsigned char *bytes, /* (i) encoded signal bits */
329  iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
330  structure */
331  int mode /* (i) 0: bad packet, PLC,
332  1: normal */
333  ){
334  float data[BLOCKL_MAX];
335  float lsfdeq[LPC_FILTERORDER*LPC_N_MAX];
336  float PLCresidual[BLOCKL_MAX], PLClpc[LPC_FILTERORDER + 1];
337  float zeros[BLOCKL_MAX], one[LPC_FILTERORDER + 1];
338  int k, i, start, idxForMax, pos, lastpart, ulp;
339  int lag, ilag;
340  float cc, maxcc;
341  int idxVec[STATE_LEN];
342  int gain_index[NASUB_MAX*CB_NSTAGES],
343  extra_gain_index[CB_NSTAGES];
344  int cb_index[CB_NSTAGES*NASUB_MAX], extra_cb_index[CB_NSTAGES];
345  int lsf_i[LSF_NSPLIT*LPC_N_MAX];
346  int state_first;
347  int last_bit;
348  unsigned char *pbytes;
349  float weightdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
350  int order_plus_one;
351  float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)];
352  float decresidual[BLOCKL_MAX];
353 
354  if (mode>0) { /* the data are good */
355 
356  /* decode data */
357 
358  pbytes=bytes;
359  pos=0;
360 
361 
362 
363 
364 
365 
366  /* Set everything to zero before decoding */
367 
368  for (k=0; k<LSF_NSPLIT*LPC_N_MAX; k++) {
369  lsf_i[k]=0;
370  }
371  start=0;
372  state_first=0;
373  idxForMax=0;
374  for (k=0; k<iLBCdec_inst->state_short_len; k++) {
375  idxVec[k]=0;
376  }
377  for (k=0; k<CB_NSTAGES; k++) {
378  extra_cb_index[k]=0;
379  }
380  for (k=0; k<CB_NSTAGES; k++) {
381  extra_gain_index[k]=0;
382  }
383  for (i=0; i<iLBCdec_inst->nasub; i++) {
384  for (k=0; k<CB_NSTAGES; k++) {
385  cb_index[i*CB_NSTAGES+k]=0;
386  }
387  }
388  for (i=0; i<iLBCdec_inst->nasub; i++) {
389  for (k=0; k<CB_NSTAGES; k++) {
390  gain_index[i*CB_NSTAGES+k]=0;
391  }
392  }
393 
394  /* loop over ULP classes */
395 
396  for (ulp=0; ulp<3; ulp++) {
397 
398  /* LSF */
399  for (k=0; k<LSF_NSPLIT*iLBCdec_inst->lpc_n; k++){
400  unpack( &pbytes, &lastpart,
401  iLBCdec_inst->ULP_inst->lsf_bits[k][ulp], &pos);
402  packcombine(&lsf_i[k], lastpart,
403  iLBCdec_inst->ULP_inst->lsf_bits[k][ulp]);
404  }
405 
406  /* Start block info */
407 
408  unpack( &pbytes, &lastpart,
409  iLBCdec_inst->ULP_inst->start_bits[ulp], &pos);
410  packcombine(&start, lastpart,
411  iLBCdec_inst->ULP_inst->start_bits[ulp]);
412 
413  unpack( &pbytes, &lastpart,
414 
415 
416 
417 
418 
419  iLBCdec_inst->ULP_inst->startfirst_bits[ulp], &pos);
420  packcombine(&state_first, lastpart,
421  iLBCdec_inst->ULP_inst->startfirst_bits[ulp]);
422 
423  unpack( &pbytes, &lastpart,
424  iLBCdec_inst->ULP_inst->scale_bits[ulp], &pos);
425  packcombine(&idxForMax, lastpart,
426  iLBCdec_inst->ULP_inst->scale_bits[ulp]);
427 
428  for (k=0; k<iLBCdec_inst->state_short_len; k++) {
429  unpack( &pbytes, &lastpart,
430  iLBCdec_inst->ULP_inst->state_bits[ulp], &pos);
431  packcombine(idxVec+k, lastpart,
432  iLBCdec_inst->ULP_inst->state_bits[ulp]);
433  }
434 
435  /* 23/22 (20ms/30ms) sample block */
436 
437  for (k=0; k<CB_NSTAGES; k++) {
438  unpack( &pbytes, &lastpart,
439  iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp],
440  &pos);
441  packcombine(extra_cb_index+k, lastpart,
442  iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp]);
443  }
444  for (k=0; k<CB_NSTAGES; k++) {
445  unpack( &pbytes, &lastpart,
446  iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp],
447  &pos);
448  packcombine(extra_gain_index+k, lastpart,
449  iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp]);
450  }
451 
452  /* The two/four (20ms/30ms) 40 sample sub-blocks */
453 
454  for (i=0; i<iLBCdec_inst->nasub; i++) {
455  for (k=0; k<CB_NSTAGES; k++) {
456  unpack( &pbytes, &lastpart,
457  iLBCdec_inst->ULP_inst->cb_index[i][k][ulp],
458  &pos);
459  packcombine(cb_index+i*CB_NSTAGES+k, lastpart,
460  iLBCdec_inst->ULP_inst->cb_index[i][k][ulp]);
461  }
462  }
463 
464  for (i=0; i<iLBCdec_inst->nasub; i++) {
465  for (k=0; k<CB_NSTAGES; k++) {
466  unpack( &pbytes, &lastpart,
467 
468 
469 
470 
471 
472  iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp],
473  &pos);
474  packcombine(gain_index+i*CB_NSTAGES+k, lastpart,
475  iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp]);
476  }
477  }
478  }
479  /* Extract last bit. If it is 1 this indicates an
480  empty/lost frame */
481  unpack( &pbytes, &last_bit, 1, &pos);
482 
483  /* Check for bit errors or empty/lost frames */
484  if (start<1)
485  mode = 0;
486  if (iLBCdec_inst->mode==20 && start>3)
487  mode = 0;
488  if (iLBCdec_inst->mode==30 && start>5)
489  mode = 0;
490  if (last_bit==1)
491  mode = 0;
492 
493  if (mode==1) { /* No bit errors was detected,
494  continue decoding */
495 
496  /* adjust index */
497  index_conv_dec(cb_index);
498 
499  /* decode the lsf */
500 
501  SimplelsfDEQ(lsfdeq, lsf_i, iLBCdec_inst->lpc_n);
502  LSF_check(lsfdeq, LPC_FILTERORDER,
503  iLBCdec_inst->lpc_n);
504  DecoderInterpolateLSF(syntdenum, weightdenum,
505  lsfdeq, LPC_FILTERORDER, iLBCdec_inst);
506 
507  Decode(iLBCdec_inst, decresidual, start, idxForMax,
508  idxVec, syntdenum, cb_index, gain_index,
509  extra_cb_index, extra_gain_index,
510  state_first);
511 
512  /* preparing the plc for a future loss! */
513 
514  doThePLC(PLCresidual, PLClpc, 0, decresidual,
515  syntdenum +
516  (LPC_FILTERORDER + 1)*(iLBCdec_inst->nsub - 1),
517  (*iLBCdec_inst).last_lag, iLBCdec_inst);
518 
519 
520 
521 
522 
523 
524 
525  memcpy(decresidual, PLCresidual,
526  iLBCdec_inst->blockl*sizeof(float));
527  }
528 
529  }
530 
531  if (mode == 0) {
532  /* the data is bad (either a PLC call
533  * was made or a severe bit error was detected)
534  */
535 
536  /* packet loss conceal */
537 
538  memset(zeros, 0, BLOCKL_MAX*sizeof(float));
539 
540  one[0] = 1;
541  memset(one+1, 0, LPC_FILTERORDER*sizeof(float));
542 
543  start=0;
544 
545  doThePLC(PLCresidual, PLClpc, 1, zeros, one,
546  (*iLBCdec_inst).last_lag, iLBCdec_inst);
547  memcpy(decresidual, PLCresidual,
548  iLBCdec_inst->blockl*sizeof(float));
549 
550  order_plus_one = LPC_FILTERORDER + 1;
551  for (i = 0; i < iLBCdec_inst->nsub; i++) {
552  memcpy(syntdenum+(i*order_plus_one), PLClpc,
553  order_plus_one*sizeof(float));
554  }
555  }
556 
557  if (iLBCdec_inst->use_enhancer == 1) {
558 
559  /* post filtering */
560 
561  iLBCdec_inst->last_lag =
562  enhancerInterface(data, decresidual, iLBCdec_inst);
563 
564  /* synthesis filtering */
565 
566  if (iLBCdec_inst->mode==20) {
567  /* Enhancer has 40 samples delay */
568  i=0;
569  syntFilter(data + i*SUBL,
570  iLBCdec_inst->old_syntdenum +
571  (i+iLBCdec_inst->nsub-1)*(LPC_FILTERORDER+1),
572  SUBL, iLBCdec_inst->syntMem);
573 
574 
575 
576 
577 
578  for (i=1; i < iLBCdec_inst->nsub; i++) {
579  syntFilter(data + i*SUBL,
580  syntdenum + (i-1)*(LPC_FILTERORDER+1),
581  SUBL, iLBCdec_inst->syntMem);
582  }
583  } else if (iLBCdec_inst->mode==30) {
584  /* Enhancer has 80 samples delay */
585  for (i=0; i < 2; i++) {
586  syntFilter(data + i*SUBL,
587  iLBCdec_inst->old_syntdenum +
588  (i+iLBCdec_inst->nsub-2)*(LPC_FILTERORDER+1),
589  SUBL, iLBCdec_inst->syntMem);
590  }
591  for (i=2; i < iLBCdec_inst->nsub; i++) {
592  syntFilter(data + i*SUBL,
593  syntdenum + (i-2)*(LPC_FILTERORDER+1), SUBL,
594  iLBCdec_inst->syntMem);
595  }
596  }
597 
598  } else {
599 
600  /* Find last lag */
601  lag = 20;
602  maxcc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL],
603  &decresidual[BLOCKL_MAX-ENH_BLOCKL-lag], ENH_BLOCKL);
604 
605  for (ilag=21; ilag<120; ilag++) {
606  cc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL],
607  &decresidual[BLOCKL_MAX-ENH_BLOCKL-ilag],
608  ENH_BLOCKL);
609 
610  if (cc > maxcc) {
611  maxcc = cc;
612  lag = ilag;
613  }
614  }
615  iLBCdec_inst->last_lag = lag;
616 
617  /* copy data and run synthesis filter */
618 
619  memcpy(data, decresidual,
620  iLBCdec_inst->blockl*sizeof(float));
621  for (i=0; i < iLBCdec_inst->nsub; i++) {
622  syntFilter(data + i*SUBL,
623  syntdenum + i*(LPC_FILTERORDER+1), SUBL,
624  iLBCdec_inst->syntMem);
625  }
626 
627 
628 
629 
630 
631  }
632 
633  /* high pass filtering on output if desired, otherwise
634  copy to out */
635 
636  hpOutput(data, iLBCdec_inst->blockl,
637  decblock,iLBCdec_inst->hpomem);
638 
639  /* memcpy(decblock,data,iLBCdec_inst->blockl*sizeof(float));*/
640 
641  memcpy(iLBCdec_inst->old_syntdenum, syntdenum,
642 
643  iLBCdec_inst->nsub*(LPC_FILTERORDER+1)*sizeof(float));
644 
645  iLBCdec_inst->prev_enh_pl=0;
646 
647  if (mode==0) { /* PLC was used */
648  iLBCdec_inst->prev_enh_pl=1;
649  }
650  }
void unpack(unsigned char **bitstream, int *index, int bitno, int *pos)
Definition: packing.c:126
float enh_buf[ENH_BUFL]
Definition: iLBC_define.h:210
const iLBC_ULP_Inst_t ULP_20msTbl
Definition: constants.c:19
#define LPC_N_MAX
Definition: iLBC_define.h:46
#define LSF_NSPLIT
Definition: iLBC_define.h:50
#define CB_MEML
Definition: iLBC_define.h:58
#define ENH_NBLOCKS_TOT
Definition: iLBC_define.h:87
#define CB_NSTAGES
Definition: iLBC_define.h:56
float prevResidual[NSUB_MAX *SUBL]
Definition: iLBC_define.h:198
int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2]
Definition: iLBC_define.h:125
#define STATE_SHORT_LEN_20MS
Definition: iLBC_define.h:36
#define NSUB_30MS
Definition: iLBC_define.h:23
#define BLOCKL_MAX
Definition: iLBC_define.h:21
void iLBC_decode(float *decblock, unsigned char *bytes, iLBC_Dec_Inst_t *iLBCdec_inst, int mode)
Definition: iLBC_decode.c:326
#define LPC_N_30MS
Definition: iLBC_define.h:45
#define STATE_SHORT_LEN_30MS
Definition: iLBC_define.h:35
#define STATE_LEN
Definition: iLBC_define.h:34
void syntFilter(float *Out, float *a, int len, float *mem)
Definition: syntFilter.c:19
#define NO_OF_BYTES_20MS
Definition: iLBC_define.h:100
#define LPC_N_20MS
Definition: iLBC_define.h:44
float lsfmeanTbl[LPC_FILTERORDER]
Definition: constants.c:210
void iCBConstruct(float *decvector, int *index, int *gain_index, float *mem, int lMem, int veclen, int nStages)
Definition: iCBConstruct.c:66
const iLBC_ULP_Inst_t * ULP_inst
Definition: iLBC_define.h:179
#define NASUB_20MS
Definition: iLBC_define.h:25
int LSF_check(float *lsf, int dim, int NoAn)
Definition: helpfun.c:272
int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]
Definition: iLBC_define.h:127
#define NO_OF_WORDS_20MS
Definition: iLBC_define.h:102
const iLBC_ULP_Inst_t ULP_30msTbl
Definition: constants.c:44
short initDecode(iLBC_Dec_Inst_t *iLBCdec_inst, int mode, int use_enhancer)
Definition: iLBC_decode.c:33
#define ENH_BUFL
Definition: iLBC_define.h:89
#define SUBL
Definition: iLBC_define.h:33
void StateConstructW(int idxForMax, int *idxVec, float *syntDenum, float *out, int len)
#define NO_OF_WORDS_30MS
Definition: iLBC_define.h:103
#define NSUB_20MS
Definition: iLBC_define.h:22
void SimplelsfDEQ(float *lsfdeq, int *index, int lpc_n)
Definition: LPCdecode.c:42
float xCorrCoef(float *target, float *regressor, int subl)
Definition: enhancer.c:485
#define LPC_FILTERORDER
Definition: iLBC_define.h:40
unsigned long seed
Definition: iLBC_define.h:200
#define BLOCKL_20MS
Definition: iLBC_define.h:19
int lsf_bits[6][ULP_CLASSES+2]
Definition: iLBC_define.h:120
float enh_period[ENH_NBLOCKS_TOT]
Definition: iLBC_define.h:211
int scale_bits[ULP_CLASSES+2]
Definition: iLBC_define.h:123
int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]
Definition: iLBC_define.h:128
int state_bits[ULP_CLASSES+2]
Definition: iLBC_define.h:124
void doThePLC(float *PLCresidual, float *PLClpc, int PLI, float *decresidual, float *lpc, int inlag, iLBC_Dec_Inst_t *iLBCdec_inst)
Definition: doCPLC.c:79
#define NASUB_30MS
Definition: iLBC_define.h:31
void packcombine(int *index, int rest, int bitno_rest)
Definition: packing.c:53
int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2]
Definition: iLBC_define.h:126
void index_conv_dec(int *index)
Definition: iCBConstruct.c:45
#define NSUB_MAX
Definition: iLBC_define.h:24
int enhancerInterface(float *out, float *in, iLBC_Dec_Inst_t *iLBCdec_inst)
Definition: enhancer.c:517
float old_syntdenum[(LPC_FILTERORDER+1) *NSUB_MAX]
Definition: iLBC_define.h:203
void DecoderInterpolateLSF(float *syntdenum, float *weightdenum, float *lsfdeq, int length, iLBC_Dec_Inst_t *iLBCdec_inst)
Definition: LPCdecode.c:89
#define BLOCKL_30MS
Definition: iLBC_define.h:20
int memLfTbl[NASUB_MAX]
Definition: constants.c:138
float syntMem[LPC_FILTERORDER]
Definition: iLBC_define.h:182
int startfirst_bits[ULP_CLASSES+2]
Definition: iLBC_define.h:122
void hpOutput(float *In, int len, float *Out, float *mem)
Definition: hpOutput.c:19
#define NO_OF_BYTES_30MS
Definition: iLBC_define.h:101
#define NASUB_MAX
Definition: iLBC_define.h:32
float prevLpc[LPC_FILTERORDER+1]
Definition: iLBC_define.h:197
void Decode(iLBC_Dec_Inst_t *iLBCdec_inst, float *decresidual, int start, int idxForMax, int *idxVec, float *syntdenum, int *cb_index, int *gain_index, int *extra_cb_index, int *extra_gain_index, int state_first)
Definition: iLBC_decode.c:118
int stMemLTbl
Definition: constants.c:137
#define ENH_BLOCKL
Definition: iLBC_define.h:66
int start_bits[ULP_CLASSES+2]
Definition: iLBC_define.h:121