Estimate the average code length and compression efficiency from symbol frequencies per Huffman coding.
输入频率(或概率,归一化后结果一致)。
| Item | Formula / Rule | Source / Standard |
|---|---|---|
| Average length | L = ∑ pi · li where li is the codeword length of symbol i | Huffman, A Method for the Construction of Minimum-Redundancy Codes, 1952 |
| Optimality bound | H(X) ≤ L < H(X) + 1, so Huffman coding exceeds entropy by less than one bit | Shannon 1948 / Huffman 1952 §1 |
| Coding efficiency | Efficiency = H(X) / L and redundancy = 1 − H(X) / L | ISO/IEC 2382 Information technology vocabulary — data compression |