Skip to main content

Codec reference

compress accepts --codec NAME; without it, the CLI uses huffman. decompress chooses a decoder from the archive header, so it takes no codec name. The table lists the primary names printed by Codec::name; Codec::parse also accepts some aliases.

CLI nameWhat it models or writesMagicSource
huffmanOne byte Huffman tree per block, adapted between blocksAHF0block_huffman.rs
huffman-o1Previous-byte Huffman contexts, adapted per byteAHF1adaptive_huffman.rs
lz77Literal and back-reference tokensLZ77lz77.rs
ppm-o1Byte PPM, max context 1 bytePP11byte_ppm.rs
ppm-o2Byte PPM, max context 2 bytesPP12byte_ppm.rs
ppmByte PPM, max context 3 bytesPP13byte_ppm.rs
ppm-o4Byte PPM, max context 4 bytesPP14byte_ppm.rs
ppm-o5Byte PPM, max context 5 bytesPP15byte_ppm.rs
ppm-o6Byte PPM, max context 6 bytesPP16byte_ppm.rs
ppm-byte-mixAdaptive mix of byte PPM ordersPPMXbyte_ppm.rs
ppm-bitBit PPM, max context 8 bitsPB08ppm.rs
ppm-bit-o16Bit PPM, max context 16 bitsPB16ppm.rs
ppm-bit-o32Bit PPM, max context 32 bitsPB32ppm.rs
ppm-bit-o64Bit PPM, max context 64 bitsPB64ppm.rs
ppm-bit-mixAdaptive mix of bit PPM ordersPBMXppm.rs
ppmdExclusion-based byte PPMD-style modelPPMDppmd.rs
ppmd-bitPPMD byte distribution converted to bit probabilitiesPDBTppmd_bit.rs
ppmd-mixPPMD byte and bit-history predictions mixedPDMXppmd_mix.rs
ppm-mixByte and bit PPM predictions mixedPMIXhybrid_ppm.rs
matchHashed next-byte match predictorPMATppm_match_mix.rs
ppm-match-mixByte PPM plus match predictorPMM3ppm_match_mix.rs
wikimix5Five wiki-oriented next-byte predictorsWMX5wikimix.rs

PMAT and PMM3 decoders also accept older payload forms (PMAT without the MBY1 marker and PMM2, respectively). See archive formats for the wire layout and source map for links to each file.

Command shape​

cargo run --release -- compress [--no-progress] [--codec NAME] INPUT ARCHIVE
cargo run --release -- decompress [--no-progress] ARCHIVE OUTPUT
cargo run --release -- stats [--no-progress] INPUT ARCHIVE
cargo run --release -- profile [--no-progress] INPUT

Square brackets here mean “optional”; do not type them literally. profile runs only the internal match-mix configurations. --no-progress is useful when saving command output or following a lesson.

For a first run, use the quickstart.