Overview
Elias gamma coding is compact for small positive integers and does not require a separate probability model.
Encodes positive integers with a unary length prefix and binary payload.
Compact metadata for implementation and discovery.
Elias gamma coding is compact for small positive integers and does not require a separate probability model.
Quick facts
Runtime and memory behavior at a glance.
Best
O(log n)
Average
O(log n)
Worst
O(log n)
Space
O(1)
length(n) = 2 * floor(log2(n)) + 1Counts unary length bits plus the remaining binary payload bits.
Show symbols being transformed into codes and reconstructed by the decoder state.
Elias Gamma Coding should be used with the assumptions and tradeoffs of universal Integer Coding in mind.
What each reference supports for this entry.
Reference for universal codeword sets including Elias-style integer codes.
Open sourceCompression textbook support for Elias Gamma Coding's coding model, decoder behavior, and implementation tradeoffs.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Elias delta coding builds on gamma-style length coding.
Elias gamma is a variable-length code for positive integers.