Cyan4973/FiniteStateEntropy
FreeNew generation entropy codecs : Finite State Entropy and Huff0
About Cyan4973/FiniteStateEntropy
FiniteStateEntropy (FSE) and Huff0 are two high-speed entropy coding libraries written in C. Huff0 is a Huffman codec optimized for modern CPUs, leveraging out-of-order (OoO) operations on multiple ALUs to achieve extremely fast compression (up to 600 MB/s) and decompression (up to 1350 MB/s). FSE is a novel entropy encoder based on Asymmetric Numeral Systems (ANS) theory by Jarek Duda, offering compression accuracy close to the Shannon limit (similar to arithmetic coding) at significantly higher speeds (up to 325 MB/s compression, 440 MB/s decompression). The library is released under the BSD-2-Clause license and includes benchmark programs, sample probability distributions, and a clear branch policy (master for stable releases, dev for contributions). It is designed for integration into applications requiring efficient, low-level entropy coding.
Key Features
Pros & Cons
- Extremely high compression and decompression speeds, especially Huff0
- FSE achieves compression accuracy close to the Shannon limit, outperforming Huffman on squeezed distributions
- Designed for modern CPU architectures with OoO execution capabilities
- Open source and freely available under a permissive BSD-2-Clause license
- Actively maintained with a clear contribution branch policy
- Portable C implementation with minimal dependencies
- Comprehensive benchmark data provided for comparison with zlibh
- Huff0 cannot compress below 1 bit per symbol, making it less efficient on highly entropic data (e.g., near-uniform distributions)
- FSE compression and decompression speeds are lower than Huff0 (e.g., 325 MB/s vs 600 MB/s compression)
- Library focuses solely on entropy coding; users must integrate it into a full compression framework
- Requires C programming knowledge to use; no high-level language bindings or wrappers mentioned
- Limited documentation beyond the README; no API reference directly provided