1 /* ScummVM - Graphic Adventure Engine
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.
7 * This program 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 2
10 * of the License, or (at your option) any later version.
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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 /* Intel Indeo 3 decompressor, derived from ffmpeg.
28 * Original copyright note:
29 * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg
30 * written, produced, and directed by Alan Smithee
33 #ifndef GRAPHICS_VIDEO_INDEO3_H
34 #define GRAPHICS_VIDEO_INDEO3_H
36 #include "common/stream.h"
47 enum DitherAlgorithm
{
52 Indeo3(int16 width
, int16 height
, Graphics::PaletteLUT
*palLUT
);
55 static bool isIndeo3(byte
*data
, uint32 dataLen
);
57 void setDither(DitherAlgorithm dither
);
59 bool decompressFrame(byte
*inData
, uint32 dataLen
,
60 byte
*outData
, uint16 width
, uint16 height
);
63 static const int _corrector_type_0
[24];
64 static const int _corrector_type_2
[8];
65 static const uint32 correction
[];
66 static const uint32 correctionloworder
[];
67 static const uint32 correctionhighorder
[];
86 uint16
*_corrector_type
;
88 Graphics::PaletteLUT
*_palLUT
;
90 DitherAlgorithm _dither
;
91 Graphics::SierraLight
*_ditherSL
;
95 uint16 widthY
, widthUV
;
96 uint16 heightY
, heightUV
;
97 uint16 uwidthUV
, uwidthOut
;
98 uint16 uheightUV
, uheightOut
;
99 uint16 scaleWYUV
, scaleWYOut
;
100 uint16 scaleHYUV
, scaleHYOut
;
101 uint16 lineWidthOut
, lineHeightOut
;
102 byte
*bufY
, *bufU
, *bufV
, *bufOut
;
108 void decodeChunk(byte
*cur
, byte
*ref
, int width
, int height
,
109 const byte
*buf1
, uint32 fflags2
, const byte
*hdr
,
110 const byte
*buf2
, int min_width_160
);
112 void blitFrame(BlitState
&s
);
114 void blitLine(BlitState
&s
);
115 void blitLineDither(BlitState
&s
);
118 } // End of namespace Graphics
120 #endif // GRAPHICS_VIDEO_INDEO3_H