SigProc_FIX_sse.h 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* Copyright (c) 2014, Cisco Systems, INC
  2. Written by XiangMingZhu WeiZhou MinPeng YanWang
  3. Redistribution and use in source and binary forms, with or without
  4. modification, are permitted provided that the following conditions
  5. are met:
  6. - Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. - Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  12. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  13. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  14. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  15. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  16. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  18. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  19. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  20. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  21. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. */
  23. #ifndef SIGPROC_FIX_SSE_H
  24. #define SIGPROC_FIX_SSE_H
  25. #ifdef HAVE_CONFIG_H
  26. #include "config.h"
  27. #endif
  28. #if defined(OPUS_X86_MAY_HAVE_SSE4_1)
  29. void silk_burg_modified_sse4_1(
  30. opus_int32 *res_nrg, /* O Residual energy */
  31. opus_int *res_nrg_Q, /* O Residual energy Q value */
  32. opus_int32 A_Q16[], /* O Prediction coefficients (length order) */
  33. const opus_int16 x[], /* I Input signal, length: nb_subfr * ( D + subfr_length ) */
  34. const opus_int32 minInvGain_Q30, /* I Inverse of max prediction gain */
  35. const opus_int subfr_length, /* I Input signal subframe length (incl. D preceding samples) */
  36. const opus_int nb_subfr, /* I Number of subframes stacked in x */
  37. const opus_int D, /* I Order */
  38. int arch /* I Run-time architecture */
  39. );
  40. #if defined(OPUS_X86_PRESUME_SSE4_1)
  41. #define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \
  42. ((void)(arch), silk_burg_modified_sse4_1(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch))
  43. #else
  44. extern void (*const SILK_BURG_MODIFIED_IMPL[OPUS_ARCHMASK + 1])(
  45. opus_int32 *res_nrg, /* O Residual energy */
  46. opus_int *res_nrg_Q, /* O Residual energy Q value */
  47. opus_int32 A_Q16[], /* O Prediction coefficients (length order) */
  48. const opus_int16 x[], /* I Input signal, length: nb_subfr * ( D + subfr_length ) */
  49. const opus_int32 minInvGain_Q30, /* I Inverse of max prediction gain */
  50. const opus_int subfr_length, /* I Input signal subframe length (incl. D preceding samples) */
  51. const opus_int nb_subfr, /* I Number of subframes stacked in x */
  52. const opus_int D, /* I Order */
  53. int arch /* I Run-time architecture */);
  54. # define silk_burg_modified(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch) \
  55. ((*SILK_BURG_MODIFIED_IMPL[(arch) & OPUS_ARCHMASK])(res_nrg, res_nrg_Q, A_Q16, x, minInvGain_Q30, subfr_length, nb_subfr, D, arch))
  56. #endif
  57. opus_int64 silk_inner_prod16_aligned_64_sse4_1(
  58. const opus_int16 *inVec1,
  59. const opus_int16 *inVec2,
  60. const opus_int len
  61. );
  62. #if defined(OPUS_X86_PRESUME_SSE4_1)
  63. #define silk_inner_prod16_aligned_64(inVec1, inVec2, len, arch) \
  64. ((void)(arch),silk_inner_prod16_aligned_64_sse4_1(inVec1, inVec2, len))
  65. #else
  66. extern opus_int64 (*const SILK_INNER_PROD16_ALIGNED_64_IMPL[OPUS_ARCHMASK + 1])(
  67. const opus_int16 *inVec1,
  68. const opus_int16 *inVec2,
  69. const opus_int len);
  70. # define silk_inner_prod16_aligned_64(inVec1, inVec2, len, arch) \
  71. ((*SILK_INNER_PROD16_ALIGNED_64_IMPL[(arch) & OPUS_ARCHMASK])(inVec1, inVec2, len))
  72. #endif
  73. #endif
  74. #endif