JPEG Compression: Arithmetic vs Huffman Coding

Arithmetic coding in JPEG typically achieves a 10% to 15% reduction in file size compared to Huffman coding at the exact same image quality, with gains occasionally reaching up to 20% on specific, highly redundant image content. While the JPEG specification (ITU-T T.81 / ISO/IEC 10918-1) defines both entropy methods, Huffman coding became the universal standard due to historical patent constraints and lower computational demands.

Compression Efficiency Differences

In standard JPEG compression, discrete cosine transform (DCT) coefficients are quantized and then passed to an entropy encoder. Huffman coding assigns integer numbers of bits to each symbol based on probability. This creates an inherent mathematical inefficiency: if a symbol's ideal information content is 1.4 bits, Huffman coding must round up to at least 2 bits unless complex grouping strategies are employed.

Arithmetic coding resolves this limitation by treating the entire stream of quantized coefficients as a single number along a continuous probability interval between 0.0 and 1.0. This allows fractional bits per symbol, bringing the compression rate much closer to the theoretical Shannon entropy limit. In practice, this theoretical advantage produces the following empirical results in JPEG:

Why Huffman Coding Became Dominant

Despite the clear size reduction offered by arithmetic coding, several practical factors limited its adoption in consumer JPEG decoders and web standards: