Jump to content

Shannon–Fano coding

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 213.237.41.196 (talk) at 15:40, 23 April 2002 (Variable-length encoding). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A variable-length encoding based on the frequency of each character. The most frequent character is assigned 0, the next is assigned 10, the next 110, etc.

Shannon-Fano is a minimal prefix code. Huffman coding is optimal for character encoding (one character-one code word) and simple to program. Arithmetic coding is better still, since it can allocate fractional bits, but more complicated.