1 /*
2 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
3 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef AVCODEC_FFT_H
23 #define AVCODEC_FFT_H
24
25 #ifndef FFT_FLOAT
27 #endif
28
29 #include <stdint.h>
30 #include "config.h"
31
33
34 #if FFT_FLOAT
35
37
39
41
42 #else
43
44 #define Q31(x) (int)((x)*2147483648.0 + 0.5)
45 #define FFT_NAME(x) x ## _fixed_32
46
48
52
55
56 #endif /* FFT_FLOAT */
57
61
62 /* FFT computation */
63
68 };
69
73 };
74
80 int mdct_size;
/* size of MDCT (i.e. number of input data * 2) */
82 /* pre/post rotation tables */
85 /**
86 * Do the permutation needed BEFORE calling fft_calc().
87 */
89 /**
90 * Do a complex FFT with the parameters defined in ff_fft_init(). The
91 * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
92 */
100 };
101
102 #if CONFIG_HARDCODED_TABLES
103 #define COSTABLE_CONST const
104 #define ff_init_ff_cos_tabs(index)
105 #else
106 #define COSTABLE_CONST
107 #define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
108
109 /**
110 * Initialize the cosine table in ff_cos_tabs[index]
111 * @param index index in ff_cos_tabs array of the table to initialize
112 */
114 #endif
115
116 #define COSTABLE(size) \
117 COSTABLE_CONST DECLARE_ALIGNED(32, FFTSample, FFT_NAME(ff_cos_##size))[size/2]
118
134
135 #define ff_fft_init FFT_NAME(ff_fft_init)
136 #define ff_fft_end FFT_NAME(ff_fft_end)
137
138 /**
139 * Set up a complex FFT.
140 * @param nbits log2 of the length of the input array
141 * @param inverse if 0 perform the forward transform, if 1 perform the inverse
142 */
144
150
152
153 #define ff_mdct_init FFT_NAME(ff_mdct_init)
154 #define ff_mdct_end FFT_NAME(ff_mdct_end)
155
158
159 #endif /* AVCODEC_FFT_H */