xoreos  0.0.5
dct.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)DCT 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/dct.c reads as follows:
30  *
31  * (I)DCT Transforms
32  * Copyright (c) 2009 Peter Ross <pross@xvid.org>
33  * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
34  * Copyright (c) 2010 Vitor Sessak
35  *
36  * This file is part of FFmpeg.
37  *
38  * FFmpeg is free software; you can redistribute it and/or
39  * modify it under the terms of the GNU Lesser General Public
40  * License as published by the Free Software Foundation; either
41  * version 2.1 of the License, or (at your option) any later version.
42  *
43  * FFmpeg is distributed in the hope that it will be useful,
44  * but WITHOUT ANY WARRANTY; without even the implied warranty of
45  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
46  * Lesser General Public License for more details.
47  *
48  * You should have received a copy of the GNU Lesser General Public
49  * License along with FFmpeg; if not, write to the Free Software
50  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
51  */
52 
53 #ifndef COMMON_DCT_H
54 #define COMMON_DCT_H
55 
56 #include <boost/noncopyable.hpp>
57 
58 #include "src/common/types.h"
59 #include "src/common/scopedptr.h"
60 
61 namespace Common {
62 
63 class RDFT;
64 
66 class DCT : boost::noncopyable {
67 public:
73  };
74 
75  DCT(int bits, TransformType trans);
76  ~DCT();
77 
78  void calc(float *data);
79 
80 private:
81  int _bits;
83 
84  const float *_tCos;
85 
87 
89 
90  void calcDCTI (float *data);
91  void calcDCTII (float *data);
92  void calcDCTIII(float *data);
93  void calcDSTI (float *data);
94 };
95 
96 } // End of namespace Common
97 
98 #endif // COMMON_DCT_H
Definition: 2dafile.h:39
~DCT()
Definition: dct.cpp:73
ScopedPtr< RDFT > _rdft
Definition: dct.h:86
(Inverse) Discrete Cosine Transforms.
Definition: dct.h:66
ScopedArray< float > _csc2
Definition: dct.h:88
A simple scoped smart pointer template.
void calcDSTI(float *data)
Definition: dct.cpp:204
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 calcDCTIII(float *data)
Definition: dct.cpp:170
TransformType
Definition: dct.h:68
DCT(int bits, TransformType trans)
Definition: dct.cpp:60
int _bits
Definition: dct.h:81
TransformType _trans
Definition: dct.h:82
void calc(float *data)
Definition: dct.cpp:76
void calcDCTI(float *data)
Definition: dct.cpp:101
const float * _tCos
Definition: dct.h:84
void calcDCTII(float *data)
Definition: dct.cpp:133