Shannon-fano Coding

In the field of data compression, Shannon-Fano coding is a technique for constructing a prefix code based on a set of symbols and their probabilities (estimated or measured). The symbols are arranged in order from most probable to least probable, and then divided into two sets whose total probabilities are as close as possible to being equal. All symbols then have the first digits of their codes assigned; symbols in the first set receive "0" and symbols in the second set receive "1". As long as any sets with more than one member remain, the same process is repeated on those sets, to determine successive digits of their codes. When a set has been reduced to one symbol, of course, this means the symbol's code is complete and will not form the prefix of any other symbol's code. The algorithm works, and it produces fairly efficient variable-length encodings; when the two smaller sets produced by a partitioning are in fact of equal probability, the one bit of information used to distinguish them is used most efficiently. Unfortunately, Shannon-Fano does not always produce optimal prefix codes; the set of probabilities (.35, .17, .17, .16, .15) is an example of one that will be assigned non-optimal codes by Shannon-Fano. For this reason, Shannon-Fano is almost never used; Huffman coding is almost as computationally simple and always produces optimal prefix codes -- optimal, that is, under the constraints that each symbol is represented by a code formed of an integral number of bits. This is a constraint that is often unneeded, since the codes will be packed end-to-end in long sequences. In such situations, arithmetic coding can produce greater overall compression than either Huffman or Shannon-Fano, since it can encode in fractional numbers of bits which more closely approximate the actual information content of the symbol. However, arithmetic coding has not obsoleted Huffman the way that Huffman obsoletes Shannon-Fano, both because arithmetic coding is more computationally expensive and because it is covered by multiple patents.

See also

 

<< PreviousWord BrowserNext >>
244 bc
245 bc
247 bc
248 bc
251 bc
252 bc
253 bc
254 bc
257 bc
258 bc
259 bc
261 bc
262 bc
263 bc
265 bc
willie mays
model united nations
governor of california
list of french monarchs
southern california
mimosoideae
sea level
266 bc
charles x of france
carloman
pippin of landen
arithmetic coding
pippin of herstal
joseph bonaparte
displacement
theuderic i of austrasia
lucien bonaparte
theodebert i
theodebald
pierre napoleon bonaparte
louis lucien bonaparte
clotilde
mouth
nausea
bendigo, victoria
blue mountains
motion sickness
napoleon iii of france
georg ritter von trapp