Expand description
Bit packing utilities for chunk persistence.
Uses only power-of-2 bit widths (1, 2, 4, 8, 16) to avoid entries spanning u64 boundaries, which simplifies encoding/decoding and improves performance.
Functionsยง
- bits_
for_ palette_ len - Calculates the number of bits needed to represent indices into a palette. Only returns power-of-2 values: 1, 2, 4, 8, or 16.
- pack_
indices - Packs indices into a compact bit array using power-of-2 bit widths.
- unpack_
indices - Unpacks indices from a compact bit array.