LZ77 greedy parsing on A =

alphabet:
historymatch sourcecopied / lookaheadliteral

Encoder tokens

Decoder (reads the bitstream only)

Bit budget

Final bitstream

flag · letter index · γ(d) · γ(l) · one underlined group per token; the current token is highlighted
as one string, in bytes of 8:
How the bits are counted

Format (LZSS style, one choice among many): literal = 0 + -bit index (), bits total. Match = 1 + γ(d) + γ(l), where γ is Elias gamma: γ(1)=1, γ(2)=010, γ(3)=011, γ(4)=00100, |γ(n)| = 2⌊log2n⌋+1. Match copies l symbols starting d back in the decoder's output, one at a time, so l > d (overlap) is allowed. Baseline = bits per symbol (fixed width, ⌈log2⌉). No header and no byte padding are counted; bytes shown are ⌈bits/8⌉. Greedy: longest match in the window, ties broken by smallest distance.