qua_gain.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 : qua_gain.h
  11. * Purpose : Quantization of pitch and codebook gains.
  12. *
  13. ********************************************************************************
  14. */
  15. #ifndef qua_gain_h
  16. #define qua_gain_h "$Id $"
  17. /*
  18. ********************************************************************************
  19. * INCLUDE FILES
  20. ********************************************************************************
  21. */
  22. #include "typedef.h"
  23. #include "gc_pred.h"
  24. #include "mode.h"
  25. /*
  26. ********************************************************************************
  27. * DECLARATION OF PROTOTYPES
  28. ********************************************************************************
  29. */
  30. /*************************************************************************
  31. *
  32. * FUNCTION: Qua_gain()
  33. *
  34. * PURPOSE: Quantization of pitch and codebook gains.
  35. * (using predicted codebook gain)
  36. *
  37. *************************************************************************/
  38. Word16
  39. Qua_gain( /* o : index of quantization. */
  40. enum Mode mode, /* i : AMR mode */
  41. Word16 exp_gcode0, /* i : predicted CB gain (exponent), Q0 */
  42. Word16 frac_gcode0, /* i : predicted CB gain (fraction), Q15 */
  43. Word16 frac_coeff[], /* i : energy coeff. (5), fraction part, Q15 */
  44. Word16 exp_coeff[], /* i : energy coeff. (5), exponent part, Q0 */
  45. /* (frac_coeff and exp_coeff computed in */
  46. /* calc_filt_energies()) */
  47. Word16 gp_limit, /* i : pitch gain limit */
  48. Word16 *gain_pit, /* o : Pitch gain, Q14 */
  49. Word16 *gain_cod, /* o : Code gain, Q1 */
  50. Word16 *qua_ener_MR122, /* o : quantized energy error, Q10 */
  51. /* (for MR122 MA predictor update) */
  52. Word16 *qua_ener /* o : quantized energy error, Q10 */
  53. /* (for other MA predictor update) */
  54. );
  55. #endif