cl_ltp.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 : cl_ltp.h
  11. * Purpose : Closed-loop fractional pitch search
  12. *
  13. ********************************************************************************
  14. */
  15. #ifndef cl_ltp_h
  16. #define cl_ltp_h "$Id $"
  17. /*
  18. ********************************************************************************
  19. * INCLUDE FILES
  20. ********************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "mode.h"
  24. #include "pitch_fr.h"
  25. #include "ton_stab.h"
  26. /*
  27. ********************************************************************************
  28. * LOCAL VARIABLES AND TABLES
  29. ********************************************************************************
  30. */
  31. /*
  32. ********************************************************************************
  33. * DEFINITION OF DATA TYPES
  34. ********************************************************************************
  35. */
  36. /* state variable */
  37. typedef struct {
  38. Pitch_frState *pitchSt;
  39. } clLtpState;
  40. /*
  41. ********************************************************************************
  42. * DECLARATION OF PROTOTYPES
  43. ********************************************************************************
  44. */
  45. int cl_ltp_init (clLtpState **st);
  46. /* initialize one instance of the pre processing state.
  47. Stores pointer to filter status struct in *st. This pointer has to
  48. be passed to cl_ltp in each call.
  49. returns 0 on success
  50. */
  51. int cl_ltp_reset (clLtpState *st);
  52. /* reset of pre processing state (i.e. set state memory to zero)
  53. returns 0 on success
  54. */
  55. void cl_ltp_exit (clLtpState **st);
  56. /* de-initialize pre processing state (i.e. free status struct)
  57. stores NULL in *st
  58. */
  59. int cl_ltp(
  60. clLtpState *clSt, /* i/o : State struct */
  61. tonStabState *tonSt, /* i/o : State struct */
  62. enum Mode mode, /* i : coder mode */
  63. Word16 frameOffset, /* i : Offset to subframe */
  64. Word16 T_op[], /* i : Open loop pitch lags */
  65. Word16 *h1, /* i : Impulse response vector Q12 */
  66. Word16 *exc, /* i/o : Excitation vector Q0 */
  67. Word16 res2[], /* i/o : Long term prediction residual Q0 */
  68. Word16 xn[], /* i : Target vector for pitch search Q0 */
  69. Word16 lsp_flag, /* i : LSP resonance flag */
  70. Word16 xn2[], /* o : Target vector for codebook search Q0 */
  71. Word16 y1[], /* o : Filtered adaptive excitation Q0 */
  72. Word16 *T0, /* o : Pitch delay (integer part) */
  73. Word16 *T0_frac, /* o : Pitch delay (fractional part) */
  74. Word16 *gain_pit, /* o : Pitch gain Q14 */
  75. Word16 g_coeff[], /* o : Correlations between xn, y1, & y2 */
  76. Word16 **anap, /* o : Analysis parameters */
  77. Word16 *gp_limit /* o : pitch gain limit */
  78. );
  79. #endif