qgain795.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 : qgain795.h
  11. * Purpose : (pre-) quantization of pitch gain for MR795
  12. *
  13. ********************************************************************************
  14. */
  15. #ifndef qgain795_h
  16. #define qgain795_h "$Id $"
  17. /*
  18. ********************************************************************************
  19. * INCLUDE FILES
  20. ********************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "g_adapt.h"
  24. /*
  25. ********************************************************************************
  26. * DECLARATION OF PROTOTYPES
  27. ********************************************************************************
  28. */
  29. /*************************************************************************
  30. *
  31. * FUNCTION: MR795_gain_quant
  32. *
  33. * PURPOSE: pitch and codebook quantization for MR795
  34. *
  35. *************************************************************************/
  36. void
  37. MR795_gain_quant(
  38. GainAdaptState *adapt_st, /* i/o: gain adapter state structure */
  39. Word16 res[], /* i : LP residual, Q0 */
  40. Word16 exc[], /* i : LTP excitation (unfiltered), Q0 */
  41. Word16 code[], /* i : CB innovation (unfiltered), Q13 */
  42. Word16 frac_coeff[], /* i : coefficients (5), Q15 */
  43. Word16 exp_coeff[], /* i : energy coefficients (5), Q0 */
  44. /* coefficients from calc_filt_ener() */
  45. Word16 exp_code_en, /* i : innovation energy (exponent), Q0 */
  46. Word16 frac_code_en, /* i : innovation energy (fraction), Q15 */
  47. Word16 exp_gcode0, /* i : predicted CB gain (exponent), Q0 */
  48. Word16 frac_gcode0, /* i : predicted CB gain (fraction), Q15 */
  49. Word16 L_subfr, /* i : Subframe length */
  50. Word16 cod_gain_frac, /* i : opt. codebook gain (fraction),Q15 */
  51. Word16 cod_gain_exp, /* i : opt. codebook gain (exponent), Q0 */
  52. Word16 gp_limit, /* i : pitch gain limit */
  53. Word16 *gain_pit, /* i/o: Pitch gain (unquant/quant), Q14 */
  54. Word16 *gain_cod, /* o : Code gain, Q1 */
  55. Word16 *qua_ener_MR122, /* o : quantized energy error, Q10 */
  56. /* (for MR122 MA predictor update) */
  57. Word16 *qua_ener, /* o : quantized energy error, Q10 */
  58. /* (for other MA predictor update) */
  59. Word16 **anap /* o : Index of quantization */
  60. /* (first gain pitch, then code pitch)*/
  61. );
  62. #endif