ScummVM API documentation
indeo3.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 #include "common/scummsys.h"
23 
24 /* Intel Indeo 3 decompressor, derived from ffmpeg.
25  *
26  * Original copyright note:
27  * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg
28  * written, produced, and directed by Alan Smithee
29  */
30 
31 #ifndef IMAGE_CODECS_INDEO3_H
32 #define IMAGE_CODECS_INDEO3_H
33 
34 #include "image/codecs/codec.h"
35 
36 namespace Image {
37 
46 class Indeo3Decoder : public Codec {
47 public:
48  Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel = 24);
49  ~Indeo3Decoder() override;
50 
52  Graphics::PixelFormat getPixelFormat() const override;
53  bool setOutputPixelFormat(const Graphics::PixelFormat &format) override { _pixelFormat = format; return true; }
54 
55  static bool isIndeo3(Common::SeekableReadStream &stream);
56 
57 private:
58  Graphics::Surface *_surface;
59 
60  uint16 _width;
61  uint16 _height;
62  Graphics::PixelFormat _pixelFormat;
63 
64  static const byte _corrector_type_0[24];
65  static const byte _corrector_type_2[8];
66  static const uint32 correction[];
67  static const uint32 correctionloworder[];
68  static const uint32 correctionhighorder[];
69 
70  struct YUVBufs {
71  byte *Ybuf;
72  byte *Ubuf;
73  byte *Vbuf;
74  byte *the_buf;
75  uint32 the_buf_size;
76  uint16 y_w, y_h;
77  uint16 uv_w, uv_h;
78  };
79 
80  YUVBufs _iv_frame[2];
81  YUVBufs *_cur_frame;
82  YUVBufs *_ref_frame;
83 
84  byte *_ModPred;
85  byte *_corrector_type;
86 
87  void buildModPred();
88  void allocFrames();
89 
90  void decodeChunk(byte *cur, byte *ref, int width, int height,
91  const byte *buf1, uint32 fflags2, const byte *hdr,
92  const byte *buf2, int min_width_160);
93 };
94 
95 } // End of namespace Image
96 
97 #endif
Definition: surface.h:67
Definition: pixelformat.h:138
Definition: stream.h:745
Definition: codec.h:57
Definition: indeo3.h:46
const Graphics::Surface * decodeFrame(Common::SeekableReadStream &stream) override
bool setOutputPixelFormat(const Graphics::PixelFormat &format) override
Definition: indeo3.h:53
Graphics::PixelFormat getPixelFormat() const override
Definition: movie_decoder.h:32