Module dsi_bitstream::codes::gamma
source · Expand description
Elias γ code.
The γ code of a natural number n
is the concatenation of the unary code of
⌊log₂(n + 1)⌋
and the binary representation of n + 1
with the most
significant bit removed.
The USE_TABLE
parameter enables or disables the use of
pre-computed tables for decoding.
Traits§
- Trait for reading γ codes.
- Parametric trait for reading γ codes.
- Trait for writing γ codes.
- Parametric trait for writing γ codes.
Functions§
- Return the length of the γ code for
n
using a default value forUSE_TABLE
. - Return the length of the γ code for
n
.