ScummVM API documentation
rdft.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 xoreos' (I)RDFT code which is in turn
23 // Based upon the (I)RDFT code in FFmpeg
24 // Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
25 
26 #ifndef COMMON_RDFT_H
27 #define COMMON_RDFT_H
28 
29 #include "common/scummsys.h"
30 #include "common/math.h"
31 #include "common/fft.h"
32 
33 #include "common/cosinetables.h"
34 #include "common/sinetables.h"
35 
36 namespace Common {
37 
91 class RDFT {
92 public:
93  enum TransformType {
94  DFT_R2C,
95  IDFT_C2R,
96  IDFT_R2C,
97  DFT_C2R
98  };
99 
100  RDFT(int bits, TransformType trans);
101  ~RDFT();
102 
103  void calc(float *data);
104 
105 private:
106  int _bits;
107  int _inverse;
108  int _signConvention;
109 
110  SineTable _sin;
111  CosineTable _cos;
112  const float *_tSin;
113  const float *_tCos;
114 
115  FFT *_fft;
116 };
117 
120 } // End of namespace Common
121 
122 #endif // COMMON_RDFT_H
Definition: sinetables.h:36
Definition: fft.h:53
(Inverse) Real Discrete Fourier Transform.
Definition: rdft.h:91
Definition: achievements.h:31
Definition: cosinetables.h:36