pstfilt.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 : pstfilt.h
  11. * Purpose : Performs adaptive postfiltering on the synthesis
  12. * : speech
  13. *
  14. ********************************************************************************
  15. */
  16. #ifndef pstfilt_h
  17. #define pstfilt_h "$Id $"
  18. /*
  19. ********************************************************************************
  20. * INCLUDE FILES
  21. ********************************************************************************
  22. */
  23. #include "typedef.h"
  24. #include "mode.h"
  25. #include "cnst.h"
  26. #include "preemph.h"
  27. #include "agc.h"
  28. /*
  29. ********************************************************************************
  30. * DEFINITION OF DATA TYPES
  31. ********************************************************************************
  32. */
  33. typedef struct{
  34. Word16 res2[L_SUBFR];
  35. Word16 mem_syn_pst[M];
  36. preemphasisState* preemph_state;
  37. agcState* agc_state;
  38. Word16 synth_buf[M + L_FRAME];
  39. } Post_FilterState;
  40. /*
  41. ********************************************************************************
  42. * DECLARATION OF PROTOTYPES
  43. ********************************************************************************
  44. */
  45. int Post_Filter_init (Post_FilterState **st);
  46. /* initialize one instance of the post filter
  47. Stores pointer to filter status struct in *st. This pointer has to
  48. be passed to Post_Filter in each call.
  49. returns 0 on success
  50. */
  51. int Post_Filter_reset (Post_FilterState *st);
  52. /* reset post filter (i.e. set state memory to zero)
  53. returns 0 on success
  54. */
  55. void Post_Filter_exit (Post_FilterState **st);
  56. /* de-initialize post filter (i.e. free status struct)
  57. stores NULL in *s
  58. */
  59. int Post_Filter (
  60. Post_FilterState *st, /* i/o : post filter states */
  61. enum Mode mode, /* i : AMR mode */
  62. Word16 *syn, /* i/o : synthesis speech (postfiltered is output) */
  63. Word16 *Az_4 /* i : interpolated LPC parameters in all subfr. */
  64. );
  65. /* filters the signal syn using the parameters in Az_4 to calculate filter
  66. coefficients.
  67. The filter must be set up using Post_Filter_init prior to the first call
  68. to Post_Filter. Post_FilterState is updated to mirror the current state
  69. of the filter
  70. return 0 on success
  71. */
  72. #endif