
376 PART iV / STANDARDS
Since dynamic coding can tailor itself to the input data, it tends to be more efficient for larger
data sets. However, unlike the case with fixed codes, dynamic Huffman trees must be explicitly
included in the output stream (literal/length tree first, then distance tree). Thus, for smaller input
streams, where the overhead of the trees outweighs their improved compression efficiency, fixed
codes are better. Because deflate organizes its output into blocks--something at which we hinted
earlier, with the end-of-block code~it can alternate between fixed and dynamic Huffman codes
as necessary in order to optimize compression. ...