pitch_fr.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 : pitch_fr.h
  11. * Purpose : Find the pitch period with 1/3 or 1/6 subsample
  12. * : resolution (closed loop).
  13. *
  14. ********************************************************************************
  15. */
  16. #ifndef pitch_fr_h
  17. #define pitch_fr_h "$Id $"
  18. /*
  19. ********************************************************************************
  20. * INCLUDE FILES
  21. ********************************************************************************
  22. */
  23. #include "typedef.h"
  24. #include "mode.h"
  25. /*
  26. ********************************************************************************
  27. * DEFINITION OF DATA TYPES
  28. ********************************************************************************
  29. */
  30. typedef struct {
  31. Word16 T0_prev_subframe; /* integer pitch lag of previous sub_ex-frame */
  32. } Pitch_frState;
  33. /*
  34. ********************************************************************************
  35. * DECLARATION OF PROTOTYPES
  36. ********************************************************************************
  37. */
  38. int Pitch_fr_init (Pitch_frState **st);
  39. /* initialize one instance of the pre processing state.
  40. Stores pointer to filter status struct in *st. This pointer has to
  41. be passed to Pitch_fr in each call.
  42. returns 0 on success
  43. */
  44. int Pitch_fr_reset (Pitch_frState *st);
  45. /* reset of pre processing state (i.e. set state memory to zero)
  46. returns 0 on success
  47. */
  48. void Pitch_fr_exit (Pitch_frState **st);
  49. /* de-initialize pre processing state (i.e. free status struct)
  50. stores NULL in *st
  51. */
  52. Word16 Pitch_fr ( /* o : pitch period (integer) */
  53. Pitch_frState *st, /* i/o : State struct */
  54. enum Mode mode, /* i : codec mode */
  55. Word16 T_op[], /* i : open loop pitch lags */
  56. Word16 exc[], /* i : excitation buffer */
  57. Word16 xn[], /* i : target vector */
  58. Word16 h[], /* i : impulse response of synthesis and
  59. weighting filters */
  60. Word16 L_subfr, /* i : Length of subframe */
  61. Word16 i_subfr, /* i : subframe offset */
  62. Word16 *pit_frac, /* o : pitch period (fractional) */
  63. Word16 *resu3, /* o : subsample resolution 1/3 (=1) or 1/6 (=0) */
  64. Word16 *ana_index /* o : index of encoding */
  65. );
  66. #endif