Apex › Data & encoding

Golomb-Rice coding

The variable-length integer code that's optimal when small values dominate — audio residuals, gaps between events, sparse bitmaps. Split a number into a quotient sent in unary and a remainder in k binary bits; tiny values get tiny codes. Tune the parameter k and watch the bits-per-value curve find its sweet spot.

More in Data & encoding