diff options
author | Willem Jan Palenstijn | 2017-07-24 22:16:53 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2017-08-24 19:46:59 +0200 |
commit | edfdbb9dd749cde96c1e155a1e5e5e00856adcc1 (patch) | |
tree | 92b768d2182e0055f0f11ccc322dc118d666f6e5 /image | |
parent | 0c8f95603faca0f5a185bd421b34684645ed8b4d (diff) | |
download | scummvm-rg350-edfdbb9dd749cde96c1e155a1e5e5e00856adcc1.tar.gz scummvm-rg350-edfdbb9dd749cde96c1e155a1e5e5e00856adcc1.tar.bz2 scummvm-rg350-edfdbb9dd749cde96c1e155a1e5e5e00856adcc1.zip |
IMAGE: Use new BitStreamMemory class for indeo
Diffstat (limited to 'image')
-rw-r--r-- | image/codecs/indeo/get_bits.h | 5 | ||||
-rw-r--r-- | image/codecs/indeo4.cpp | 4 | ||||
-rw-r--r-- | image/codecs/indeo5.cpp | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/image/codecs/indeo/get_bits.h b/image/codecs/indeo/get_bits.h index c2d593bfb5..f972e68ae0 100644 --- a/image/codecs/indeo/get_bits.h +++ b/image/codecs/indeo/get_bits.h @@ -31,15 +31,14 @@ namespace Indeo { /** * Intel Indeo Bitstream reader */ -class GetBits : public Common::BitStream8LSB { +class GetBits : public Common::BitStreamMemory8LSB { public: /** * Constructor * @param stream Source stream to reader from * @param disposeAfterUse Whether to destroy stream in destructor */ - GetBits(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse - = DisposeAfterUse::YES) : Common::BitStream8LSB(stream, disposeAfterUse) {} + GetBits(const uint8 *ptr, uint32 size) : Common::BitStreamMemory8LSB(new Common::BitStreamMemoryStream(ptr, size), DisposeAfterUse::YES) {} /** * The number of bits left diff --git a/image/codecs/indeo4.cpp b/image/codecs/indeo4.cpp index 4658068b27..ead1d3a814 100644 --- a/image/codecs/indeo4.cpp +++ b/image/codecs/indeo4.cpp @@ -56,7 +56,7 @@ bool Indeo4Decoder::isIndeo4(Common::SeekableReadStream &stream) { stream.seek(-16, SEEK_CUR); // Validate the first 18-bit word has the correct identifier - Indeo::GetBits gb(new Common::MemoryReadStream(buffer, 16 * 8), DisposeAfterUse::YES); + Indeo::GetBits gb(buffer, 16 * 8); bool isIndeo4 = gb.getBits(18) == 0x3FFF8; return isIndeo4; @@ -74,7 +74,7 @@ const Graphics::Surface *Indeo4Decoder::decodeFrame(Common::SeekableReadStream & _ctx._frameSize = stream.size(); // Set up the GetBits instance for reading the data - _ctx._gb = new GetBits(new Common::MemoryReadStream(_ctx._frameData, _ctx._frameSize)); + _ctx._gb = new GetBits(_ctx._frameData, _ctx._frameSize); // Decode the frame int err = decodeIndeoFrame(); diff --git a/image/codecs/indeo5.cpp b/image/codecs/indeo5.cpp index 858c634704..c4e98d4ac7 100644 --- a/image/codecs/indeo5.cpp +++ b/image/codecs/indeo5.cpp @@ -67,7 +67,7 @@ bool Indeo5Decoder::isIndeo5(Common::SeekableReadStream &stream) { stream.seek(-16, SEEK_CUR); // Validate the first 5-bit word has the correct identifier - Indeo::GetBits gb(new Common::MemoryReadStream(buffer, 16 * 8)); + Indeo::GetBits gb(buffer, 16 * 8); bool isIndeo5 = gb.getBits(5) == 0x1F; return isIndeo5; @@ -85,7 +85,7 @@ const Graphics::Surface *Indeo5Decoder::decodeFrame(Common::SeekableReadStream & _ctx._frameSize = stream.size(); // Set up the GetBits instance for reading the data - _ctx._gb = new GetBits(new Common::MemoryReadStream(_ctx._frameData, _ctx._frameSize)); + _ctx._gb = new GetBits(_ctx._frameData, _ctx._frameSize); // Decode the frame int err = decodeIndeoFrame(); |