aboutsummaryrefslogtreecommitdiff
path: root/common/bitstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/bitstream.h')
-rw-r--r--common/bitstream.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/bitstream.h b/common/bitstream.h
index c8c8c11fca..b789f2ac8d 100644
--- a/common/bitstream.h
+++ b/common/bitstream.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -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)