ton_stab.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 : ton_stab.h
  11. * Purpose : Tone stabilization routines
  12. *
  13. ********************************************************************************
  14. */
  15. #ifndef ton_stab_h
  16. #define ton_stab_h "$Id $"
  17. /*
  18. ********************************************************************************
  19. * INCLUDE FILES
  20. ********************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "mode.h"
  24. #include "cnst.h"
  25. /*
  26. ********************************************************************************
  27. * LOCAL VARIABLES AND TABLES
  28. ********************************************************************************
  29. */
  30. /*
  31. ********************************************************************************
  32. * DEFINITION OF DATA TYPES
  33. ********************************************************************************
  34. */
  35. /* state variable */
  36. typedef struct {
  37. /* counters */
  38. Word16 count;
  39. /* gain history Q11 */
  40. Word16 gp[N_FRAME];
  41. } tonStabState;
  42. /*
  43. ********************************************************************************
  44. * DECLARATION OF PROTOTYPES
  45. ********************************************************************************
  46. */
  47. int ton_stab_init (tonStabState **st);
  48. /* initialize one instance of the pre processing state.
  49. Stores pointer to filter status struct in *st. This pointer has to
  50. be passed to ton_stab in each call.
  51. returns 0 on success
  52. */
  53. int ton_stab_reset (tonStabState *st);
  54. /* reset of pre processing state (i.e. set state memory to zero)
  55. returns 0 on success
  56. */
  57. void ton_stab_exit (tonStabState **st);
  58. /* de-initialize pre processing state (i.e. free status struct)
  59. stores NULL in *st
  60. */
  61. Word16 check_lsp(tonStabState *st, /* i/o : State struct */
  62. Word16 *lsp /* i : unquantized LSP's */
  63. );
  64. Word16 check_gp_clipping(tonStabState *st, /* i/o : State struct */
  65. Word16 g_pitch /* i : pitch gain */
  66. );
  67. void update_gp_clipping(tonStabState *st, /* i/o : State struct */
  68. Word16 g_pitch /* i : pitch gain */
  69. );
  70. #endif