[Zlib-devel] Re: [png-implement] Libpng-1.2.2rc1 and libpng-1.0.13rc1

Greg Roelofs newt at pobox.com
Wed Apr 10 16:16:01 EDT 2002


> +	[Mark quote:  "memLevel will have an effect on Huffman-only,
> +	 since it changes the size of blocks with the same Huffman
> +	 codes.  The effect of this is not obvious.  Smaller blocks
> +	 have more relative overhead for the code descriptions, but
> +	 on the other hand they adapt to changing data more rapidly,
> +	 possibly resulting in more optimum code selection."]

It appears that memLevels 7-9 have an identical effect on Huffman-only
compression, while lower levels progressively degrade--at least, most
of the time.  Here's a sample:

   1846585:  1  2  2,3,0,3,1,2,0,1   6227
   1846586:  2  2  2,3,0,3,1,2,0,1   5905
   1846587:  3  2  2,3,0,3,1,2,0,1   5820
   1846588:  4  2  2,3,0,3,1,2,0,1   5807
   1846589:  5  2  2,3,0,3,1,2,0,1   5655
   1846590:  6  2  2,3,0,3,1,2,0,1   5608
   1846591:  7  2  2,3,0,3,1,2,0,1   5543
   1846592:  8  2  2,3,0,3,1,2,0,1   5543
   1846593:  9  2  2,3,0,3,1,2,0,1   5543

(2 in third column == zlib_strategy == Huffman-only)

However, I did see at least one case where an intermediate level was
best:

   2122336:  1  2  3,0,0,2,1,2,3,0   6269
   2122337:  2  2  3,0,0,2,1,2,3,0   5989
   2122338:  3  2  3,0,0,2,1,2,3,0   5894
   2122339:  4  2  3,0,0,2,1,2,3,0   5801
   2122340:  5  2  3,0,0,2,1,2,3,0   5754  <--
   2122341:  6  2  3,0,0,2,1,2,3,0   5829
   2122342:  7  2  3,0,0,2,1,2,3,0   5786
   2122343:  8  2  3,0,0,2,1,2,3,0   5786
   2122344:  9  2  3,0,0,2,1,2,3,0   5786

But the overall best results for this image and its grayscale cousin
were unchanged from before, so (at least in this case) the oddball
results are local minima, not global.

> I'll test the second one empirically as soon as my
> 10-row image finishes; it should be done by tomorrow morning, I think.

61 hours at 1.4 GHz. :-)

Greg




More information about the Zlib-devel mailing list