diff options
author | Willem Jan Palenstijn | 2017-07-24 21:01:19 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2017-08-24 19:46:59 +0200 |
commit | dde259f06813534c7179a714403d8fd6fe918d09 (patch) | |
tree | 1379a5c2600057ba53032c722e3a5a1578db8507 /image/codecs | |
parent | 265fc48d1590cdd503187c79dc254d65623c8d7b (diff) | |
download | scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.tar.gz scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.tar.bz2 scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.zip |
COMMON: Remove BitStream base class to allow inlining calls
All users of BitStream were in fact using a specific, hardcoded variant,
so we can hardcode that variant, removing the need for virtual calls,
and enabling inlining.
Diffstat (limited to 'image/codecs')
-rw-r--r-- | image/codecs/svq1.cpp | 12 | ||||
-rw-r--r-- | image/codecs/svq1.h | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/image/codecs/svq1.cpp b/image/codecs/svq1.cpp index 765d512797..2d86070801 100644 --- a/image/codecs/svq1.cpp +++ b/image/codecs/svq1.cpp @@ -282,7 +282,7 @@ const Graphics::Surface *SVQ1Decoder::decodeFrame(Common::SeekableReadStream &st return _surface; } -bool SVQ1Decoder::svq1DecodeBlockIntra(Common::BitStream *s, byte *pixels, int pitch) { +bool SVQ1Decoder::svq1DecodeBlockIntra(Common::BitStream32BEMSB *s, byte *pixels, int pitch) { // initialize list for breadth first processing of vectors byte *list[63]; list[0] = pixels; @@ -383,7 +383,7 @@ bool SVQ1Decoder::svq1DecodeBlockIntra(Common::BitStream *s, byte *pixels, int p return true; } -bool SVQ1Decoder::svq1DecodeBlockNonIntra(Common::BitStream *s, byte *pixels, int pitch) { +bool SVQ1Decoder::svq1DecodeBlockNonIntra(Common::BitStream32BEMSB *s, byte *pixels, int pitch) { // initialize list for breadth first processing of vectors byte *list[63]; list[0] = pixels; @@ -497,7 +497,7 @@ static inline int midPred(int a, int b, int c) { return b; } -bool SVQ1Decoder::svq1DecodeMotionVector(Common::BitStream *s, Common::Point *mv, Common::Point **pmv) { +bool SVQ1Decoder::svq1DecodeMotionVector(Common::BitStream32BEMSB *s, Common::Point *mv, Common::Point **pmv) { for (int i = 0; i < 2; i++) { // get motion code int diff = _motionComponent->getSymbol(*s); @@ -611,7 +611,7 @@ void SVQ1Decoder::putPixels16XY2C(byte *block, const byte *pixels, int lineSize, putPixels8XY2C(block + 8, pixels + 8, lineSize, h); } -bool SVQ1Decoder::svq1MotionInterBlock(Common::BitStream *ss, byte *current, byte *previous, int pitch, +bool SVQ1Decoder::svq1MotionInterBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch, Common::Point *motion, int x, int y) { // predict and decode motion vector @@ -662,7 +662,7 @@ bool SVQ1Decoder::svq1MotionInterBlock(Common::BitStream *ss, byte *current, byt return true; } -bool SVQ1Decoder::svq1MotionInter4vBlock(Common::BitStream *ss, byte *current, byte *previous, int pitch, +bool SVQ1Decoder::svq1MotionInter4vBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch, Common::Point *motion, int x, int y) { // predict and decode motion vector (0) Common::Point *pmv[4]; @@ -749,7 +749,7 @@ bool SVQ1Decoder::svq1MotionInter4vBlock(Common::BitStream *ss, byte *current, b return true; } -bool SVQ1Decoder::svq1DecodeDeltaBlock(Common::BitStream *ss, byte *current, byte *previous, int pitch, +bool SVQ1Decoder::svq1DecodeDeltaBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch, Common::Point *motion, int x, int y) { // get block type uint32 blockType = _blockType->getSymbol(*ss); diff --git a/image/codecs/svq1.h b/image/codecs/svq1.h index 236b810294..148501d17f 100644 --- a/image/codecs/svq1.h +++ b/image/codecs/svq1.h @@ -23,10 +23,10 @@ #ifndef IMAGE_CODECS_SVQ1_H #define IMAGE_CODECS_SVQ1_H +#include "common/bitstream.h" #include "image/codecs/codec.h" namespace Common { -class BitStream; class Huffman; struct Point; } @@ -60,15 +60,15 @@ private: Common::Huffman *_interMean; Common::Huffman *_motionComponent; - bool svq1DecodeBlockIntra(Common::BitStream *s, byte *pixels, int pitch); - bool svq1DecodeBlockNonIntra(Common::BitStream *s, byte *pixels, int pitch); - bool svq1DecodeMotionVector(Common::BitStream *s, Common::Point *mv, Common::Point **pmv); + bool svq1DecodeBlockIntra(Common::BitStream32BEMSB *s, byte *pixels, int pitch); + bool svq1DecodeBlockNonIntra(Common::BitStream32BEMSB *s, byte *pixels, int pitch); + bool svq1DecodeMotionVector(Common::BitStream32BEMSB *s, Common::Point *mv, Common::Point **pmv); void svq1SkipBlock(byte *current, byte *previous, int pitch, int x, int y); - bool svq1MotionInterBlock(Common::BitStream *ss, byte *current, byte *previous, int pitch, + bool svq1MotionInterBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch, Common::Point *motion, int x, int y); - bool svq1MotionInter4vBlock(Common::BitStream *ss, byte *current, byte *previous, int pitch, + bool svq1MotionInter4vBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch, Common::Point *motion, int x, int y); - bool svq1DecodeDeltaBlock(Common::BitStream *ss, byte *current, byte *previous, int pitch, + bool svq1DecodeDeltaBlock(Common::BitStream32BEMSB *ss, byte *current, byte *previous, int pitch, Common::Point *motion, int x, int y); void putPixels8C(byte *block, const byte *pixels, int lineSize, int h); |