Content deleted Content added
trying to make more understandable to a broad audience. I've made it too long now. help condense it. |
added constraint for Huffman generating fixed length code |
||
Line 84:
There are many variable-length codes. When compressing data, we wonder -- which one is the best code ? (Which code compresses the file into the fewest number of bits ?)
If one knows ahead of time all the letters that could possibly be used, and has a good estimate of the [[letter frequencies]], the best possible comma-free code is a [[Huffman code]]. (Usually the Huffman process generates a variable-length code. But when all the letters have the same frequency, such as previously compressed or encrypted data, and additionally the number of codewords is a power of the alphabet size the Huffman process will generate a fixed-length code.)
All other codes use *more* bits than a Huffman code. (Usually there are several Huffman codes, all of which compress the file into exactly the same number of bits).
|