helpfun.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /******************************************************************
  2. iLBC Speech Coder ANSI-C Source Code
  3. helpfun.h
  4. Copyright (C) The Internet Society (2004).
  5. All Rights Reserved.
  6. ******************************************************************/
  7. #ifndef __iLBC_HELPFUN_H
  8. #define __iLBC_HELPFUN_H
  9. void autocorr(
  10. float *r, /* (o) autocorrelation vector */
  11. const float *x, /* (i) data vector */
  12. int N, /* (i) length of data vector */
  13. int order /* largest lag for calculated
  14. autocorrelations */
  15. );
  16. void window(
  17. float *z, /* (o) the windowed data */
  18. const float *x, /* (i) the original data vector */
  19. const float *y, /* (i) the window */
  20. int N /* (i) length of all vectors */
  21. );
  22. void levdurb(
  23. float *a, /* (o) lpc coefficient vector starting
  24. with 1.0 */
  25. float *k, /* (o) reflection coefficients */
  26. float *r, /* (i) autocorrelation vector */
  27. int order /* (i) order of lpc filter */
  28. );
  29. void interpolate(
  30. float *out, /* (o) the interpolated vector */
  31. float *in1, /* (i) the first vector for the
  32. interpolation */
  33. float *in2, /* (i) the second vector for the
  34. interpolation */
  35. float coef, /* (i) interpolation weights */
  36. int length /* (i) length of all vectors */
  37. );
  38. void bwexpand(
  39. float *out, /* (o) the bandwidth expanded lpc
  40. coefficients */
  41. float *in, /* (i) the lpc coefficients before bandwidth
  42. expansion */
  43. float coef, /* (i) the bandwidth expansion factor */
  44. int length /* (i) the length of lpc coefficient vectors */
  45. );
  46. void vq(
  47. float *Xq, /* (o) the quantized vector */
  48. int *index, /* (o) the quantization index */
  49. const float *CB,/* (i) the vector quantization codebook */
  50. float *X, /* (i) the vector to quantize */
  51. int n_cb, /* (i) the number of vectors in the codebook */
  52. int dim /* (i) the dimension of all vectors */
  53. );
  54. void SplitVQ(
  55. float *qX, /* (o) the quantized vector */
  56. int *index, /* (o) a vector of indexes for all vector
  57. codebooks in the split */
  58. float *X, /* (i) the vector to quantize */
  59. const float *CB,/* (i) the quantizer codebook */
  60. int nsplit, /* the number of vector splits */
  61. const int *dim, /* the dimension of X and qX */
  62. const int *cbsize /* the number of vectors in the codebook */
  63. );
  64. void sort_sq(
  65. float *xq, /* (o) the quantized value */
  66. int *index, /* (o) the quantization index */
  67. float x, /* (i) the value to quantize */
  68. const float *cb,/* (i) the quantization codebook */
  69. int cb_size /* (i) the size of the quantization codebook */
  70. );
  71. int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
  72. nonstable ones */
  73. float *lsf, /* (i) a table of lsf vectors */
  74. int dim, /* (i) the dimension of each lsf vector */
  75. int NoAn /* (i) the number of lsf vectors in the
  76. table */
  77. );
  78. #endif