4 ms·
Modern compression has an entropy code step where you have a probability of seeing a symbol. And yet DEFLATE, the algorithm zlib is based on, uses Huffman codin
by Jasper_ 11y ago
Modern compression has an entropy code step where you have a probability of seeing a symbol. And yet DEFLATE, the algorithm zlib is based on, uses Huffman coding, which means probabilities can only be integers. Arithmetic coders (like Brotli uses) and ANS-based coders (like BitKnit uses) have support for fractional probabilities. So already, the improved entropy encode step means that you get some gains. They're not perfect in any case, but they're a wide improvement on most data.
zlib, the library, isn't even perfect. You can easily get more out of DEFLATE by simply replacing the compressor with a smarter one, e.g. Zopfli.