sp_dec.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 : sp_dec.h
  11. * Purpose : Decoding and post filtering of one speech frame.
  12. *
  13. *****************************************************************************
  14. */
  15. #ifndef sp_dec_h
  16. #define sp_dec_h "$Id $"
  17. /*
  18. *****************************************************************************
  19. * INCLUDE FILES
  20. *****************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "cnst.h"
  24. #include "dec_amr.h"
  25. #include "pstfilt.h"
  26. #include "post_pro.h"
  27. #include "mode.h"
  28. /*
  29. *****************************************************************************
  30. * DEFINITION OF DATA TYPES
  31. *****************************************************************************
  32. */
  33. typedef struct{
  34. Decoder_amrState* decoder_amrState;
  35. Post_FilterState* post_state;
  36. Post_ProcessState* postHP_state;
  37. enum Mode prev_mode;
  38. int complexityCounter; /* Only for complexity computation */
  39. } Speech_Decode_FrameState;
  40. /*
  41. *****************************************************************************
  42. * DECLARATION OF PROTOTYPES
  43. *****************************************************************************
  44. */
  45. int Speech_Decode_Frame_init (Speech_Decode_FrameState **st,
  46. char *id);
  47. /* initialize one instance of the speech decoder
  48. Stores pointer to filter status struct in *st. This pointer has to
  49. be passed to Speech_Decode_Frame in each call.
  50. returns 0 on success
  51. */
  52. int Speech_Decode_Frame_reset (Speech_Decode_FrameState *st);
  53. /* reset speech decoder (i.e. set state memory to zero)
  54. returns 0 on success
  55. */
  56. void Speech_Decode_Frame_exit (Speech_Decode_FrameState **st);
  57. /* de-initialize speech decoder (i.e. free status struct)
  58. stores NULL in *s
  59. */
  60. int Speech_Decode_Frame (
  61. Speech_Decode_FrameState *st, /* io: post filter states */
  62. enum Mode mode, /* i : AMR mode */
  63. Word16 *serial, /* i : serial bit stream */
  64. enum RXFrameType frame_type, /* i : Frame type */
  65. Word16 *synth /* o : synthesis speech (postfiltered */
  66. /* output) */
  67. );
  68. /* return 0 on success
  69. */
  70. #ifdef MMS_IO
  71. enum RXFrameType UnpackBits (
  72. Word8 q, /* i : Q-bit (i.e. BFI) */
  73. Word16 ft, /* i : frame type (i.e. mode) */
  74. UWord8 packed_bits[], /* i : sorted & packed bits */
  75. enum Mode *mode, /* o : mode information */
  76. Word16 bits[] /* o : serial bits */
  77. );
  78. #endif
  79. #endif