annotate src/opus-1.3/celt/x86/x86_celt_map.c @ 75:8f7fd4420df7

Add some cross-platform Boost headers
author Chris Cannam
date Sat, 16 Feb 2019 16:31:25 +0000
parents 7aeed7906520
children
rev   line source
Chris@69 1 /* Copyright (c) 2014, Cisco Systems, INC
Chris@69 2 Written by XiangMingZhu WeiZhou MinPeng YanWang
Chris@69 3
Chris@69 4 Redistribution and use in source and binary forms, with or without
Chris@69 5 modification, are permitted provided that the following conditions
Chris@69 6 are met:
Chris@69 7
Chris@69 8 - Redistributions of source code must retain the above copyright
Chris@69 9 notice, this list of conditions and the following disclaimer.
Chris@69 10
Chris@69 11 - Redistributions in binary form must reproduce the above copyright
Chris@69 12 notice, this list of conditions and the following disclaimer in the
Chris@69 13 documentation and/or other materials provided with the distribution.
Chris@69 14
Chris@69 15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Chris@69 16 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Chris@69 17 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Chris@69 18 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
Chris@69 19 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
Chris@69 20 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
Chris@69 21 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
Chris@69 22 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
Chris@69 23 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Chris@69 24 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Chris@69 25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Chris@69 26 */
Chris@69 27
Chris@69 28 #if defined(HAVE_CONFIG_H)
Chris@69 29 #include "config.h"
Chris@69 30 #endif
Chris@69 31
Chris@69 32 #include "x86/x86cpu.h"
Chris@69 33 #include "celt_lpc.h"
Chris@69 34 #include "pitch.h"
Chris@69 35 #include "pitch_sse.h"
Chris@69 36 #include "vq.h"
Chris@69 37
Chris@69 38 #if defined(OPUS_HAVE_RTCD)
Chris@69 39
Chris@69 40 # if defined(FIXED_POINT)
Chris@69 41
Chris@69 42 #if defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)
Chris@69 43
Chris@69 44 void (*const CELT_FIR_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 45 const opus_val16 *x,
Chris@69 46 const opus_val16 *num,
Chris@69 47 opus_val16 *y,
Chris@69 48 int N,
Chris@69 49 int ord,
Chris@69 50 int arch
Chris@69 51 ) = {
Chris@69 52 celt_fir_c, /* non-sse */
Chris@69 53 celt_fir_c,
Chris@69 54 celt_fir_c,
Chris@69 55 MAY_HAVE_SSE4_1(celt_fir), /* sse4.1 */
Chris@69 56 MAY_HAVE_SSE4_1(celt_fir) /* avx */
Chris@69 57 };
Chris@69 58
Chris@69 59 void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 60 const opus_val16 *x,
Chris@69 61 const opus_val16 *y,
Chris@69 62 opus_val32 sum[4],
Chris@69 63 int len
Chris@69 64 ) = {
Chris@69 65 xcorr_kernel_c, /* non-sse */
Chris@69 66 xcorr_kernel_c,
Chris@69 67 xcorr_kernel_c,
Chris@69 68 MAY_HAVE_SSE4_1(xcorr_kernel), /* sse4.1 */
Chris@69 69 MAY_HAVE_SSE4_1(xcorr_kernel) /* avx */
Chris@69 70 };
Chris@69 71
Chris@69 72 #endif
Chris@69 73
Chris@69 74 #if (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
Chris@69 75 (!defined(OPUS_X86_MAY_HAVE_SSE_4_1) && defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2))
Chris@69 76
Chris@69 77 opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 78 const opus_val16 *x,
Chris@69 79 const opus_val16 *y,
Chris@69 80 int N
Chris@69 81 ) = {
Chris@69 82 celt_inner_prod_c, /* non-sse */
Chris@69 83 celt_inner_prod_c,
Chris@69 84 MAY_HAVE_SSE2(celt_inner_prod),
Chris@69 85 MAY_HAVE_SSE4_1(celt_inner_prod), /* sse4.1 */
Chris@69 86 MAY_HAVE_SSE4_1(celt_inner_prod) /* avx */
Chris@69 87 };
Chris@69 88
Chris@69 89 #endif
Chris@69 90
Chris@69 91 # else
Chris@69 92
Chris@69 93 #if defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)
Chris@69 94
Chris@69 95 void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 96 const opus_val16 *x,
Chris@69 97 const opus_val16 *y,
Chris@69 98 opus_val32 sum[4],
Chris@69 99 int len
Chris@69 100 ) = {
Chris@69 101 xcorr_kernel_c, /* non-sse */
Chris@69 102 MAY_HAVE_SSE(xcorr_kernel),
Chris@69 103 MAY_HAVE_SSE(xcorr_kernel),
Chris@69 104 MAY_HAVE_SSE(xcorr_kernel),
Chris@69 105 MAY_HAVE_SSE(xcorr_kernel)
Chris@69 106 };
Chris@69 107
Chris@69 108 opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 109 const opus_val16 *x,
Chris@69 110 const opus_val16 *y,
Chris@69 111 int N
Chris@69 112 ) = {
Chris@69 113 celt_inner_prod_c, /* non-sse */
Chris@69 114 MAY_HAVE_SSE(celt_inner_prod),
Chris@69 115 MAY_HAVE_SSE(celt_inner_prod),
Chris@69 116 MAY_HAVE_SSE(celt_inner_prod),
Chris@69 117 MAY_HAVE_SSE(celt_inner_prod)
Chris@69 118 };
Chris@69 119
Chris@69 120 void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 121 const opus_val16 *x,
Chris@69 122 const opus_val16 *y01,
Chris@69 123 const opus_val16 *y02,
Chris@69 124 int N,
Chris@69 125 opus_val32 *xy1,
Chris@69 126 opus_val32 *xy2
Chris@69 127 ) = {
Chris@69 128 dual_inner_prod_c, /* non-sse */
Chris@69 129 MAY_HAVE_SSE(dual_inner_prod),
Chris@69 130 MAY_HAVE_SSE(dual_inner_prod),
Chris@69 131 MAY_HAVE_SSE(dual_inner_prod),
Chris@69 132 MAY_HAVE_SSE(dual_inner_prod)
Chris@69 133 };
Chris@69 134
Chris@69 135 void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 136 opus_val32 *y,
Chris@69 137 opus_val32 *x,
Chris@69 138 int T,
Chris@69 139 int N,
Chris@69 140 opus_val16 g10,
Chris@69 141 opus_val16 g11,
Chris@69 142 opus_val16 g12
Chris@69 143 ) = {
Chris@69 144 comb_filter_const_c, /* non-sse */
Chris@69 145 MAY_HAVE_SSE(comb_filter_const),
Chris@69 146 MAY_HAVE_SSE(comb_filter_const),
Chris@69 147 MAY_HAVE_SSE(comb_filter_const),
Chris@69 148 MAY_HAVE_SSE(comb_filter_const)
Chris@69 149 };
Chris@69 150
Chris@69 151
Chris@69 152 #endif
Chris@69 153
Chris@69 154 #if defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)
Chris@69 155 opus_val16 (*const OP_PVQ_SEARCH_IMPL[OPUS_ARCHMASK + 1])(
Chris@69 156 celt_norm *_X, int *iy, int K, int N, int arch
Chris@69 157 ) = {
Chris@69 158 op_pvq_search_c, /* non-sse */
Chris@69 159 op_pvq_search_c,
Chris@69 160 MAY_HAVE_SSE2(op_pvq_search),
Chris@69 161 MAY_HAVE_SSE2(op_pvq_search),
Chris@69 162 MAY_HAVE_SSE2(op_pvq_search)
Chris@69 163 };
Chris@69 164 #endif
Chris@69 165
Chris@69 166 #endif
Chris@69 167 #endif