Skip to main content

Module bitpack

Module bitpack 

Source
Expand description

Bitstream packer/unpacker for arbitrary bit widths (1-8).

Uses a 64-bit accumulator for sub-byte codes with no alignment padding.

Functionsยง

pack
Pack unsigned codes of bits width into a byte stream.
qmax_from_bits
Compute qmax for a given bit width: 2^(bits-1) - 1.
unpack
Unpack count unsigned codes of bits width from a byte stream.