ScummVM API documentation
fft.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program 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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 // Based on eos' (I)FFT code which is in turn
23 // based upon the (I)FFT code in FFmpeg
24 // Copyright (c) 2008 Loren Merritt
25 // Copyright (c) 2002 Fabrice Bellard
26 // Partly based on libdjbfft by D. J. Bernstein
27 
28 #ifndef COMMON_FFT_H
29 #define COMMON_FFT_H
30 
31 #include "common/scummsys.h"
32 #include "common/math.h"
33 
34 namespace Common {
35 
45 class CosineTable;
46 
53 class FFT {
54 public:
55  FFT(int bits, int inverse);
56  ~FFT();
57 
58  const uint16 *getRevTab() const;
59 
61  void permute(Complex *z);
62 
68  void calc(Complex *z);
69 
70 private:
71  int _bits;
72  int _inverse;
73 
74  uint16 *_revTab;
75 
76  Complex *_expTab;
77  Complex *_tmpBuf;
78 
79  int _splitRadix;
80 
81  static int splitRadixPermutation(int i, int n, int inverse);
82 
83  CosineTable *_cosTables[13];
84 
85  void fft4(Complex *z);
86  void fft8(Complex *z);
87  void fft16(Complex *z);
88  void fft(int n, int logn, Complex *z);
89 };
90 
93 } // End of namespace Common
94 
95 #endif // COMMON_FFT_H
Definition: math.h:65
Definition: fft.h:53
Definition: achievements.h:31
Definition: cosinetables.h:36
void permute(Complex *z)
void calc(Complex *z)