++ ++
GeoZL

codec / terminal · 1→1 / lossless

pfor

Spend only the bits each block needs.

pfor stores integers in blocks of 256. Within each block, most values use the same small number of bits. If a value needs more, only its extra bits go into a short exception list. Use it as the last codec in a recipe when the remaining values are small but do not repeat, and fast decoding matters more than squeezing out the smallest possible file. In planar>zigzag>pfor, the preceding planar and Zigzag stages are fused; PFOR's block format itself is unchanged.

ctid
0x72D70D
header
uint64 count · uint8 element width
block
256 values · b bits each · exceptions patched
layout
lane interleaved over a 16-byte group
credit
design after TurboPFor by powturbo and contributors
Code geozl.lossless.Pfor()
pfor packs a block of 256 values at the bit width the block needs and patches the values that overflow it