ScummVM API documentation
dct.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)RDFT code which is in turn
23 // Based upon the (I)DCT code in FFmpeg
24 // Copyright (c) 2009 Peter Ross <pross@xvid.org>
25 // Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
26 // Copyright (c) 2010 Vitor Sessak
27 
28 #ifndef COMMON_DCT_H
29 #define COMMON_DCT_H
30 
31 #include "common/scummsys.h"
32 #include "common/math.h"
33 #include "common/rdft.h"
34 
35 #include "common/cosinetables.h"
36 
37 namespace Common {
38 
54 class DCT {
55 public:
56  enum TransformType {
57  DCT_II,
58  DCT_III,
59  DCT_I,
60  DST_I
61  };
62 
63  DCT(int bits, TransformType trans);
64  ~DCT();
65 
66  void calc(float *data);
67 
68 private:
69  int _bits;
70  TransformType _trans;
71 
72  CosineTable _cos;
73  const float *_tCos;
74 
75  float *_csc2;
76 
77  RDFT *_rdft;
78 
79  void calcDCTI (float *data);
80  void calcDCTII (float *data);
81  void calcDCTIII(float *data);
82  void calcDSTI (float *data);
83 };
84 
87 } // End of namespace Common
88 
89 #endif // COMMON_DCT_H
Definition: dct.h:54
(Inverse) Real Discrete Fourier Transform.
Definition: rdft.h:91
Definition: achievements.h:31
Definition: cosinetables.h:36