aboutsummaryrefslogtreecommitdiff
path: root/image/codecs/indeo5.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-08-24 19:51:06 +0200
committerGitHub2017-08-24 19:51:06 +0200
commitbd10131242210262eb23c5a62c223039cabf905c (patch)
treefe2ad03ea734f45bf79baa790a64e25923fe0072 /image/codecs/indeo5.cpp
parent265fc48d1590cdd503187c79dc254d65623c8d7b (diff)
parent4278cff7f014ba1f404b3cebfe20016b957fafbf (diff)
downloadscummvm-rg350-bd10131242210262eb23c5a62c223039cabf905c.tar.gz
scummvm-rg350-bd10131242210262eb23c5a62c223039cabf905c.tar.bz2
scummvm-rg350-bd10131242210262eb23c5a62c223039cabf905c.zip
Merge pull request #975 from wjp/bitstream
Rework and optimize Common::BitStream
Diffstat (limited to 'image/codecs/indeo5.cpp')
-rw-r--r--image/codecs/indeo5.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/image/codecs/indeo5.cpp b/image/codecs/indeo5.cpp
index aca49c3d55..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();
@@ -299,7 +299,7 @@ int Indeo5Decoder::decodeMbInfo(IVIBandDesc *band, IVITile *tile) {
mb->_qDelta = 0;
if (!band->_plane && !band->_bandNum && (_ctx._frameFlags & 8)) {
- mb->_qDelta = _ctx._gb->getVLC2(_ctx._mbVlc._tab->_table, IVI_VLC_BITS, 1);
+ mb->_qDelta = _ctx._gb->getVLC2<1>(_ctx._mbVlc._tab->_table, IVI_VLC_BITS);
mb->_qDelta = IVI_TOSIGNED(mb->_qDelta);
}
@@ -332,7 +332,7 @@ int Indeo5Decoder::decodeMbInfo(IVIBandDesc *band, IVITile *tile) {
if (refMb) mb->_qDelta = refMb->_qDelta;
} else if (mb->_cbp || (!band->_plane && !band->_bandNum &&
(_ctx._frameFlags & 8))) {
- mb->_qDelta = _ctx._gb->getVLC2(_ctx._mbVlc._tab->_table, IVI_VLC_BITS, 1);
+ mb->_qDelta = _ctx._gb->getVLC2<1>(_ctx._mbVlc._tab->_table, IVI_VLC_BITS);
mb->_qDelta = IVI_TOSIGNED(mb->_qDelta);
}
}
@@ -351,9 +351,9 @@ int Indeo5Decoder::decodeMbInfo(IVIBandDesc *band, IVITile *tile) {
}
} else {
// decode motion vector deltas
- mvDelta = _ctx._gb->getVLC2(_ctx._mbVlc._tab->_table, IVI_VLC_BITS, 1);
+ mvDelta = _ctx._gb->getVLC2<1>(_ctx._mbVlc._tab->_table, IVI_VLC_BITS);
mvY += IVI_TOSIGNED(mvDelta);
- mvDelta = _ctx._gb->getVLC2(_ctx._mbVlc._tab->_table, IVI_VLC_BITS, 1);
+ mvDelta = _ctx._gb->getVLC2<1>(_ctx._mbVlc._tab->_table, IVI_VLC_BITS);
mvX += IVI_TOSIGNED(mvDelta);
mb->_mvX = mvX;
mb->_mvY = mvY;