-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
png: a variety of minor optimizations to the PNG writer (#3980)
* Implement PNGOutput::write_scanlines, previously we only had write_scanline. Sadly, being able to write multiple scanlines at once reduces overhead by much less than I had hoped. But there's a bit of savings, so I'll keep it. * New compression recognized: "pngfast", which translates to the Z_BEST_SPEED setting. I don't particularly recommend this, but it's useful for benchmarking. * New compression recognized: "none", which turns off compression. Also not recommended, as it makes the files much larger. Mostly done for benchmarking and other comparisons. * Don't unconditionally copy user's data buffer to m_scratch. It's only necessary if there's a data type conversion, stride shuffling, alpha deassociation, or endian swapping. When none of those are needed, we can avoid the extra allocatin and copy, and so now we do. (Sigh, in real use, we're almost always doing the alpha deassociation, so this rarely is a savings.) * Better documentation on the custom output attribute hint `"png:filter"` noting that a non-default value can make it write PNG files dramatically faster, but with the tradeoff of having much larger files. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com>
- Loading branch information
Showing
3 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters