Filter heuristic implementation

This implements the heuristic part of filter selction, the methodic testing
approach is still not implemented.  png_set_option methods are incomplete.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2015-12-02 17:08:17 -08:00
parent aacda27449
commit e9d567d9ec
5 changed files with 234 additions and 82 deletions

View File

@@ -921,7 +921,28 @@ option CONVERT_tIME requires WRITE_ANCILLARY_CHUNKS
@# define PNG_NO_CONVERT_tIME
@#endif
# Write filter options:
#
# WRITE_FILTER
# Enables code to do PNG row filtering on write. If not enabled rows will
# be written without filtering, the 'NONE' filter. This enables the
# png_set_filter interface allowing the application to select the filter
# used for each row.
#
# WRITE_HEURISTIC_FILTER
# Enables code to cause libpng to choose a filter from a set passed to
# png_set_filter. Without this code libpng just chooses the first filter in
# the list if multiple are given.
#
# WRITE_OPTIMIZE_FILTER
# Enables code to try all the filters in the list passed to png_set_filter
# and choose the one which results in the least number of compressed bytes
# added by the current row.
#
# See png.h for more description of these options.
option WRITE_FILTER requires WRITE
option WRITE_HEURISTIC_FILTER requires WRITE_FILTER enables SET_OPTION
option WRITE_OPTIMIZE_FILTER requires WRITE_FILTER enables SET_OPTION
# added at libpng-1.5.4

View File

@@ -1,8 +1,7 @@
/* libpng 1.7.0beta70 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */
/* Libpng version 1.7.0beta70 - November 30, 2015 */
/* libpng version 1.7.0beta70, November 24, 2015 */
/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */
@@ -135,11 +134,13 @@
#define PNG_WRITE_FILTER_SUPPORTED
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
#define PNG_WRITE_HEURISTIC_FILTER_SUPPORTED
#define PNG_WRITE_INTERLACING_SUPPORTED
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_INVERT_SUPPORTED
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
#define PNG_WRITE_OPTIMIZE_FILTER_SUPPORTED
#define PNG_WRITE_PACKSWAP_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_WRITE_PNG_SUPPORTED