Why it matters

LZ77 is foundational compression. Understanding shapes compression.

Advertisement

The architecture

Sliding window of recent bytes.

Find longest match.

Emit: (offset, length, next literal).

LZ77 encoding flowSliding windowrecent bytesLongest matchin windowEmit tuple(offset, length, literal)Ziv + Lempel 1977; DEFLATE (RFC 1951) combines LZ77 + Huffman
LZ77.
Advertisement

How it works end to end

Ziv + Lempel 1977.

DEFLATE = LZ77 + Huffman.

gzip + zlib + PNG + zip.