summaryrefslogtreecommitdiff
path: root/huffman.c (unfollow)
Commit message (Collapse)Author
2017-09-29Fill in a truncated comment in huffman.c.Simon Tatham
I just happened to run across this clearly unfinished paragraph in build_huffman_tree(), and when I wrote the rest of it, I realised that there was actually an implicit input constraint which I hadn't documented, relating the size of the symbol alphabet to the upper bound on Huffman code length. (Fortunately, Deflate never violates that constraint, because both of those values are constant in every Huffman tree it builds.) So I've also added a pair of assertions, one of which enforces that constraint.
2017-05-13Factor LZ77 and Huffman routines out of deflate.c.Simon Tatham
The general routines for analysing a buffer into an LZ77ish stream of literals and matches, and for constructing a Huffman tree in canonical format, now live in their own source files so that they can be reused for other similar compression formats. Deflate-specific details like the exact file encoding are left in deflate.c.