mac_32.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 : mac_32.h
  11. * Purpose : 32 x 32 and 32 x 16 bit DPF multiy & accumulate
  12. * (similar as Mpy_32 and Mpy_32_16 in oper_32b.c)
  13. *
  14. ********************************************************************************
  15. */
  16. /*
  17. ********************************************************************************
  18. * MODULE INCLUDE FILE AND VERSION ID
  19. ********************************************************************************
  20. */
  21. #ifndef mac_32_h
  22. #define mac_32_h "$Id $"
  23. /*
  24. ********************************************************************************
  25. * INCLUDE FILES
  26. ********************************************************************************
  27. */
  28. #include "typedef.h"
  29. #include "basic_op.h"
  30. #include "oper_32b.h"
  31. #include "count.h"
  32. /*
  33. ********************************************************************************
  34. * PUBLIC PROGRAM CODE
  35. ********************************************************************************
  36. */
  37. /*****************************************************************************
  38. * Function Mac_32() *
  39. * *
  40. * Multiply two 32 bit integers (DPF) and accumulate with (normal) 32 bit *
  41. * integer. The multiplication result is divided by 2**31 *
  42. * *
  43. * L_32 = L_32 + (hi1*hi2)<<1 + ( (hi1*lo2)>>15 + (lo1*hi2)>>15 )<<1 *
  44. * *
  45. * This operation can also be viewed as the multiplication of two Q31 *
  46. * number and the result is also in Q31. *
  47. * *
  48. * Arguments: *
  49. * *
  50. * hi1 hi part of first number *
  51. * lo1 lo part of first number *
  52. * hi2 hi part of second number *
  53. * lo2 lo part of second number *
  54. * *
  55. *****************************************************************************
  56. */
  57. Word32 Mac_32 (Word32 L_32, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2);
  58. /*****************************************************************************
  59. * Function Mac_32_16() *
  60. * *
  61. * Multiply a 16 bit integer by a 32 bit (DPF) and accumulate with (normal)*
  62. * 32 bit integer. The multiplication result is divided by 2**15 *
  63. * *
  64. * *
  65. * L_32 = L_32 + (hi1*lo2)<<1 + ((lo1*lo2)>>15)<<1 *
  66. * *
  67. * Arguments: *
  68. * *
  69. * hi hi part of 32 bit number. *
  70. * lo lo part of 32 bit number. *
  71. * n 16 bit number. *
  72. * *
  73. *****************************************************************************
  74. */
  75. Word32 Mac_32_16 (Word32 L_32, Word16 hi, Word16 lo, Word16 n);
  76. #endif