[Zlib-devel] stored-block size limit?

Greg Roelofs newt at pobox.com
Mon Apr 8 19:30:01 EDT 2002


Mark wrote:

> 1.  If windowBits is greater than or equal to memLevel + 6, then the
> stored block size is approximately 2^(memLevel + 6).  Therefore if
> memLevel is 9 and windowBits is 15 (the maximum settings), the 32K claim
> is correct.  However for the default settings with a memLevel of 8 and
> windowBits of 15, zlib will add five bytes for every 16K or so.
> Furthermore, once you get down to a memLevel of 6, the 0.1% is incorrect
> as well.  In that case, you need 0.13% more output space.  And it gets
> worse as memLevel continues from 5 down to 1.  At a memLevel of 1, you
> need 4% more output space.

> So zlib.h is wrong for memLevel <= 6.  Furthermore, 32K stored blocks
> are not created even for the default deflate settings.

It's not clear to me if there's some technical (tuning) reason for this
connection or if it's simply a matter of using the buffer sizes that
happen to be available.  There's no particular reason why you *couldn't*
emit a 64K stored block at one of the lower memLevels, is there?

> At a minimum, these behaviors of deflate need to be documented.  In my
> opinion, at least case #2 above could be considered a bug, since deflate
> should be using stored blocks for incompressible data.

Seems like it.

Greg






More information about the Zlib-devel mailing list