blob: ee6c24478660153063f7b41aca56d9dbf79f3c16 [file] [log] [blame]
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -08001/* Copyright (c) 2010 Xiph.Org Foundation
2 * Copyright (c) 2013 Parrot */
3/*
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
6 are met:
7
8 - Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10
11 - Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifdef HAVE_CONFIG_H
29#include "config.h"
30#endif
31
32#include "pitch.h"
flimc91ee5b2016-01-26 14:33:44 +010033#include "kiss_fft.h"
34#include "mdct.h"
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080035
36#if defined(OPUS_HAVE_RTCD)
37
38# if defined(FIXED_POINT)
39opus_val32 (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
40 const opus_val16 *, opus_val32 *, int , int) = {
41 celt_pitch_xcorr_c, /* ARMv4 */
42 MAY_HAVE_EDSP(celt_pitch_xcorr), /* EDSP */
43 MAY_HAVE_MEDIA(celt_pitch_xcorr), /* Media */
44 MAY_HAVE_NEON(celt_pitch_xcorr) /* NEON */
45};
flimc91ee5b2016-01-26 14:33:44 +010046# else /* !FIXED_POINT */
47# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
48void (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
49 const opus_val16 *, opus_val32 *, int, int) = {
50 celt_pitch_xcorr_c, /* ARMv4 */
51 celt_pitch_xcorr_c, /* EDSP */
52 celt_pitch_xcorr_c, /* Media */
53 celt_pitch_xcorr_float_neon /* Neon */
54};
55# endif
56# endif /* FIXED_POINT */
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080057
flimc91ee5b2016-01-26 14:33:44 +010058# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR)
59# if defined(HAVE_ARM_NE10)
60# if defined(CUSTOM_MODES)
61int (*const OPUS_FFT_ALLOC_ARCH_IMPL[OPUS_ARCHMASK+1])(kiss_fft_state *st) = {
62 opus_fft_alloc_arch_c, /* ARMv4 */
63 opus_fft_alloc_arch_c, /* EDSP */
64 opus_fft_alloc_arch_c, /* Media */
65 opus_fft_alloc_arm_neon /* Neon with NE10 library support */
66};
67
68void (*const OPUS_FFT_FREE_ARCH_IMPL[OPUS_ARCHMASK+1])(kiss_fft_state *st) = {
69 opus_fft_free_arch_c, /* ARMv4 */
70 opus_fft_free_arch_c, /* EDSP */
71 opus_fft_free_arch_c, /* Media */
72 opus_fft_free_arm_neon /* Neon with NE10 */
73};
74# endif /* CUSTOM_MODES */
75
76void (*const OPUS_FFT[OPUS_ARCHMASK+1])(const kiss_fft_state *cfg,
77 const kiss_fft_cpx *fin,
78 kiss_fft_cpx *fout) = {
79 opus_fft_c, /* ARMv4 */
80 opus_fft_c, /* EDSP */
81 opus_fft_c, /* Media */
82 opus_fft_neon /* Neon with NE10 */
83};
84
85void (*const OPUS_IFFT[OPUS_ARCHMASK+1])(const kiss_fft_state *cfg,
86 const kiss_fft_cpx *fin,
87 kiss_fft_cpx *fout) = {
88 opus_ifft_c, /* ARMv4 */
89 opus_ifft_c, /* EDSP */
90 opus_ifft_c, /* Media */
91 opus_ifft_neon /* Neon with NE10 */
92};
93
94void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
95 kiss_fft_scalar *in,
96 kiss_fft_scalar * OPUS_RESTRICT out,
97 const opus_val16 *window,
98 int overlap, int shift,
99 int stride, int arch) = {
100 clt_mdct_forward_c, /* ARMv4 */
101 clt_mdct_forward_c, /* EDSP */
102 clt_mdct_forward_c, /* Media */
103 clt_mdct_forward_neon /* Neon with NE10 */
104};
105
106void (*const CLT_MDCT_BACKWARD_IMPL[OPUS_ARCHMASK+1])(const mdct_lookup *l,
107 kiss_fft_scalar *in,
108 kiss_fft_scalar * OPUS_RESTRICT out,
109 const opus_val16 *window,
110 int overlap, int shift,
111 int stride, int arch) = {
112 clt_mdct_backward_c, /* ARMv4 */
113 clt_mdct_backward_c, /* EDSP */
114 clt_mdct_backward_c, /* Media */
115 clt_mdct_backward_neon /* Neon with NE10 */
116};
117
118# endif /* HAVE_ARM_NE10 */
119# endif /* OPUS_ARM_MAY_HAVE_NEON_INTR */
120
121#endif /* OPUS_HAVE_RTCD */