p_ol_wgh.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 : p_ol_wgh.h
  11. * Purpose : Compute the open loop pitch lag with weighting.
  12. *
  13. ********************************************************************************
  14. */
  15. #ifndef p_ol_wgh_h
  16. #define p_ol_wgh_h "$Id $"
  17. /*
  18. ********************************************************************************
  19. * INCLUDE FILES
  20. ********************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "mode.h"
  24. #include "vad.h"
  25. /*
  26. ********************************************************************************
  27. * DEFINITION OF DATA TYPES
  28. ********************************************************************************
  29. */
  30. /* state variable */
  31. typedef struct {
  32. Word16 old_T0_med;
  33. Word16 ada_w;
  34. Word16 wght_flg;
  35. } pitchOLWghtState;
  36. /*
  37. ********************************************************************************
  38. * DECLARATION OF PROTOTYPES
  39. ********************************************************************************
  40. */
  41. int p_ol_wgh_init (pitchOLWghtState **st);
  42. /* initialize one instance of the pre processing state.
  43. Stores pointer to filter status struct in *st. This pointer has to
  44. be passed to p_ol_wgh in each call.
  45. returns 0 on success
  46. */
  47. int p_ol_wgh_reset (pitchOLWghtState *st);
  48. /* reset of pre processing state (i.e. set state memory to zero)
  49. returns 0 on success
  50. */
  51. void p_ol_wgh_exit (pitchOLWghtState **st);
  52. /* de-initialize pre processing state (i.e. free status struct)
  53. stores NULL in *st
  54. */
  55. Word16 Pitch_ol_wgh ( /* o : open loop pitch lag */
  56. pitchOLWghtState *st, /* i/o : State struct */
  57. vadState *vadSt, /* i/o : VAD state struct */
  58. Word16 signal[], /* i : signal used to compute the open loop pitch */
  59. /* signal[-pit_max] to signal[-1] should be known */
  60. Word16 pit_min, /* i : minimum pitch lag */
  61. Word16 pit_max, /* i : maximum pitch lag */
  62. Word16 L_frame, /* i : length of frame to compute pitch */
  63. Word16 old_lags[], /* i : history with old stored Cl lags */
  64. Word16 ol_gain_flg[], /* i : OL gain flag */
  65. Word16 idx, /* i : index */
  66. Flag dtx /* i : dtx flag; use dtx=1, do not use dtx=0 */
  67. );
  68. #endif