ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

svq1.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef IMAGE_CODECS_SVQ1_H
00024 #define IMAGE_CODECS_SVQ1_H
00025 
00026 #include "common/bitstream.h"
00027 #include "image/codecs/codec.h"
00028 
00029 namespace Common {
00030 template <class BITSTREAM>
00031 class Huffman;
00032 struct Point;
00033 }
00034 
00035 namespace Image {
00036 
00042 class SVQ1Decoder : public Codec {
00043 public:
00044     SVQ1Decoder(uint16 width, uint16 height);
00045     ~SVQ1Decoder();
00046 
00047     const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);
00048     Graphics::PixelFormat getPixelFormat() const { return _surface->format; }
00049 
00050 private:
00051     Graphics::Surface *_surface;
00052     uint16 _width, _height;
00053     uint16 _frameWidth, _frameHeight;
00054 
00055     byte *_last[3];
00056 
00057     typedef Common::Huffman<Common::BitStream32BEMSB> HuffmanDecoder;
00058 
00059     HuffmanDecoder *_blockType;
00060     HuffmanDecoder *_intraMultistage[6];
00061     HuffmanDecoder *_interMultistage[6];
00062     HuffmanDecoder *_intraMean;
00063     HuffmanDecoder *_interMean;
00064     HuffmanDecoder *_motionComponent;
00065 
00066     bool svq1DecodeBlockIntra(Common::BitStream32BEMSB *s, byte *pixels, int pitch);
00067     bool svq1DecodeBlockNonIntra(Common::BitStream32BEMSB *s, byte *pixels, int pitch);
00068     bool svq1DecodeMotionVector(Common::BitStream32BEMSB *s, Common::Point *mv, Common::Point **pmv);
00069     void svq1SkipBlock(byte *current, byte *previous, int pitch, int x, int y);
00070     bool svq1MotionInterBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch,
00071             Common::Point *motion, int x, int y);
00072     bool svq1MotionInter4vBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch,
00073             Common::Point *motion, int x, int y);
00074     bool svq1DecodeDeltaBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch,
00075             Common::Point *motion, int x, int y);
00076 
00077     void putPixels8C(byte *block, const byte *pixels, int lineSize, int h);
00078     void putPixels8L2(byte *dst, const byte *src1, const byte *src2, int dstStride, int srcStride1, int srcStride2, int h);
00079     void putPixels8X2C(byte *block, const byte *pixels, int lineSize, int h);
00080     void putPixels8Y2C(byte *block, const byte *pixels, int lineSize, int h);
00081     void putPixels8XY2C(byte *block, const byte *pixels, int lineSize, int h);
00082     void putPixels16C(byte *block, const byte *pixels, int lineSize, int h);
00083     void putPixels16X2C(byte *block, const byte *pixels, int lineSize, int h);
00084     void putPixels16Y2C(byte *block, const byte *pixels, int lineSize, int h);
00085     void putPixels16XY2C(byte *block, const byte *pixels, int lineSize, int h);
00086 };
00087 
00088 } // End of namespace Image
00089 
00090 #endif


Generated on Sat May 18 2019 05:01:21 for ResidualVM by doxygen 1.7.1
curved edge   curved edge