Mercurial > hg > audio-file-loader
comparison libs/aubioFullOSXUni/include/fft/fftw3.h @ 0:bcb0d40158f4
started audio file loader project - using oF_061
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Tue, 30 Aug 2011 20:18:34 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bcb0d40158f4 |
---|---|
1 /* | |
2 * Copyright (c) 2003, 2006 Matteo Frigo | |
3 * Copyright (c) 2003, 2006 Massachusetts Institute of Technology | |
4 * | |
5 * The following statement of license applies *only* to this header file, | |
6 * and *not* to the other files distributed with FFTW or derived therefrom: | |
7 * | |
8 * Redistribution and use in source and binary forms, with or without | |
9 * modification, are permitted provided that the following conditions | |
10 * are met: | |
11 * | |
12 * 1. Redistributions of source code must retain the above copyright | |
13 * notice, this list of conditions and the following disclaimer. | |
14 * | |
15 * 2. Redistributions in binary form must reproduce the above copyright | |
16 * notice, this list of conditions and the following disclaimer in the | |
17 * documentation and/or other materials provided with the distribution. | |
18 * | |
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS | |
20 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | |
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | |
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | |
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 */ | |
31 | |
32 /***************************** NOTE TO USERS ********************************* | |
33 * | |
34 * THIS IS A HEADER FILE, NOT A MANUAL | |
35 * | |
36 * If you want to know how to use FFTW, please read the manual, | |
37 * online at http://www.fftw.org/doc/ and also included with FFTW. | |
38 * For a quick start, see the manual's tutorial section. | |
39 * | |
40 * (Reading header files to learn how to use a library is a habit | |
41 * stemming from code lacking a proper manual. Arguably, it's a | |
42 * *bad* habit in most cases, because header files can contain | |
43 * interfaces that are not part of the public, stable API.) | |
44 * | |
45 ****************************************************************************/ | |
46 | |
47 /* header file for fftw3 */ | |
48 /* (The following is the CVS ID for this file, *not* the version | |
49 number of FFTW:) */ | |
50 /* $Id: fftw3.h,v 1.90 2006-01-17 04:03:33 stevenj Exp $ */ | |
51 | |
52 #ifndef FFTW3_H | |
53 #define FFTW3_H | |
54 | |
55 #include <stdio.h> | |
56 | |
57 #ifdef __cplusplus | |
58 extern "C" | |
59 { | |
60 #endif /* __cplusplus */ | |
61 | |
62 /* If <complex.h> is included, use the C99 complex type. Otherwise | |
63 define a type bit-compatible with C99 complex */ | |
64 #if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) | |
65 # define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C | |
66 #else | |
67 # define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2] | |
68 #endif | |
69 | |
70 #define FFTW_CONCAT(prefix, name) prefix ## name | |
71 #define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name) | |
72 #define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name) | |
73 #define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name) | |
74 | |
75 /* IMPORTANT: for Windows compilers, you should add a line | |
76 #define FFTW_DLL | |
77 here and in kernel/ifftw.h if you are compiling/using FFTW as a | |
78 DLL, in order to do the proper importing/exporting, or | |
79 alternatively compile with -DFFTW_DLL or the equivalent | |
80 command-line flag. This is not necessary under MinGW/Cygwin, where | |
81 libtool does the imports/exports automatically. */ | |
82 #if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__)) | |
83 /* annoying Windows syntax for shared-library declarations */ | |
84 # if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */ | |
85 # define FFTW_EXTERN extern __declspec(dllexport) | |
86 # else /* user is calling FFTW; import symbol */ | |
87 # define FFTW_EXTERN extern __declspec(dllimport) | |
88 # endif | |
89 #else | |
90 # define FFTW_EXTERN extern | |
91 #endif | |
92 | |
93 enum fftw_r2r_kind_do_not_use_me { | |
94 FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, | |
95 FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, | |
96 FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 | |
97 }; | |
98 | |
99 struct fftw_iodim_do_not_use_me { | |
100 int n; /* dimension size */ | |
101 int is; /* input stride */ | |
102 int os; /* output stride */ | |
103 }; | |
104 | |
105 /* | |
106 huge second-order macro that defines prototypes for all API | |
107 functions. We expand this macro for each supported precision | |
108 | |
109 X: name-mangling macro | |
110 R: real data type | |
111 C: complex data type | |
112 */ | |
113 | |
114 #define FFTW_DEFINE_API(X, R, C) \ | |
115 \ | |
116 FFTW_DEFINE_COMPLEX(R, C); \ | |
117 \ | |
118 typedef struct X(plan_s) *X(plan); \ | |
119 \ | |
120 typedef struct fftw_iodim_do_not_use_me X(iodim); \ | |
121 \ | |
122 typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \ | |
123 \ | |
124 FFTW_EXTERN void X(execute)(const X(plan) p); \ | |
125 \ | |
126 FFTW_EXTERN X(plan) X(plan_dft)(int rank, const int *n, \ | |
127 C *in, C *out, int sign, unsigned flags); \ | |
128 \ | |
129 FFTW_EXTERN X(plan) X(plan_dft_1d)(int n, C *in, C *out, int sign, \ | |
130 unsigned flags); \ | |
131 FFTW_EXTERN X(plan) X(plan_dft_2d)(int nx, int ny, \ | |
132 C *in, C *out, int sign, unsigned flags); \ | |
133 FFTW_EXTERN X(plan) X(plan_dft_3d)(int nx, int ny, int nz, \ | |
134 C *in, C *out, int sign, unsigned flags); \ | |
135 \ | |
136 FFTW_EXTERN X(plan) X(plan_many_dft)(int rank, const int *n, \ | |
137 int howmany, \ | |
138 C *in, const int *inembed, \ | |
139 int istride, int idist, \ | |
140 C *out, const int *onembed, \ | |
141 int ostride, int odist, \ | |
142 int sign, unsigned flags); \ | |
143 \ | |
144 FFTW_EXTERN X(plan) X(plan_guru_dft)(int rank, const X(iodim) *dims, \ | |
145 int howmany_rank, \ | |
146 const X(iodim) *howmany_dims, \ | |
147 C *in, C *out, \ | |
148 int sign, unsigned flags); \ | |
149 FFTW_EXTERN X(plan) X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \ | |
150 int howmany_rank, \ | |
151 const X(iodim) *howmany_dims, \ | |
152 R *ri, R *ii, R *ro, R *io, \ | |
153 unsigned flags); \ | |
154 \ | |
155 FFTW_EXTERN void X(execute_dft)(const X(plan) p, C *in, C *out); \ | |
156 FFTW_EXTERN void X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \ | |
157 R *ro, R *io); \ | |
158 \ | |
159 FFTW_EXTERN X(plan) X(plan_many_dft_r2c)(int rank, const int *n, \ | |
160 int howmany, \ | |
161 R *in, const int *inembed, \ | |
162 int istride, int idist, \ | |
163 C *out, const int *onembed, \ | |
164 int ostride, int odist, \ | |
165 unsigned flags); \ | |
166 \ | |
167 FFTW_EXTERN X(plan) X(plan_dft_r2c)(int rank, const int *n, \ | |
168 R *in, C *out, unsigned flags); \ | |
169 \ | |
170 FFTW_EXTERN X(plan) X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \ | |
171 FFTW_EXTERN X(plan) X(plan_dft_r2c_2d)(int nx, int ny, \ | |
172 R *in, C *out, unsigned flags); \ | |
173 FFTW_EXTERN X(plan) X(plan_dft_r2c_3d)(int nx, int ny, \ | |
174 int nz, \ | |
175 R *in, C *out, unsigned flags); \ | |
176 \ | |
177 \ | |
178 FFTW_EXTERN X(plan) X(plan_many_dft_c2r)(int rank, const int *n, \ | |
179 int howmany, \ | |
180 C *in, const int *inembed, \ | |
181 int istride, int idist, \ | |
182 R *out, const int *onembed, \ | |
183 int ostride, int odist, \ | |
184 unsigned flags); \ | |
185 \ | |
186 FFTW_EXTERN X(plan) X(plan_dft_c2r)(int rank, const int *n, \ | |
187 C *in, R *out, unsigned flags); \ | |
188 \ | |
189 FFTW_EXTERN X(plan) X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \ | |
190 FFTW_EXTERN X(plan) X(plan_dft_c2r_2d)(int nx, int ny, \ | |
191 C *in, R *out, unsigned flags); \ | |
192 FFTW_EXTERN X(plan) X(plan_dft_c2r_3d)(int nx, int ny, \ | |
193 int nz, \ | |
194 C *in, R *out, unsigned flags); \ | |
195 \ | |
196 FFTW_EXTERN X(plan) X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \ | |
197 int howmany_rank, \ | |
198 const X(iodim) *howmany_dims, \ | |
199 R *in, C *out, \ | |
200 unsigned flags); \ | |
201 FFTW_EXTERN X(plan) X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \ | |
202 int howmany_rank, \ | |
203 const X(iodim) *howmany_dims, \ | |
204 C *in, R *out, \ | |
205 unsigned flags); \ | |
206 \ | |
207 FFTW_EXTERN X(plan) X(plan_guru_split_dft_r2c)( \ | |
208 int rank, const X(iodim) *dims, \ | |
209 int howmany_rank, \ | |
210 const X(iodim) *howmany_dims, \ | |
211 R *in, R *ro, R *io, \ | |
212 unsigned flags); \ | |
213 FFTW_EXTERN X(plan) X(plan_guru_split_dft_c2r)( \ | |
214 int rank, const X(iodim) *dims, \ | |
215 int howmany_rank, \ | |
216 const X(iodim) *howmany_dims, \ | |
217 R *ri, R *ii, R *out, \ | |
218 unsigned flags); \ | |
219 \ | |
220 FFTW_EXTERN void X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \ | |
221 FFTW_EXTERN void X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \ | |
222 \ | |
223 FFTW_EXTERN void X(execute_split_dft_r2c)(const X(plan) p, \ | |
224 R *in, R *ro, R *io); \ | |
225 FFTW_EXTERN void X(execute_split_dft_c2r)(const X(plan) p, \ | |
226 R *ri, R *ii, R *out); \ | |
227 \ | |
228 FFTW_EXTERN X(plan) X(plan_many_r2r)(int rank, const int *n, \ | |
229 int howmany, \ | |
230 R *in, const int *inembed, \ | |
231 int istride, int idist, \ | |
232 R *out, const int *onembed, \ | |
233 int ostride, int odist, \ | |
234 const X(r2r_kind) *kind, unsigned flags); \ | |
235 \ | |
236 FFTW_EXTERN X(plan) X(plan_r2r)(int rank, const int *n, R *in, R *out, \ | |
237 const X(r2r_kind) *kind, unsigned flags); \ | |
238 \ | |
239 FFTW_EXTERN X(plan) X(plan_r2r_1d)(int n, R *in, R *out, \ | |
240 X(r2r_kind) kind, unsigned flags); \ | |
241 FFTW_EXTERN X(plan) X(plan_r2r_2d)(int nx, int ny, R *in, R *out, \ | |
242 X(r2r_kind) kindx, X(r2r_kind) kindy, \ | |
243 unsigned flags); \ | |
244 FFTW_EXTERN X(plan) X(plan_r2r_3d)(int nx, int ny, int nz, \ | |
245 R *in, R *out, X(r2r_kind) kindx, \ | |
246 X(r2r_kind) kindy, X(r2r_kind) kindz, \ | |
247 unsigned flags); \ | |
248 \ | |
249 FFTW_EXTERN X(plan) X(plan_guru_r2r)(int rank, const X(iodim) *dims, \ | |
250 int howmany_rank, \ | |
251 const X(iodim) *howmany_dims, \ | |
252 R *in, R *out, \ | |
253 const X(r2r_kind) *kind, unsigned flags); \ | |
254 FFTW_EXTERN void X(execute_r2r)(const X(plan) p, R *in, R *out); \ | |
255 \ | |
256 FFTW_EXTERN void X(destroy_plan)(X(plan) p); \ | |
257 FFTW_EXTERN void X(forget_wisdom)(void); \ | |
258 FFTW_EXTERN void X(cleanup)(void); \ | |
259 \ | |
260 FFTW_EXTERN void X(set_timelimit)(double); \ | |
261 \ | |
262 FFTW_EXTERN void X(plan_with_nthreads)(int nthreads); \ | |
263 FFTW_EXTERN int X(init_threads)(void); \ | |
264 FFTW_EXTERN void X(cleanup_threads)(void); \ | |
265 \ | |
266 FFTW_EXTERN void X(export_wisdom_to_file)(FILE *output_file); \ | |
267 FFTW_EXTERN char *X(export_wisdom_to_string)(void); \ | |
268 FFTW_EXTERN void X(export_wisdom)(void (*write_char)(char c, void *), \ | |
269 void *data); \ | |
270 FFTW_EXTERN int X(import_system_wisdom)(void); \ | |
271 FFTW_EXTERN int X(import_wisdom_from_file)(FILE *input_file); \ | |
272 FFTW_EXTERN int X(import_wisdom_from_string)(const char *input_string); \ | |
273 FFTW_EXTERN int X(import_wisdom)(int (*read_char)(void *), void *data); \ | |
274 \ | |
275 FFTW_EXTERN void X(fprint_plan)(const X(plan) p, FILE *output_file); \ | |
276 FFTW_EXTERN void X(print_plan)(const X(plan) p); \ | |
277 \ | |
278 FFTW_EXTERN void *X(malloc)(size_t n); \ | |
279 FFTW_EXTERN void X(free)(void *p); \ | |
280 \ | |
281 FFTW_EXTERN void X(flops)(const X(plan) p, \ | |
282 double *add, double *mul, double *fmas); \ | |
283 FFTW_EXTERN double X(estimate_cost)(const X(plan) p); \ | |
284 \ | |
285 FFTW_EXTERN const char X(version)[]; \ | |
286 FFTW_EXTERN const char X(cc)[]; \ | |
287 FFTW_EXTERN const char X(codelet_optim)[]; | |
288 | |
289 | |
290 /* end of FFTW_DEFINE_API macro */ | |
291 | |
292 FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex) | |
293 FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex) | |
294 FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex) | |
295 | |
296 #define FFTW_FORWARD (-1) | |
297 #define FFTW_BACKWARD (+1) | |
298 | |
299 #define FFTW_NO_TIMELIMIT (-1.0) | |
300 | |
301 /* documented flags */ | |
302 #define FFTW_MEASURE (0U) | |
303 #define FFTW_DESTROY_INPUT (1U << 0) | |
304 #define FFTW_UNALIGNED (1U << 1) | |
305 #define FFTW_CONSERVE_MEMORY (1U << 2) | |
306 #define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */ | |
307 #define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */ | |
308 #define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */ | |
309 #define FFTW_ESTIMATE (1U << 6) | |
310 | |
311 /* undocumented beyond-guru flags */ | |
312 #define FFTW_ESTIMATE_PATIENT (1U << 7) | |
313 #define FFTW_BELIEVE_PCOST (1U << 8) | |
314 #define FFTW_NO_DFT_R2HC (1U << 9) | |
315 #define FFTW_NO_NONTHREADED (1U << 10) | |
316 #define FFTW_NO_BUFFERING (1U << 11) | |
317 #define FFTW_NO_INDIRECT_OP (1U << 12) | |
318 #define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */ | |
319 #define FFTW_NO_RANK_SPLITS (1U << 14) | |
320 #define FFTW_NO_VRANK_SPLITS (1U << 15) | |
321 #define FFTW_NO_VRECURSE (1U << 16) | |
322 #define FFTW_NO_SIMD (1U << 17) | |
323 #define FFTW_NO_SLOW (1U << 18) | |
324 #define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19) | |
325 #define FFTW_ALLOW_PRUNING (1U << 20) | |
326 | |
327 #ifdef __cplusplus | |
328 } /* extern "C" */ | |
329 #endif /* __cplusplus */ | |
330 | |
331 #endif /* FFTW3_H */ |