xoreos  0.0.5
mdct.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 /* Based on the (I)MDCT code in FFmpeg (<https://ffmpeg.org/)>, which
26  * is released under the terms of version 2 or later of the GNU Lesser
27  * General Public License.
28  *
29  * The original copyright note in libavcodec/mdct_template.c reads as follows:
30  *
31  * MDCT/IMDCT transforms
32  * Copyright (c) 2002 Fabrice Bellard
33  *
34  * This file is part of FFmpeg.
35  *
36  * FFmpeg is free software; you can redistribute it and/or
37  * modify it under the terms of the GNU Lesser General Public
38  * License as published by the Free Software Foundation; either
39  * version 2.1 of the License, or (at your option) any later version.
40  *
41  * FFmpeg is distributed in the hope that it will be useful,
42  * but WITHOUT ANY WARRANTY; without even the implied warranty of
43  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44  * Lesser General Public License for more details.
45  *
46  * You should have received a copy of the GNU Lesser General Public
47  * License along with FFmpeg; if not, write to the Free Software
48  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
49  */
50 
51 #ifndef COMMON_MDCT_H
52 #define COMMON_MDCT_H
53 
54 #include <boost/noncopyable.hpp>
55 
56 #include "src/common/types.h"
57 #include "src/common/scopedptr.h"
58 
59 namespace Common {
60 
61 class FFT;
62 
64 class MDCT : boost::noncopyable {
65 public:
66  MDCT(int bits, bool inverse, double scale);
67  ~MDCT();
68 
70  void calcMDCT(float *output, const float *input);
71 
73  void calcIMDCT(float *output, const float *input);
74 
75 private:
76  int _bits;
77  int _size;
78 
80  float *_tSin;
81 
83 
87  void calcHalfIMDCT(float *output, const float *input);
88 };
89 
90 } // End of namespace Common
91 
92 #endif // COMMON_MDCT_H
Definition: 2dafile.h:39
ScopedPtr< FFT > _fft
Definition: mdct.h:82
void calcHalfIMDCT(float *output, const float *input)
Compute the middle half of the inverse MDCT of size N = 2^nbits, thus excluding the parts that can be...
Definition: mdct.cpp:141
int _size
Definition: mdct.h:77
float * _tSin
Definition: mdct.h:80
(Inverse) Modified Discrete Cosine Transforms.
Definition: mdct.h:64
A simple scoped smart pointer template.
ScopedArray< float > _tCos
Definition: mdct.h:79
Low-level type definitions to handle fixed width types portably.
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
void calcIMDCT(float *output, const float *input)
Compute inverse MDCT of size N = 2^nbits.
Definition: mdct.cpp:129
static glm::mat4 inverse(const glm::mat4 &m)
Definition: graphics.cpp:1363
int _bits
Definition: mdct.h:76
void calcMDCT(float *output, const float *input)
Compute MDCT of size N = 2^nbits.
Definition: mdct.cpp:88
MDCT(int bits, bool inverse, double scale)
Definition: mdct.cpp:58