c2_9pf.h 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 : c2_9pf.h
  11. * Purpose : Searches a 9 bit algebraic codebook containing
  12. * 2 pulses in a frame of 40 samples.
  13. *
  14. *****************************************************************************
  15. */
  16. #ifndef c2_9pf_h
  17. #define c2_9pf_h "$Id $"
  18. /*
  19. *****************************************************************************
  20. * INCLUDE FILES
  21. *****************************************************************************
  22. */
  23. #include "typedef.h"
  24. /*
  25. *****************************************************************************
  26. * LOCAL VARIABLES AND TABLES
  27. *****************************************************************************
  28. */
  29. /*
  30. *****************************************************************************
  31. * DEFINITION OF DATA TYPES
  32. *****************************************************************************
  33. */
  34. /*
  35. *****************************************************************************
  36. * DECLARATION OF PROTOTYPES
  37. *****************************************************************************
  38. */
  39. /*************************************************************************
  40. *
  41. * FUNCTION: code_2i40_9bits()
  42. *
  43. * PURPOSE: Searches a 9 bit algebraic codebook containing 2 pulses
  44. * in a frame of 40 samples.
  45. *
  46. * DESCRIPTION:
  47. * The code length is 40, containing 2 nonzero pulses: i0...i1.
  48. * All pulses can have two possible amplitudes: +1 or -1.
  49. * Pulse i0 can have 8 possible positions, pulse i1 can have
  50. * 8 positions. Also coded is which track pair should be used,
  51. * i.e. first or second pair. Where each pair contains 2 tracks.
  52. *
  53. * First subframe:
  54. * first i0 : 0, 5, 10, 15, 20, 25, 30, 35.
  55. * i1 : 2, 7, 12, 17, 22, 27, 32, 37.
  56. * second i0 : 1, 6, 11, 16, 21, 26, 31, 36.
  57. * i1 : 3, 8, 13, 18, 23, 28, 33, 38.
  58. *
  59. * Second subframe:
  60. * first i0 : 0, 5, 10, 15, 20, 25, 30, 35.
  61. * i1 : 3, 8, 13, 18, 23, 28, 33, 38.
  62. * second i0 : 2, 7, 12, 17, 22, 27, 32, 37.
  63. * i1 : 4, 9, 14, 19, 24, 29, 34, 39.
  64. *
  65. * Third subframe:
  66. * first i0 : 0, 5, 10, 15, 20, 25, 30, 35.
  67. * i1 : 2, 7, 12, 17, 22, 27, 32, 37.
  68. * second i0 : 1, 6, 11, 16, 21, 26, 31, 36.
  69. * i1 : 4, 9, 14, 19, 24, 29, 34, 39.
  70. *
  71. * Fourth subframe:
  72. * first i0 : 0, 5, 10, 15, 20, 25, 30, 35.
  73. * i1 : 3, 8, 13, 18, 23, 28, 33, 38.
  74. * second i0 : 1, 6, 11, 16, 21, 26, 31, 36.
  75. * i1 : 4, 9, 14, 19, 24, 29, 34, 39.
  76. *
  77. *************************************************************************/
  78. Word16 code_2i40_9bits(
  79. Word16 subNr, /* i : subframe number */
  80. Word16 x[], /* i : target vector */
  81. Word16 h[], /* i : impulse response of weighted synthesis filter */
  82. /* h[-L_subfr..-1] must be set to zero. */
  83. Word16 T0, /* i : Pitch lag */
  84. Word16 pitch_sharp, /* i : Last quantized pitch gain */
  85. Word16 code[], /* o : Innovative codebook */
  86. Word16 y[], /* o : filtered fixed codebook excitation */
  87. Word16 * sign /* o : Signs of 2 pulses */
  88. );
  89. #endif