5 #ifndef MEDIA_BASE_BIT_READER_H_
6 #define MEDIA_BASE_BIT_READER_H_
11 #include "packager/base/logging.h"
22 BitReader(
const uint8_t* data, off_t size);
36 DCHECK_LE(num_bits, static_cast<int>(
sizeof(T) * 8));
38 bool ret = ReadBitsInternal(num_bits, &temp);
39 *out =
static_cast<T
>(temp);
61 bool condition_read =
true;
64 return condition_read == condition ?
SkipBits(num_bits) :
true;
77 return 8 * bytes_left_ + num_remaining_bits_in_curr_byte_;
85 bool ReadBitsInternal(
int num_bits, uint64_t* out);
90 void UpdateCurrByte();
107 int num_remaining_bits_in_curr_byte_;
116 #endif // MEDIA_BASE_BIT_READER_H_