q_plsf.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 : q_plsf.h
  11. * Purpose : common include file for LSF vector/matrix quanti-
  12. * sation modules (q_plsf_3.c/q_plsf_5.c)
  13. *
  14. ********************************************************************************
  15. */
  16. #ifndef q_plsf_h
  17. #define q_plsf_h "$Id $"
  18. /*
  19. ********************************************************************************
  20. * INCLUDE FILES
  21. ********************************************************************************
  22. */
  23. #include "typedef.h"
  24. #include "cnst.h"
  25. #include "mode.h"
  26. /*
  27. ********************************************************************************
  28. * DEFINITION OF DATA TYPES
  29. ********************************************************************************
  30. */
  31. typedef struct {
  32. Word16 past_rq[M]; /* Past quantized prediction error, Q15 */
  33. } Q_plsfState;
  34. /*
  35. ********************************************************************************
  36. * DECLARATION OF PROTOTYPES
  37. ********************************************************************************
  38. */
  39. int Q_plsf_init (Q_plsfState **st);
  40. /* initialize one instance of the state.
  41. Stores pointer to filter status struct in *st. This pointer has to
  42. be passed to Q_plsf_5 / Q_plsf_3 in each call.
  43. returns 0 on success
  44. */
  45. int Q_plsf_reset (Q_plsfState *st);
  46. /* reset of state (i.e. set state memory to zero)
  47. returns 0 on success
  48. */
  49. void Q_plsf_exit (Q_plsfState **st);
  50. /* de-initialize state (i.e. free status struct)
  51. stores NULL in *st
  52. */
  53. void Q_plsf_3(
  54. Q_plsfState *st, /* i/o: state struct */
  55. enum Mode mode, /* i : coder mode */
  56. Word16 *lsp1, /* i : 1st LSP vector Q15 */
  57. Word16 *lsp1_q, /* o : quantized 1st LSP vector Q15 */
  58. Word16 *indice, /* o : quantization indices of 3 vectors Q0 */
  59. Word16 *pred_init_i /* o : init index for MA prediction in DTX mode */
  60. );
  61. void Q_plsf_5 (
  62. Q_plsfState *st,
  63. Word16 *lsp1, /* i : 1st LSP vector, Q15 */
  64. Word16 *lsp2, /* i : 2nd LSP vector, Q15 */
  65. Word16 *lsp1_q, /* o : quantized 1st LSP vector, Q15 */
  66. Word16 *lsp2_q, /* o : quantized 2nd LSP vector, Q15 */
  67. Word16 *indice /* o : quantization indices of 5 matrices, Q0 */
  68. );
  69. #endif