MCPcopy Create free account
hub / github.com/IENT/YUView / readLEB128

Method readLEB128

YUViewLib/src/parser/common/SubByteReader.cpp:184–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184std::tuple<uint64_t, std::string> SubByteReader::readLEB128()
185{
186 // We will read full bytes (up to 8)
187 // The highest bit indicates if we need to read another bit. The rest of the
188 // bits is added to the counter (shifted accordingly) See the AV1 reading
189 // specification
190 uint64_t value = 0;
191 std::string coding;
192 for (unsigned i = 0; i < 8; i++)
193 {
194 auto [leb128_byte, leb128_byte_coding] = this->readBits(8);
195 coding += leb128_byte_coding;
196 value |= ((leb128_byte & 0x7f) << (i * 7));
197 if (!(leb128_byte & 0x80))
198 break;
199 }
200 return {value, coding};
201}
202
203std::tuple<uint64_t, std::string> SubByteReader::readUVLC()
204{

Callers 2

parseMethod · 0.45
checkForObuFormatFunction · 0.45

Calls 1

readBitsMethod · 0.95

Tested by

no test coverage detected