Elias delta code is a universal code encoding the positive integers. To code a number: In data compression, a universal code maps the integers (representing messages) onto self-delimiting binary codewords. ...
Write it in binary.
Count the bits, remove the leading one, and write that number in binary preceding the previous bit string.
Subtract 1 from the number of bits written in step 2 and prepend that many zeros.
An equivalent way to express the same process:
Separate the integer into the highest power of 2 it contains (2N) and the remaining N binary digits of the integer.
Read and count zeroes from the stream until you reach the first one. Call this count of zeroes L.
Considering the one that was reached to be the first digit of an integer, with a value of 2L, read the remaining L digits of the integer. Call this integer M.
Put a one in the first place of our final output, representing the value 2M. Read and append the following M digits.
See also:Elias gamma coding, Elias omega coding Elias gamma code is a universal code encoding the positive integers. ... Elias omega coding is a universal code encoding the positive integers. ...
Elias omega coding is a universal code encoding the positive integers.
Like Elias gamma coding and Eliasdeltacoding, it works by prefixing the integer with a representation of its order of magnitude in a universal code.
Omega coding is used in applications where the largest encoded value is not known ahead of time, or to compress data in which small values are much more frequent than large values.
3.3 Universal Codes and Representations of the Integers
The result is an instantaneously decodable code since the total length of a codeword is exactly one greater than twice the number of zeros in the prefix; therefore, as soon as the first 1 of a codeword is encountered, its length is known.
The code is not a minimum redundancy code since the ratio of expected codeword length to entropy goes to 2 as entropy approaches infinity.