Prototype implementation of filter selection

This rewrites the code used previously in the heuristics to make it easier to
debug and introduces the 'methodical' method, which is intended to be an
expensive but reliable way of reducing image size.

The code in this commit does not work; the 'methodical' test for success does
not take account of data buffered inside zlib and, anyway, it changes the
results of pngtest so that the test fails.  This commit is just a checkpoint of
the current state; another commit will temporarily disable the 'methodical'
code.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2015-12-17 17:47:29 -08:00
parent bd0bb3ca7f
commit 61acc4c9ed
7 changed files with 1533 additions and 816 deletions

View File

@@ -325,6 +325,11 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
# endif
# endif
/* Initialize the alloc/free callbacks every time: */
png_ptr->zstream.zalloc = png_zalloc;
png_ptr->zstream.zfree = png_zfree;
png_ptr->zstream.opaque = png_ptr;
/* Set this for safety, just in case the previous owner left pointers to
* memory allocations.
*/