ScummVM API documentation
indeo5.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 /* Intel Indeo 4 decompressor, derived from ffmpeg.
23  *
24  * Original copyright note:
25  * Intel Indeo 4 (IV31, IV32, etc.) video decoder for ffmpeg
26  * written, produced, and directed by Alan Smithee
27  */
28 
29 #ifndef IMAGE_CODECS_INDEO5_H
30 #define IMAGE_CODECS_INDEO5_H
31 
32 #include "image/codecs/indeo/get_bits.h"
33 #include "image/codecs/indeo/indeo.h"
34 
35 namespace Image {
36 
37 using namespace Indeo;
38 
48  struct Transform {
49  InvTransformPtr *inv_trans;
50  DCTransformPtr *dc_trans;
51  int is_2d_trans;
52  };
53 public:
54  Indeo5Decoder(uint16 width, uint16 height, uint bitsPerPixel = 16);
55  ~Indeo5Decoder() override {}
56 
57  const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream) override;
58 
59  static bool isIndeo5(Common::SeekableReadStream &stream);
60 protected:
65  int decodePictureHeader() override;
66 
70  void switchBuffers() override;
71 
72  bool isNonNullFrame() const override;
73 
80  int decodeBandHeader(IVIBandDesc *band) override;
81 
90  int decodeMbInfo(IVIBandDesc *band, IVITile *tile) override;
91 private:
98  int decode_gop_header();
99 
103  int skip_hdr_extension();
104 
105 private:
109  static const uint8 _commonPicSizes[30];
110 
120  static const uint16 _baseQuant8x8Inter[5][64];
121  static const uint16 _baseQuant8x8Intra[5][64];
122 
123  static const uint16 _baseQuant4x4Inter[16];
124  static const uint16 _baseQuant4x4Intra[16];
125 
126  static const uint8 _scaleQuant8x8Inter[5][24];
127  static const uint8 _scaleQuant8x8Intra[5][24];
128 
129  static const uint8 _scaleQuant4x4Inter[24];
130  static const uint8 _scaleQuant4x4Intra[24];
131 };
132 
133 } // End of namespace Image
134 
135 #endif
Definition: surface.h:67
Definition: stream.h:745
Definition: indeo5.h:47
Definition: indeo.h:201
Definition: indeo.h:435
Definition: movie_decoder.h:32
Definition: indeo.h:183