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:
“Exporting Church employees to Latin America masks a universal and unconscious fear of a new Church. North and South American authorities, differently motivated but equally fearful, become accomplices in maintaining a clerical and irrelevant Church. Sacralizing employees and property, this Church becomes progressively more blind to the possibilities of sacralizing person and community.”
—Ivan Illich (b. 1926)
“It is long ere we discover how rich we are. Our history, we are sure, is quite tame: we have nothing to write, nothing to infer. But our wiser years still run back to the despised recollections of childhood, and always we are fishing up some wonderful article out of that pond; until, by and by, we begin to suspect that the biography of the one foolish person we know is, in reality, nothing less than the miniature paraphrase of the hundred volumes of the Universal History.”
—Ralph Waldo Emerson (18031882)
“I cannot help thinking that the menace of Hell makes as many devils as the severe penal codes of inhuman humanity make villains.”
—George Gordon Noel Byron (17881824)