Let's build a compressor from scratch

7 points by wofo


Lt_Riza_Hawkeye

I think this is pretty close to LZ encoding, it just adds backtracking tokens (e.g. look back 20 characters, copy 5) as a possible byte value to be encoded on top of the byte values in the original file.

pervognsen

FWIW, no-one does Huffman coding the way it's implemented in the linked source code, with a literal tree representation. I can recommend Moffat and Turpin's On the Implementation of Minimum-Redundancy Prefix Codes (1997).