Apex › Data & encoding

Move-to-front coding

The stage between the Burrows-Wheeler transform and the entropy coder in bzip2. Keep a list of the alphabet; encode each symbol as its current index, then move it to the front — so a run of the same character collapses into a run of zeros, the small-number stream that makes the BWT so compressible.

More in Data & encoding