Add 64-bit version of BitBuffer::ReadBits

Bug: webrtc:11933
Change-Id: Ie935192d2c81d7c24b83561711d59a7eff53db04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215966
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33997}
This commit is contained in:
Björn Terelius
2021-05-11 15:30:12 +02:00
committed by WebRTC LUCI CQ
parent bd09a46aa1
commit 39284360b0
3 changed files with 72 additions and 0 deletions

View File

@ -45,11 +45,13 @@ class BitBuffer {
// Reads bit-sized values from the buffer. Returns false if there isn't enough
// data left for the specified bit count.
bool ReadBits(uint32_t* val, size_t bit_count);
bool ReadBits(uint64_t* val, size_t bit_count);
// Peeks bit-sized values from the buffer. Returns false if there isn't enough
// data left for the specified number of bits. Doesn't move the current
// offset.
bool PeekBits(uint32_t* val, size_t bit_count);
bool PeekBits(uint64_t* val, size_t bit_count);
// Reads value in range [0, num_values - 1].
// This encoding is similar to ReadBits(val, Ceil(Log2(num_values)),