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

Method readUVLC

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

Source from the content-addressed store, hash-verified

201}
202
203std::tuple<uint64_t, std::string> SubByteReader::readUVLC()
204{
205 auto leadingZeros = 0u;
206 std::string coding;
207
208 while (1)
209 {
210 auto [done, done_coding] = this->readBits(1);
211 coding += done_coding;
212 if (done > 0)
213 break;
214 leadingZeros++;
215 }
216
217 if (leadingZeros >= 32)
218 return {((uint64_t)1 << 32) - 1, coding};
219 auto [value, value_coding] = this->readBits(leadingZeros);
220 coding += value_coding;
221
222 return {value + ((uint64_t)1 << leadingZeros) - 1, coding};
223}
224
225std::tuple<uint64_t, std::string> SubByteReader::readNS(uint64_t maxVal)
226{

Callers

nothing calls this directly

Calls 1

readBitsMethod · 0.95

Tested by

no test coverage detected