xref: /aosp_15_r20/external/libopus/celt/arm/fft_arm.h (revision a58d3d2adb790c104798cd88c8a3aff4fa8b82cc)
1*a58d3d2aSXin Li /* Copyright (c) 2015 Xiph.Org Foundation
2*a58d3d2aSXin Li    Written by Viswanath Puttagunta */
3*a58d3d2aSXin Li /**
4*a58d3d2aSXin Li    @file fft_arm.h
5*a58d3d2aSXin Li    @brief ARM Neon Intrinsic optimizations for fft using NE10 library
6*a58d3d2aSXin Li  */
7*a58d3d2aSXin Li 
8*a58d3d2aSXin Li /*
9*a58d3d2aSXin Li    Redistribution and use in source and binary forms, with or without
10*a58d3d2aSXin Li    modification, are permitted provided that the following conditions
11*a58d3d2aSXin Li    are met:
12*a58d3d2aSXin Li 
13*a58d3d2aSXin Li    - Redistributions of source code must retain the above copyright
14*a58d3d2aSXin Li    notice, this list of conditions and the following disclaimer.
15*a58d3d2aSXin Li 
16*a58d3d2aSXin Li    - Redistributions in binary form must reproduce the above copyright
17*a58d3d2aSXin Li    notice, this list of conditions and the following disclaimer in the
18*a58d3d2aSXin Li    documentation and/or other materials provided with the distribution.
19*a58d3d2aSXin Li 
20*a58d3d2aSXin Li    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21*a58d3d2aSXin Li    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*a58d3d2aSXin Li    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23*a58d3d2aSXin Li    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24*a58d3d2aSXin Li    OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25*a58d3d2aSXin Li    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26*a58d3d2aSXin Li    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27*a58d3d2aSXin Li    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28*a58d3d2aSXin Li    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29*a58d3d2aSXin Li    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30*a58d3d2aSXin Li    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*a58d3d2aSXin Li */
32*a58d3d2aSXin Li 
33*a58d3d2aSXin Li 
34*a58d3d2aSXin Li #if !defined(FFT_ARM_H)
35*a58d3d2aSXin Li #define FFT_ARM_H
36*a58d3d2aSXin Li 
37*a58d3d2aSXin Li #include "kiss_fft.h"
38*a58d3d2aSXin Li 
39*a58d3d2aSXin Li #if defined(HAVE_ARM_NE10)
40*a58d3d2aSXin Li 
41*a58d3d2aSXin Li int opus_fft_alloc_arm_neon(kiss_fft_state *st);
42*a58d3d2aSXin Li void opus_fft_free_arm_neon(kiss_fft_state *st);
43*a58d3d2aSXin Li 
44*a58d3d2aSXin Li void opus_fft_neon(const kiss_fft_state *st,
45*a58d3d2aSXin Li                    const kiss_fft_cpx *fin,
46*a58d3d2aSXin Li                    kiss_fft_cpx *fout);
47*a58d3d2aSXin Li 
48*a58d3d2aSXin Li void opus_ifft_neon(const kiss_fft_state *st,
49*a58d3d2aSXin Li                     const kiss_fft_cpx *fin,
50*a58d3d2aSXin Li                     kiss_fft_cpx *fout);
51*a58d3d2aSXin Li 
52*a58d3d2aSXin Li #if !defined(OPUS_HAVE_RTCD)
53*a58d3d2aSXin Li #define OVERRIDE_OPUS_FFT (1)
54*a58d3d2aSXin Li 
55*a58d3d2aSXin Li #define opus_fft_alloc_arch(_st, arch) \
56*a58d3d2aSXin Li    ((void)(arch), opus_fft_alloc_arm_neon(_st))
57*a58d3d2aSXin Li 
58*a58d3d2aSXin Li #define opus_fft_free_arch(_st, arch) \
59*a58d3d2aSXin Li    ((void)(arch), opus_fft_free_arm_neon(_st))
60*a58d3d2aSXin Li 
61*a58d3d2aSXin Li #define opus_fft(_st, _fin, _fout, arch) \
62*a58d3d2aSXin Li    ((void)(arch), opus_fft_neon(_st, _fin, _fout))
63*a58d3d2aSXin Li 
64*a58d3d2aSXin Li #define opus_ifft(_st, _fin, _fout, arch) \
65*a58d3d2aSXin Li    ((void)(arch), opus_ifft_neon(_st, _fin, _fout))
66*a58d3d2aSXin Li 
67*a58d3d2aSXin Li #endif /* OPUS_HAVE_RTCD */
68*a58d3d2aSXin Li 
69*a58d3d2aSXin Li #endif /* HAVE_ARM_NE10 */
70*a58d3d2aSXin Li 
71*a58d3d2aSXin Li #endif
72