Expand description
Elias δ code.
The δ code of a natural number n is the concatenation of the γ code of ⌊log₂(n + 1)⌋ and the binary representation of n + 1 with the most significant bit removed.
The implied distribution of the δ code is ≈ 1/2x(log x)².
The USE_DELTA_TABLE
parameter enables or disables the use of pre-computed
tables for decoding δ codes, and the USE_GAMMA_TABLE
parameter enables or
disables the use of pre-computed tables for decoding the the initial γ code
in case the whole δ code could not be decoded by tables.
§References
Peter Elias, “Universal codeword sets and representations of the integers”. IEEE Transactions on Information Theory, 21(2):194−203, March 1975.
Traits§
- Delta
Read - Trait for reading δ codes.
- Delta
Read Param - Parametric trait for reading δ codes.
- Delta
Write - Trait for writing δ codes.
- Delta
Write Param - Parametric trait for writing δ codes.
Functions§
- len_
delta - Returns the length of the δ code for
n
using a default value forUSE_DELTA_TABLE
andUSE_GAMMA_TABLE
. - len_
delta_ param - Returns the length of the δ code for
n
.