1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
25
26 /* FFT */
27
29 {
31
34
36 }
37
39 {
41 }
42
44 {
46 }
47
49 {
50 if (s) {
53 }
54 }
55
56 #if CONFIG_MDCT
57
59 {
61
64
66 }
67
69 {
71 }
72
74 {
76 }
77
79 {
81 }
82
84 {
85 if (s) {
88 }
89 }
90
91 #endif /* CONFIG_MDCT */
92
93 #if CONFIG_RDFT
94
96 {
98
101
103 }
104
106 {
108 }
109
111 {
112 if (s) {
115 }
116 }
117
118 #endif /* CONFIG_RDFT */
119
120 #if CONFIG_DCT
121
123 {
125
128
130 }
131
133 {
135 }
136
138 {
139 if (s) {
142 }
143 }
144
145 #ifdef TEST
146 int main(
int argc,
char **argv)
147 {
148 int i;
149 #define LEN 1024
154
155 if (!ref || !data || !rdft_context || !irdft_context)
156 return 2;
157 for (i=0; i<
LEN; i++) {
158 ref[i] = data[i] = i*456 + 123 + i*i;
159 }
162
163 for (i=0; i<LEN; i++) {
164 if (fabs(ref[i] - data[i]/LEN*2) > 1) {
165 fprintf(stderr, "Failed at %d (%f %f)\n", i, ref[i], data[i]/LEN*2);
166 return 1;
167 }
168 }
169
174
175 return 0;
176 }
177 #endif
178
179 #endif /* CONFIG_DCT */