sp_enc.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_enc.h
  11. * Purpose : Encoding of one speech frame.
  12. *
  13. *****************************************************************************
  14. */
  15. #ifndef sp_enc_h
  16. #define sp_enc_h "$Id $"
  17. /*
  18. *****************************************************************************
  19. * INCLUDE FILES
  20. *****************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "cnst.h"
  24. #include "pre_proc.h"
  25. #include "mode.h"
  26. #include "cod_amr.h"
  27. /*
  28. *****************************************************************************
  29. * DEFINITION OF DATA TYPES
  30. *****************************************************************************
  31. */
  32. typedef struct{
  33. Pre_ProcessState *pre_state;
  34. cod_amrState *cod_amr_state;
  35. Flag dtx;
  36. int complexityCounter; /* Only for complexity computation */
  37. } Speech_Encode_FrameState;
  38. /*
  39. *****************************************************************************
  40. * ENCLARATION OF PROTOTYPES
  41. *****************************************************************************
  42. */
  43. int Speech_Encode_Frame_init (Speech_Encode_FrameState **st,
  44. Flag dtx,
  45. char *id);
  46. /* initialize one instance of the speech encoder
  47. Stores pointer to filter status struct in *st. This pointer has to
  48. be passed to Speech_Encode_Frame in each call.
  49. returns 0 on success
  50. */
  51. int Speech_Encode_Frame_reset (Speech_Encode_FrameState *st);
  52. /* reset speech encoder (i.e. set state memory to zero)
  53. returns 0 on success
  54. */
  55. void Speech_Encode_Frame_exit (Speech_Encode_FrameState **st);
  56. /* de-initialize speech encoder (i.e. free status struct)
  57. stores NULL in *s
  58. */
  59. int Speech_Encode_Frame_First (
  60. Speech_Encode_FrameState *st, /* i/o : post filter states */
  61. Word16 *new_speech); /* i : speech input */
  62. int Speech_Encode_Frame (
  63. Speech_Encode_FrameState *st, /* i/o : encoder states */
  64. enum Mode mode, /* i : speech coder mode */
  65. Word16 *new_speech, /* i : input speech */
  66. Word16 *serial, /* o : serial bit stream */
  67. enum Mode *usedMode /* o : used speech coder mode */
  68. );
  69. /* return 0 on success
  70. */
  71. #ifdef MMS_IO
  72. Word16 PackBits(
  73. enum Mode used_mode, /* i : actual AMR mode */
  74. enum Mode mode, /* i : requested AMR (speech) mode */
  75. enum TXFrameType fr_type, /* i : frame type */
  76. Word16 bits[], /* i : serial bits */
  77. UWord8 packed_bits[] /* o : sorted&packed bits */
  78. );
  79. #endif
  80. #endif