3 ms·
JPEGs use Huffman coding to convert a series of bytes (DCT coefficients) into a series of bits. Huffman coding is optimal if each member of the input distributi
by Scaevolus 10y ago
JPEGs use Huffman coding to convert a series of bytes (DCT coefficients) into a series of bits. Huffman coding is optimal if each member of the input distribution has a 1/2^n probability (e.g., if 1/2 of the input is 0, you could represent that with just one zero bit).
Arithmetic coding allows fractional probability distributions to be represented. It's usually at least 10% more efficient than Huffman coding.
- londons_explore 10y agoJust to clarify, both Huffman and arithmetic coding are lossless. It's other parts of JPEG compression which lead to quality loss, and those parts aren't recompressed.
- mememachine 10y agospecifically its how many DCT coefficients you keep i believe