Universal and Non-universal Codes
These are some universal codes for integers; an asterisk (*) indicates a code that can be trivially restated in lexicographical order, while a double dagger (‡) indicates a code that is asymptotically optimal:
- Elias gamma coding *
- Elias delta coding * ‡
- Elias omega coding * ‡
- Exp-Golomb coding *, which has Elias gamma coding as a special case. (Used in H.264/MPEG-4 AVC)
- Fibonacci coding
- Levenstein coding * ‡, the original universal coding technique
- Byte coding, also known as comma coding, where a special bit pattern (with at least two bits) is used to mark the end of the code — for example, if an integer is encoded as a sequence of nibbles representing digits in base 15 instead of the more natural base 16, then the highest nibble value (i.e., a sequence of four ones in binary) can be used to indicate the end of the integer.
These are non-universal ones:
- unary coding, which is used in Elias codes
- Rice coding, which is used in the FLAC audio codec and which has unary coding as a special case
- Golomb coding, which has Rice coding and unary coding as special cases.
Their nonuniversality can be observed by noticing that, if any of these are used to code the Gauss–Kuzmin distribution or the Zeta distribution with parameter s=2, expected codeword length is infinite. For example, using unary coding on the Zeta distribution yields an expected length of
On the other hand, using the universal Elias gamma coding for the Gauss–Kuzmin distribution results in an expected codeword length (about 3.51 bits) near entropy (about 3.43 bits).
Read more about this topic: Universal Code (data Compression)
Famous quotes containing the words universal and, universal and/or codes:
“Example is a bright looking-glass, universal and for all shapes to look into.”
—Michel de Montaigne (15331592)
“The basis of world peace is the teaching which runs through almost all the great religions of the world. Love thy neighbor as thyself. Christ, some of the other great Jewish teachers, Buddha, all preached it. Their followers forgot it. What is the trouble between capital and labor, what is the trouble in many of our communities, but rather a universal forgetting that this teaching is one of our first obligations.”
—Eleanor Roosevelt (18841962)
“We must trust infinitely to the beneficent necessity which shines through all laws. Human nature expresses itself in them as characteristically as in statues, or songs, or railroads, and an abstract of the codes of nations would be an abstract of the common conscience.”
—Ralph Waldo Emerson (18031882)