[libpng15] Replaced a short but frequently-used memcpy() in png_combine_row()

with a loop.
This commit is contained in:
Glenn Randers-Pehrson 2011-10-05 21:09:22 -05:00
parent a92a212925
commit fa7d7934f6
3 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.6beta05 - October 5, 2011 Libpng 1.5.6beta05 - October 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.
@ -55,7 +55,8 @@ Version 1.5.6beta03 [September 28, 2011]
Version 1.5.6beta04 [October 5, 2011] Version 1.5.6beta04 [October 5, 2011]
Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl")." Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl")."
Version 1.5.6beta05 [October 5, 2011] Version 1.5.6beta05 [October 6, 2011]
Replaced a short but frequently-used memcpy() in png_combine_row() to a loop.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net: Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit (subscription required; visit

View File

@ -3616,7 +3616,8 @@ Version 1.5.6beta03 [September 28, 2011]
Version 1.5.6beta04 [October 5, 2011] Version 1.5.6beta04 [October 5, 2011]
Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl")." Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl")."
Version 1.5.6beta05 [October 5, 2011] Version 1.5.6beta05 [October 6, 2011]
Replaced a short but frequently-used memcpy() in png_combine_row() to a loop.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -2994,11 +2994,21 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
{ {
if (m & mask) if (m & mask)
{ {
png_memcpy(dp, sp, pixel_bytes); /* Prior to libpng-1.5.6 we used memcpy(), but limited
* experiments show that this simple loop can be
* significantly faster.
*/
int j;
for (j = pixel_bytes; j; --j)
*(dp++) = *(sp++);
} }
sp += pixel_bytes; else
dp += pixel_bytes; {
sp += pixel_bytes;
dp += pixel_bytes;
}
if (m == 1) if (m == 1)
m = 0x80; m = 0x80;