lsp.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. ********************************************************************************
  3. *
  4. * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
  5. * R99 Version 3.3.0
  6. * REL-4 Version 4.1.0
  7. *
  8. ********************************************************************************
  9. *
  10. * File : lsp.h
  11. * Purpose : Conversion from A(z) to LSP. Quantization and
  12. * interpolation of LSPs.
  13. *
  14. ********************************************************************************
  15. */
  16. #ifndef lsp_h
  17. #define lsp_h "$Id $"
  18. /*
  19. ********************************************************************************
  20. * INCLUDE FILES
  21. ********************************************************************************
  22. */
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25. #include "typedef.h"
  26. #include "q_plsf.h"
  27. #include "mode.h"
  28. /*
  29. ********************************************************************************
  30. * LOCAL VARIABLES AND TABLES
  31. ********************************************************************************
  32. */
  33. /*
  34. ********************************************************************************
  35. * DEFINITION OF DATA TYPES
  36. ********************************************************************************
  37. */
  38. typedef struct {
  39. /* Past LSPs */
  40. Word16 lsp_old[M];
  41. Word16 lsp_old_q[M];
  42. /* Quantization state */
  43. Q_plsfState *qSt;
  44. } lspState;
  45. /*
  46. ********************************************************************************
  47. * DECLARATION OF PROTOTYPES
  48. ********************************************************************************
  49. */
  50. /*
  51. **************************************************************************
  52. *
  53. * Function : lsp_init
  54. * Purpose : Allocates memory and initializes state variables
  55. * Description : Stores pointer to filter status struct in *st. This
  56. * pointer has to be passed to lsp in each call.
  57. * Returns : 0 on success
  58. *
  59. **************************************************************************
  60. */
  61. int lsp_init (lspState **st);
  62. /*
  63. **************************************************************************
  64. *
  65. * Function : lsp_reset
  66. * Purpose : Resets state memory
  67. * Returns : 0 on success
  68. *
  69. **************************************************************************
  70. */
  71. int lsp_reset (lspState *st);
  72. /*
  73. **************************************************************************
  74. *
  75. * Function : lsp_exit
  76. * Purpose : The memory used for state memory is freed
  77. * Description : Stores NULL in *st
  78. *
  79. **************************************************************************
  80. */
  81. void lsp_exit (lspState **st);
  82. /*
  83. **************************************************************************
  84. *
  85. * Function : lsp
  86. * Purpose : Conversion from LP coefficients to LSPs.
  87. * Quantization of LSPs.
  88. * Description : Generates 2 sets of LSPs from 2 sets of
  89. * LP coefficients for mode 12.2. For the other
  90. * modes 1 set of LSPs is generated from 1 set of
  91. * LP coefficients. These LSPs are quantized with
  92. * Matrix/Vector quantization (depending on the mode)
  93. * and interpolated for the subframes not yet having
  94. * their own LSPs.
  95. *
  96. **************************************************************************
  97. */
  98. int lsp(lspState *st, /* i/o : State struct */
  99. enum Mode req_mode, /* i : requested coder mode */
  100. enum Mode used_mode, /* i : used coder mode */
  101. Word16 az[], /* i/o : interpolated LP parameters Q12 */
  102. Word16 azQ[], /* o : quantization interpol. LP parameters Q12*/
  103. Word16 lsp_new[], /* o : new lsp vector */
  104. Word16 **anap /* o : analysis parameters */
  105. );
  106. #endif