sid_sync.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 : sid_sync.h
  11. * Purpose : To ensure that the mode only switches to a
  12. * neighbouring mode
  13. *
  14. *****************************************************************************
  15. */
  16. #ifndef sid_sync_h
  17. #define sid_sync_h "$Id $"
  18. /*
  19. *****************************************************************************
  20. * INCLUDE FILES
  21. *****************************************************************************
  22. */
  23. #include "typedef.h"
  24. #include "mode.h"
  25. #include "frame.h"
  26. /*
  27. ******************************************************************************
  28. * CONSTANTS
  29. ******************************************************************************
  30. */
  31. /*
  32. ******************************************************************************
  33. * DEFINITION OF DATA TYPES
  34. ******************************************************************************
  35. */
  36. typedef struct {
  37. Word16 sid_update_rate; /* Send SID Update every sid_update_rate frame */
  38. Word16 sid_update_counter; /* Number of frames since last SID */
  39. Word16 sid_handover_debt; /* Number of extra SID_UPD frames to schedule*/
  40. enum TXFrameType prev_ft;
  41. } sid_syncState;
  42. /*
  43. *****************************************************************************
  44. * LOCAL VARIABLES AND TABLES
  45. *****************************************************************************
  46. */
  47. /*
  48. *****************************************************************************
  49. * DECLARATION OF PROTOTYPES
  50. *****************************************************************************
  51. */
  52. int sid_sync_init (sid_syncState **st);
  53. /* initialize one instance of the sid_sync module
  54. Stores pointer to state struct in *st. This pointer has to
  55. be passed to sid_sync in each call.
  56. returns 0 on success
  57. */
  58. int sid_sync_reset (sid_syncState *st);
  59. /* reset of sid_sync module (i.e. set state memory to zero)
  60. returns 0 on success
  61. */
  62. void sid_sync_exit (sid_syncState **st);
  63. /* de-initialize sid_sync module (i.e. free status struct)
  64. stores NULL in *st
  65. */
  66. int sid_sync_set_handover_debt (sid_syncState *st, /* i/o: sid_sync state */
  67. Word16 debtFrames);
  68. /* update handover debt
  69. debtFrames extra SID_UPD are scheduled .
  70. to update remote decoder CNI states, right after an handover.
  71. (primarily for use on MS UL side )
  72. */
  73. void sid_sync(sid_syncState *st , /* i/o: sid_sync state */
  74. enum Mode mode,
  75. enum TXFrameType *tx_frame_type);
  76. #endif