| 268 | /// \brief Pack integers into a bitmap in batches of 8 |
| 269 | template <int batch_size> |
| 270 | void PackBits(const uint32_t* values, uint8_t* out) { |
| 271 | for (int i = 0; i < batch_size / 8; ++i) { |
| 272 | *out++ = static_cast<uint8_t>(values[0] | values[1] << 1 | values[2] << 2 | |
| 273 | values[3] << 3 | values[4] << 4 | values[5] << 5 | |
| 274 | values[6] << 6 | values[7] << 7); |
| 275 | values += 8; |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | constexpr int32_t MaxLEB128ByteLen(int32_t n_bits) { |
| 280 | return static_cast<int32_t>(CeilDiv(n_bits, 7)); |
nothing calls this directly
no outgoing calls
no test coverage detected