mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[master] Improved the optimization of the zlib CMF byte
(see libpng-1.2.6beta03).
This commit is contained in:
8
ANNOUNCE
8
ANNOUNCE
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.4.6rc02 - April 3, 2011
|
Libpng 1.4.6rc02 - April 6, 2011
|
||||||
|
|
||||||
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.
|
||||||
@@ -67,7 +67,11 @@ version 1.4.6beta07 [March 22, 2011]
|
|||||||
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
|
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
|
||||||
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
|
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
|
||||||
|
|
||||||
version 1.4.6rc01 [April 3, 2011]
|
version 1.4.6rc01 [March 31, 2011]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
version 1.4.6rc02 [April 6, 2011]
|
||||||
|
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
|
||||||
|
|
||||||
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
||||||
or to png-mng-implement at lists.sf.net (subscription required; visit
|
or to png-mng-implement at lists.sf.net (subscription required; visit
|
||||||
|
|||||||
6
CHANGES
6
CHANGES
@@ -2779,7 +2779,11 @@ version 1.4.6beta07 [March 22, 2011]
|
|||||||
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
|
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
|
||||||
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
|
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
|
||||||
|
|
||||||
version 1.4.6rc01 [April 3, 2011]
|
version 1.4.6rc01 [March 31, 2011]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
version 1.4.6rc02 [April 6, 2011]
|
||||||
|
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
|
||||||
|
|
||||||
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
||||||
or to png-mng-implement at lists.sf.net (subscription required; visit
|
or to png-mng-implement at lists.sf.net (subscription required; visit
|
||||||
|
|||||||
15
pngwutil.c
15
pngwutil.c
@@ -682,9 +682,24 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||||||
if (length >= 2 &&
|
if (length >= 2 &&
|
||||||
png_ptr->height < 16384 && png_ptr->width < 16384)
|
png_ptr->height < 16384 && png_ptr->width < 16384)
|
||||||
{
|
{
|
||||||
|
/* Compute the maximum possible length of the datastream */
|
||||||
|
|
||||||
|
/* Number of pixels, plus for each row a filter byte and possible
|
||||||
|
* and possibly a padding byte, so increase the maximum
|
||||||
|
* size to account for these.
|
||||||
|
*/
|
||||||
png_uint_32 uncompressed_idat_size = png_ptr->height *
|
png_uint_32 uncompressed_idat_size = png_ptr->height *
|
||||||
((png_ptr->width *
|
((png_ptr->width *
|
||||||
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
|
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
|
||||||
|
|
||||||
|
/* If it's interlaced, each block of 8 rows is sent as up to
|
||||||
|
* 14 rows, i.e., 6 additional rows, each with a filter byte
|
||||||
|
* and possibly a padding byte
|
||||||
|
*/
|
||||||
|
if (png_ptr->interlaced)
|
||||||
|
uncompressed_idat_size += ((png_ptr->height + 7)/8) *
|
||||||
|
(png_ptr->bit_depth < 8 ? 12 : 6);
|
||||||
|
|
||||||
unsigned int z_cinfo = z_cmf >> 4;
|
unsigned int z_cinfo = z_cmf >> 4;
|
||||||
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
|
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
|
||||||
while (uncompressed_idat_size <= half_z_window_size &&
|
while (uncompressed_idat_size <= half_z_window_size &&
|
||||||
|
|||||||
Reference in New Issue
Block a user