RFC: Include deinterlacing code from LodePNG in PNGDecoder #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a stripped down version of the deinterlacing code used in LodePNG, http://lpi.googlecode.com/svn/trunk/lodepng.cpp code for handling lower bitPerPixel-amounts than 8 was removed, as that should be an uncommon case for the uncommon case that interlaced PNGs are, and it added even more complexity.
It's worth noting that this does not work 100%, almost all the images I threw at it deinterlaced fine, but two proved to be problematic:
https://dl.dropbox.com/u/12443522/ircfiles/fonts-fontmenupismo.png
https://dl.dropbox.com/u/12443522/ircfiles/denicek-denicek.png
Putting the result out again as BMP (for lack of a way to put out PNG) reveals the following:
https://dl.dropbox.com/u/12443522/ircfiles/denicek-denicek-deinterlaced.bmp
https://dl.dropbox.com/u/12443522/ircfiles/fonts-fontmenupismo-deinterlaced.bmp
Both images are from Five Magical Amulets, and the rest of the interlaced data there does work fine.
So:
Is the code otherwise good?
Do anyone have any idea what is wrong for the two failed images?
Edit: Corrected title