weight_a.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 : weight_a.c
  11. * Purpose : Spectral expansion of LP coefficients. (order==10)
  12. * Description : a_exp[i] = a[i] * fac[i-1] ,i=1,10
  13. *
  14. ********************************************************************************
  15. */
  16. /*
  17. ********************************************************************************
  18. * MODULE INCLUDE FILE AND VERSION ID
  19. ********************************************************************************
  20. */
  21. #include "weight_a.h"
  22. const char weight_a_id[] = "@(#)$Id $" weight_a_h;
  23. /*
  24. ********************************************************************************
  25. * INCLUDE FILES
  26. ********************************************************************************
  27. */
  28. #include "typedef.h"
  29. #include "basic_op.h"
  30. #include "count.h"
  31. #include "cnst.h"
  32. /*
  33. ********************************************************************************
  34. * LOCAL VARIABLES AND TABLES
  35. ********************************************************************************
  36. */
  37. /*
  38. *--------------------------------------*
  39. * Constants (defined in cnst.h *
  40. *--------------------------------------*
  41. * M : LPC order *
  42. *--------------------------------------*
  43. */
  44. /*
  45. ********************************************************************************
  46. * PUBLIC PROGRAM CODE
  47. ********************************************************************************
  48. */
  49. void Weight_Ai (
  50. Word16 a[], /* (i) : a[M+1] LPC coefficients (M=10) */
  51. const Word16 fac[], /* (i) : Spectral expansion factors. */
  52. Word16 a_exp[] /* (o) : Spectral expanded LPC coefficients */
  53. )
  54. {
  55. Word16 i;
  56. a_exp[0] = a[0]; move16 ();
  57. for (i = 1; i <= M; i++)
  58. {
  59. a_exp[i] = round_ex (L_mult_ex (a[i], fac[i - 1])); move16 ();
  60. }
  61. return;
  62. }