IMAGE: Fix some confusion of bytes vs bits in Indeo decoders

This commit is contained in:
Paul Gilbert 2016-11-18 21:04:12 -05:00
parent 91d61b2cdb
commit 4888433c46
6 changed files with 10 additions and 10 deletions

View file

@ -466,8 +466,8 @@ IVI45DecContext::IVI45DecContext() : _gb(nullptr), _frameNum(0), _frameType(0),
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height, uint bytesPerPixel) : Codec() { IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height, uint bitsPerPixel) : Codec() {
switch (bytesPerPixel) { switch (bitsPerPixel) {
case 16: case 16:
_pixelFormat = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); _pixelFormat = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
break; break;
@ -484,7 +484,7 @@ IndeoDecoderBase::IndeoDecoderBase(uint16 width, uint16 height, uint bytesPerPix
_surface = new Graphics::Surface(); _surface = new Graphics::Surface();
_surface->create(width, height, _pixelFormat); _surface->create(width, height, _pixelFormat);
_surface->fillRect(Common::Rect(0, 0, width, height), (bytesPerPixel == 4) ? 0xff : 0); _surface->fillRect(Common::Rect(0, 0, width, height), (bitsPerPixel == 32) ? 0xff : 0);
_ctx._bRefBuf = 3; // buffer 2 is used for scalability mode _ctx._bRefBuf = 3; // buffer 2 is used for scalability mode
} }

View file

@ -574,7 +574,7 @@ protected:
*/ */
int scaleMV(int mv, int mvScale); int scaleMV(int mv, int mvScale);
public: public:
IndeoDecoderBase(uint16 width, uint16 height, uint bytesPerPixel); IndeoDecoderBase(uint16 width, uint16 height, uint bitsPerPixel);
virtual ~IndeoDecoderBase(); virtual ~IndeoDecoderBase();
}; };

View file

@ -37,8 +37,8 @@ namespace Image {
#define IVI4_PIC_SIZE_ESC 7 #define IVI4_PIC_SIZE_ESC 7
Indeo4Decoder::Indeo4Decoder(uint16 width, uint16 height, uint bytesPerPixel) : Indeo4Decoder::Indeo4Decoder(uint16 width, uint16 height, uint bitsPerPixel) :
IndeoDecoderBase(width, height, bytesPerPixel) { IndeoDecoderBase(width, height, bitsPerPixel) {
_ctx._isIndeo4 = true; _ctx._isIndeo4 = true;
_ctx._refBuf = 1; _ctx._refBuf = 1;
_ctx._bRefBuf = 3; _ctx._bRefBuf = 3;

View file

@ -52,7 +52,7 @@ class Indeo4Decoder : public IndeoDecoderBase {
bool _is2dTrans; bool _is2dTrans;
}; };
public: public:
Indeo4Decoder(uint16 width, uint16 height, uint bytesPerPixel = 2); Indeo4Decoder(uint16 width, uint16 height, uint bitsPerPixel = 16);
virtual ~Indeo4Decoder() {} virtual ~Indeo4Decoder() {}
virtual const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream); virtual const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);

View file

@ -48,8 +48,8 @@ enum {
#define IVI5_PIC_SIZE_ESC 15 #define IVI5_PIC_SIZE_ESC 15
Indeo5Decoder::Indeo5Decoder(uint16 width, uint16 height, uint bytesPerPixel) : Indeo5Decoder::Indeo5Decoder(uint16 width, uint16 height, uint bitsPerPixel) :
IndeoDecoderBase(width, height, bytesPerPixel) { IndeoDecoderBase(width, height, bitsPerPixel) {
_ctx._isIndeo4 = false; _ctx._isIndeo4 = false;
_ctx._refBuf = 1; _ctx._refBuf = 1;
_ctx._bRefBuf = 3; _ctx._bRefBuf = 3;

View file

@ -52,7 +52,7 @@ class Indeo5Decoder : public IndeoDecoderBase {
int is_2d_trans; int is_2d_trans;
}; };
public: public:
Indeo5Decoder(uint16 width, uint16 height, uint bytesPerPixel = 2); Indeo5Decoder(uint16 width, uint16 height, uint bitsPerPixel = 16);
virtual ~Indeo5Decoder() {} virtual ~Indeo5Decoder() {}
virtual const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream); virtual const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);