xref: /aosp_15_r20/external/speex/libspeexdsp/fftwrap.h (revision 28e138c64d234588b5cd2a8a403b584bd3036e4e)
1*28e138c6SAndroid Build Coastguard Worker /* Copyright (C) 2005 Jean-Marc Valin
2*28e138c6SAndroid Build Coastguard Worker    File: fftwrap.h
3*28e138c6SAndroid Build Coastguard Worker 
4*28e138c6SAndroid Build Coastguard Worker    Wrapper for various FFTs
5*28e138c6SAndroid Build Coastguard Worker 
6*28e138c6SAndroid Build Coastguard Worker    Redistribution and use in source and binary forms, with or without
7*28e138c6SAndroid Build Coastguard Worker    modification, are permitted provided that the following conditions
8*28e138c6SAndroid Build Coastguard Worker    are met:
9*28e138c6SAndroid Build Coastguard Worker 
10*28e138c6SAndroid Build Coastguard Worker    - Redistributions of source code must retain the above copyright
11*28e138c6SAndroid Build Coastguard Worker    notice, this list of conditions and the following disclaimer.
12*28e138c6SAndroid Build Coastguard Worker 
13*28e138c6SAndroid Build Coastguard Worker    - Redistributions in binary form must reproduce the above copyright
14*28e138c6SAndroid Build Coastguard Worker    notice, this list of conditions and the following disclaimer in the
15*28e138c6SAndroid Build Coastguard Worker    documentation and/or other materials provided with the distribution.
16*28e138c6SAndroid Build Coastguard Worker 
17*28e138c6SAndroid Build Coastguard Worker    - Neither the name of the Xiph.org Foundation nor the names of its
18*28e138c6SAndroid Build Coastguard Worker    contributors may be used to endorse or promote products derived from
19*28e138c6SAndroid Build Coastguard Worker    this software without specific prior written permission.
20*28e138c6SAndroid Build Coastguard Worker 
21*28e138c6SAndroid Build Coastguard Worker    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22*28e138c6SAndroid Build Coastguard Worker    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23*28e138c6SAndroid Build Coastguard Worker    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24*28e138c6SAndroid Build Coastguard Worker    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
25*28e138c6SAndroid Build Coastguard Worker    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26*28e138c6SAndroid Build Coastguard Worker    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27*28e138c6SAndroid Build Coastguard Worker    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28*28e138c6SAndroid Build Coastguard Worker    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29*28e138c6SAndroid Build Coastguard Worker    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30*28e138c6SAndroid Build Coastguard Worker    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31*28e138c6SAndroid Build Coastguard Worker    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32*28e138c6SAndroid Build Coastguard Worker 
33*28e138c6SAndroid Build Coastguard Worker */
34*28e138c6SAndroid Build Coastguard Worker 
35*28e138c6SAndroid Build Coastguard Worker #ifndef FFTWRAP_H
36*28e138c6SAndroid Build Coastguard Worker #define FFTWRAP_H
37*28e138c6SAndroid Build Coastguard Worker 
38*28e138c6SAndroid Build Coastguard Worker #include "arch.h"
39*28e138c6SAndroid Build Coastguard Worker 
40*28e138c6SAndroid Build Coastguard Worker /** Compute tables for an FFT */
41*28e138c6SAndroid Build Coastguard Worker void *spx_fft_init(int size);
42*28e138c6SAndroid Build Coastguard Worker 
43*28e138c6SAndroid Build Coastguard Worker /** Destroy tables for an FFT */
44*28e138c6SAndroid Build Coastguard Worker void spx_fft_destroy(void *table);
45*28e138c6SAndroid Build Coastguard Worker 
46*28e138c6SAndroid Build Coastguard Worker /** Forward (real to half-complex) transform */
47*28e138c6SAndroid Build Coastguard Worker void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out);
48*28e138c6SAndroid Build Coastguard Worker 
49*28e138c6SAndroid Build Coastguard Worker /** Backward (half-complex to real) transform */
50*28e138c6SAndroid Build Coastguard Worker void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out);
51*28e138c6SAndroid Build Coastguard Worker 
52*28e138c6SAndroid Build Coastguard Worker /** Forward (real to half-complex) transform of float data */
53*28e138c6SAndroid Build Coastguard Worker void spx_fft_float(void *table, float *in, float *out);
54*28e138c6SAndroid Build Coastguard Worker 
55*28e138c6SAndroid Build Coastguard Worker /** Backward (half-complex to real) transform of float data */
56*28e138c6SAndroid Build Coastguard Worker void spx_ifft_float(void *table, float *in, float *out);
57*28e138c6SAndroid Build Coastguard Worker 
58*28e138c6SAndroid Build Coastguard Worker #endif
59