Image for Golomb coding

Golomb coding

Golomb coding is a data compression method that efficiently encodes numbers by using a parameter, M, to represent frequent small values with fewer bits. It separates each number into two parts: a quotient, obtained by dividing the number by M, and a remainder, which is the leftover. The quotient is encoded using unary coding (a series of ones followed by a zero), while the remainder is encoded with a fixed number of bits. This approach is especially effective when data has a predictable distribution, such as many small numbers, reducing the overall size needed to store or transmit the data.