| 182 | } |
| 183 | |
| 184 | std::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 | |
| 203 | std::tuple<uint64_t, std::string> SubByteReader::readUVLC() |
| 204 | { |
no test coverage detected