x86_celt_map.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. #if defined(HAVE_CONFIG_H)
  24. #include "config.h"
  25. #endif
  26. #include "x86/x86cpu.h"
  27. #include "celt_lpc.h"
  28. #include "pitch.h"
  29. #include "pitch_sse.h"
  30. #if defined(OPUS_HAVE_RTCD)
  31. # if defined(FIXED_POINT)
  32. #if defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)
  33. void (*const CELT_FIR_IMPL[OPUS_ARCHMASK + 1])(
  34. const opus_val16 *x,
  35. const opus_val16 *num,
  36. opus_val16 *y,
  37. int N,
  38. int ord,
  39. opus_val16 *mem,
  40. int arch
  41. ) = {
  42. celt_fir_c, /* non-sse */
  43. celt_fir_c,
  44. celt_fir_c,
  45. MAY_HAVE_SSE4_1(celt_fir), /* sse4.1 */
  46. MAY_HAVE_SSE4_1(celt_fir) /* avx */
  47. };
  48. void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
  49. const opus_val16 *x,
  50. const opus_val16 *y,
  51. opus_val32 sum[4],
  52. int len
  53. ) = {
  54. xcorr_kernel_c, /* non-sse */
  55. xcorr_kernel_c,
  56. xcorr_kernel_c,
  57. MAY_HAVE_SSE4_1(xcorr_kernel), /* sse4.1 */
  58. MAY_HAVE_SSE4_1(xcorr_kernel) /* avx */
  59. };
  60. #endif
  61. #if (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
  62. (!defined(OPUS_X86_MAY_HAVE_SSE_4_1) && defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2))
  63. opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
  64. const opus_val16 *x,
  65. const opus_val16 *y,
  66. int N
  67. ) = {
  68. celt_inner_prod_c, /* non-sse */
  69. celt_inner_prod_c,
  70. MAY_HAVE_SSE2(celt_inner_prod),
  71. MAY_HAVE_SSE4_1(celt_inner_prod), /* sse4.1 */
  72. MAY_HAVE_SSE4_1(celt_inner_prod) /* avx */
  73. };
  74. #endif
  75. # else
  76. #if defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)
  77. void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
  78. const opus_val16 *x,
  79. const opus_val16 *y,
  80. opus_val32 sum[4],
  81. int len
  82. ) = {
  83. xcorr_kernel_c, /* non-sse */
  84. MAY_HAVE_SSE(xcorr_kernel),
  85. MAY_HAVE_SSE(xcorr_kernel),
  86. MAY_HAVE_SSE(xcorr_kernel),
  87. MAY_HAVE_SSE(xcorr_kernel)
  88. };
  89. opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
  90. const opus_val16 *x,
  91. const opus_val16 *y,
  92. int N
  93. ) = {
  94. celt_inner_prod_c, /* non-sse */
  95. MAY_HAVE_SSE(celt_inner_prod),
  96. MAY_HAVE_SSE(celt_inner_prod),
  97. MAY_HAVE_SSE(celt_inner_prod),
  98. MAY_HAVE_SSE(celt_inner_prod)
  99. };
  100. void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
  101. const opus_val16 *x,
  102. const opus_val16 *y01,
  103. const opus_val16 *y02,
  104. int N,
  105. opus_val32 *xy1,
  106. opus_val32 *xy2
  107. ) = {
  108. dual_inner_prod_c, /* non-sse */
  109. MAY_HAVE_SSE(dual_inner_prod),
  110. MAY_HAVE_SSE(dual_inner_prod),
  111. MAY_HAVE_SSE(dual_inner_prod),
  112. MAY_HAVE_SSE(dual_inner_prod)
  113. };
  114. void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])(
  115. opus_val32 *y,
  116. opus_val32 *x,
  117. int T,
  118. int N,
  119. opus_val16 g10,
  120. opus_val16 g11,
  121. opus_val16 g12
  122. ) = {
  123. comb_filter_const_c, /* non-sse */
  124. MAY_HAVE_SSE(comb_filter_const),
  125. MAY_HAVE_SSE(comb_filter_const),
  126. MAY_HAVE_SSE(comb_filter_const),
  127. MAY_HAVE_SSE(comb_filter_const)
  128. };
  129. #endif
  130. #endif
  131. #endif