MythTV
master
|
#include <libmythtv/bitreader.h>
Public Member Functions | |
BitReader (const uint8_t *buffer, uint64_t size) | |
~BitReader ()=default | |
void | skip_bits (unsigned n) |
uint32_t | show_bits (unsigned n) |
uint64_t | show_bits64 (unsigned n) |
bool | next_bit () |
uint32_t | get_bits (unsigned n) |
Read 0-32 bits. More... | |
uint64_t | get_bits64 (unsigned n) |
Read 0-64 bits. More... | |
int | get_ue_golomb () |
Read an unsigned Exp-Golomb code in the range 0 to 8190 (2^13 - 2). More... | |
uint32_t | get_ue_golomb_long () |
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1. More... | |
int | get_ue_golomb_31 () |
read unsigned exp golomb code, constraint to a max of 31. More... | |
int | get_se_golomb () |
read signed exp golomb code. More... | |
int64_t | get_bits_left () |
Private Member Functions | |
int | get_ue_golomb (unsigned max_length) |
Valid for max_length <= 16. More... | |
void | refill_cache (unsigned min_bits) |
Static Private Member Functions | |
static unsigned | clz (uint32_t v) |
static constexpr uint64_t | get_upper_bits (uint64_t val, unsigned bits) |
Private Attributes | |
const uint8_t * | m_buffer |
next memory location to read from More... | |
const uint8_t *const | m_bufferEnd |
past the end pointer More... | |
unsigned | m_bitIndex {0} |
index for next bit read from the MSB More... | |
uint64_t | m_cache {0} |
cache for reads. More... | |
unsigned | m_cacheSize {0} |
Static Private Attributes | |
static constexpr unsigned | kCacheSizeMax {64} |
static constexpr unsigned | kBitsPerRead { 8} |
Definition at line 38 of file bitreader.h.
|
inline |
Definition at line 41 of file bitreader.h.
|
default |
|
inline |
Definition at line 48 of file bitreader.h.
Referenced by AVCParser::decode_SEI(), get_bits(), get_bits64(), get_ue_golomb(), get_ue_golomb_long(), and HEVCParser::profileTierLevel().
|
inline |
Definition at line 66 of file bitreader.h.
Referenced by AVCParser::decode_SEI(), get_bits(), get_ue_golomb(), and get_ue_golomb_long().
|
inline |
Definition at line 75 of file bitreader.h.
Referenced by get_bits64().
|
inline |
Definition at line 84 of file bitreader.h.
Referenced by H2645Parser::vui_parameters().
|
inline |
Read 0-32 bits.
Definition at line 86 of file bitreader.h.
Referenced by AVCParser::decode_Header(), AVCParser::decode_PPS(), AVCParser::decode_SEI(), AVCParser::decode_SPS(), get_ue_golomb_long(), next_bit(), HEVCParser::parsePPS(), HEVCParser::parseSliceSegmentHeader(), HEVCParser::parseSPS(), HEVCParser::parseVPS(), HEVCParser::profileTierLevel(), scalingListData(), shortTermRefPicSet(), and H2645Parser::vui_parameters().
|
inline |
Read 0-64 bits.
Definition at line 93 of file bitreader.h.
|
inline |
Read an unsigned Exp-Golomb code in the range 0 to 8190 (2^13 - 2).
Definition at line 105 of file bitreader.h.
Referenced by AVCParser::decode_Header(), AVCParser::decode_PPS(), AVCParser::decode_SEI(), AVCParser::decode_SPS(), get_ue_golomb_31(), HEVCParser::parsePPS(), HEVCParser::parseSliceSegmentHeader(), HEVCParser::parseSPS(), HEVCParser::parseVPS(), scalingListData(), shortTermRefPicSet(), and H2645Parser::vui_parameters().
|
inline |
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
Definition at line 115 of file bitreader.h.
Referenced by get_se_golomb(), and HEVCParser::parseVPS().
|
inline |
read unsigned exp golomb code, constraint to a max of 31.
If the value encountered is not in 0..31, the return value is outside the range 0..30.
Definition at line 136 of file bitreader.h.
Referenced by AVCParser::decode_Header().
|
inline |
read signed exp golomb code.
Definition at line 144 of file bitreader.h.
Referenced by AVCParser::decode_Header(), AVCParser::decode_PPS(), AVCParser::decode_SPS(), HEVCParser::parseSliceSegmentHeader(), and scalingListData().
|
inline |
Definition at line 156 of file bitreader.h.
Referenced by AVCParser::decode_SEI().
|
inlineprivate |
Valid for max_length <= 16.
Definition at line 226 of file bitreader.h.
|
inlinestaticprivate |
Definition at line 163 of file bitreader.h.
Referenced by get_ue_golomb(), and get_ue_golomb_long().
|
inlinestaticconstexprprivate |
Definition at line 190 of file bitreader.h.
Referenced by show_bits(), and show_bits64().
|
inlineprivate |
Definition at line 245 of file bitreader.h.
Referenced by show_bits(), and show_bits64().
|
private |
next memory location to read from
Definition at line 206 of file bitreader.h.
Referenced by get_bits_left(), refill_cache(), and skip_bits().
|
private |
past the end pointer
Definition at line 207 of file bitreader.h.
Referenced by get_bits_left(), and refill_cache().
|
private |
index for next bit read from the MSB
Definition at line 208 of file bitreader.h.
Referenced by get_bits_left(), refill_cache(), and skip_bits().
|
private |
cache for reads.
This is updated such that the next bit to read is always the Most Significant Bit.
Definition at line 216 of file bitreader.h.
Referenced by refill_cache(), show_bits(), show_bits64(), and skip_bits().
|
private |
Definition at line 217 of file bitreader.h.
Referenced by get_bits_left(), refill_cache(), show_bits(), show_bits64(), and skip_bits().
|
staticconstexprprivate |
Definition at line 219 of file bitreader.h.
Referenced by refill_cache().
|
staticconstexprprivate |
Definition at line 220 of file bitreader.h.
Referenced by get_bits_left(), refill_cache(), and skip_bits().