++ ++
GeoZL

codec / predictor + mapping · 2D / lossless

planar_zigzag

The fused version of Planar + Zigzag.

Planar: r = sample − (W + N − NW)
Zigzag: z = (r << 1) ^ (r >> (bits − 1))
Example: r = [0, −1, 1, −2, 2] → z = [0, 1, 2, 3, 4]

ctid
0x72D70F
header
uint32 · row width in samples
+ uint32 · plane count, when above one
widths
8 · 16 · 32 · 64-bit integers
decode
inverse Zigzag, then planar reconstruction
next
a packer or entropy stage; planar_zigzag_pfor folds that in too
Code geozl.lossless.PlanarZigzag(width, planes=1)
Zigzag maps signed planar residuals 0, minus 1, 1, minus 2, 2 to unsigned values 0, 1, 2, 3, 4