MCPcopy Create free account
hub / github.com/apache/arrow / PackBits

Function PackBits

cpp/src/arrow/util/bit_util.h:270–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268/// \brief Pack integers into a bitmap in batches of 8
269template <int batch_size>
270void 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
279constexpr int32_t MaxLEB128ByteLen(int32_t n_bits) {
280 return static_cast<int32_t>(CeilDiv(n_bits, 7));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected