Let's build a compressor from scratch
7 points by wofo
7 points by wofo
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.
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).