Crate packagemerge

Source
Expand description

This crate implements the package-merge algorithm. The package-merge algorithm is able to compute an optimal length-limited prefix-free code. As such, it might be useful for data compression purposes much like the Huffman algorithm. But Huffman’s algorithm does not allow you do constrain the maximum length of all code words.

Enums§

Error
The error type for the package-merge algorithm

Functions§

package_merge
Given all symbol frequencies (or probabilities) and a limit on the maximum length of code words (up to 32), this function will apply the package merge algorithm to compute optimal code word lengths for the symbols so that the expected code word length is minimized.