From c41ebe6f452d40cb84359aeff909e21cf6c4db29 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 9 Jun 2014 11:40:20 +0300 Subject: COMMON: Added align() method for BitStream --- common/bitstream.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common') diff --git a/common/bitstream.h b/common/bitstream.h index 0fe16b5beb..b789f2ac8d 100644 --- a/common/bitstream.h +++ b/common/bitstream.h @@ -52,6 +52,9 @@ public: /** Skip the specified amount of bits. */ virtual void skip(uint32 n) = 0; + /** Skip the bits to closest data value border. */ + virtual void align() = 0; + /** Read a bit from the bit stream. */ virtual uint32 getBit() = 0; @@ -276,6 +279,12 @@ public: getBit(); } + /** Skip the bits to closest data value border. */ + void align() { + while (_inValue) + getBit(); + } + /** Return the stream position in bits. */ uint32 pos() const { if (_stream->pos() == 0) -- cgit v1.2.3