Update of Czech language - FS#11371 by Marek Salaba
[kugel-rb.git] / apps / codecs / lib / fft.h
blob302a3b399602e618e5e8dae458e0d9fcaf076837
1 /*
2 * WMA compatible decoder
3 * Copyright (c) 2002 The FFmpeg Project.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef CODECLIB_FFT_H_INCLUDED
20 #define CODECLIB_FFT_H_INCLUDED
22 #include <inttypes.h>
23 typedef int32_t fixed32;
24 typedef int64_t fixed64;
26 #define FFT_FIXED
28 #ifdef FFT_FIXED
29 typedef fixed32 FFTSample;
30 #else /* FFT_FIXED */
31 typedef float FFTSample;
32 #endif /* FFT_FIXED */
34 typedef struct FFTComplex {
35 FFTSample re, im;
36 } FFTComplex;
38 typedef struct FFTContext {
39 int nbits;
40 int inverse;
41 uint16_t *revtab;
42 int mdct_size; /* size of MDCT (i.e. number of input data * 2) */
43 int mdct_bits; /* n = 2^nbits */
44 /* pre/post rotation tables */
45 FFTSample *tcos;
46 FFTSample *tsin;
47 void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
48 void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
49 void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
50 void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
51 void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
52 int split_radix;
53 int permutation;
54 #define FF_MDCT_PERM_NONE 0
55 #define FF_MDCT_PERM_INTERLEAVE 1
56 } FFTContext;
58 // internal api (fft<->mdct)
59 //int fft_calc_unscaled(FFTContext *s, FFTComplex *z);
60 //void ff_fft_permute_c(FFTContext *s, FFTComplex *z); // internal only?
61 void ff_fft_calc_c(int nbits, FFTComplex *z);
63 #endif // CODECLIB_FFT_H_INCLUDED