[devel] Avoid some tests while selecting a filter.

The AVG and PAETH filters will never be selected for the first
row, so we need not test them.
This commit is contained in:
Glenn Randers-Pehrson 2009-07-18 11:28:33 -05:00
parent ee100094e4
commit ae4af5600d
3 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.0beta68 - July 7, 2009 Libpng 1.4.0beta68 - July 18, 2009
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -499,7 +499,8 @@ version 1.4.0beta67 [July 6, 2009]
Added high-level API transform PNG_TRANSFORM_GRAY_TO_RGB. Added high-level API transform PNG_TRANSFORM_GRAY_TO_RGB.
Added an "xcode" project to the projects directory (Alam Arias). Added an "xcode" project to the projects directory (Alam Arias).
version 1.4.0beta68 [July 7, 2009] version 1.4.0beta68 [July 18, 2009]
Avoid some tests in filter selection in pngwutil.c
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

View File

@ -2176,7 +2176,8 @@ version 1.4.0beta67 [July 6, 2009]
Added high-level API transform PNG_TRANSFORM_GRAY_TO_RGB. Added high-level API transform PNG_TRANSFORM_GRAY_TO_RGB.
Added an "xcode" project to the projects directory (Alam Arias). Added an "xcode" project to the projects directory (Alam Arias).
version 1.4.0beta68 [July 7, 2009] version 1.4.0beta68 [July 18, 2009]
Avoid some tests in filter selection in pngwutil.c
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

View File

@ -1,7 +1,7 @@
/* pngwutil.c - utilities to write a PNG file /* pngwutil.c - utilities to write a PNG file
* *
* Last changed in libpng 1.4.0 [July 7, 2009] * Last changed in libpng 1.4.0 [July 18, 2009]
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -2130,7 +2130,13 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_uint_32 row_bytes = row_info->rowbytes; png_uint_32 row_bytes = row_info->rowbytes;
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) #if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
int num_p_filters = (int)png_ptr->num_prev_filters; int num_p_filters = (int)png_ptr->num_prev_filters;
#endif #else
if (png_ptr->row_number == 0)
{
/* These will never be selected so we need not test them. */
filter_to_do &= ~(PNG_FILTER_UP | PNG_FILTER_PAETH);
}
#endif
png_debug(1, "in png_write_find_filter"); png_debug(1, "in png_write_find_filter");
/* Find out how many bytes offset each pixel is */ /* Find out how many bytes offset each pixel is */