Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to miniz_oxide #218

Merged
merged 5 commits into from
Jun 13, 2020
Merged

Switch to miniz_oxide #218

merged 5 commits into from
Jun 13, 2020

Conversation

HeroicKatora
Copy link
Member

@HeroicKatora HeroicKatora commented Jun 12, 2020

This also fixes a few instances where decoding should fail. The theory behind these was realized because miniz_oxide forces us to manually flush the decompression at the end of consecutive IDAT chunks which in turns requires us to keep track of this.

  • Don't merge until we have some test cases that ensure this behaviour will not regress.
  • Also, I want to run some perf results and publish them here.

Fixes: #217
Closes: #151

@HeroicKatora HeroicKatora changed the title Switch to miniz oxide Switch to miniz_oxide Jun 12, 2020
@HeroicKatora
Copy link
Member Author

Perf is spectacular:

$ umeperf compare image-png --git 06e1a7e52d728ea26af49e7f6b484aea609e763d..34ce181279edf033bd79f494acb8560fffac3c1a
[Benchmark]                                                      [Change]     [Base]      [Head]      [Significance]
decode/kodim07.png                                               improved     13.145693    9.257400    0.050000
decode/Lohengrin_-_Illustrated_Sporting_and_Dramatic_News.png    improved     80.086203    47.595000    0.050000
decode/kodim23.png                                               improved     9.648249    6.288700    0.050000
decode/Transparency.png                                          improved     778.577505    632.070000    0.050000
decode/kodim02.png                                               improved     10.811226    7.039200    0.050000
decode/kodim17.png                                               improved     9.100309    5.952700    0.050000

The main point is that it should be possible to control all allocations
performed, even though this commit does not yet do it.
All data in an image must appear in consecutive IDAT/fdAT chunks that
are not interrupted by any other data chunk. In particular we should not
ignore intermediate chunks but report them as an error (see 5.6. Chunk
Ordering). This is also important to properly flush the zlib
decompression at the end of the subframe and retrieve remaining rows as
well as check its checksum even if ignored blocks follow.
This test ensures that we do not silently ignore an invalid chunk that
was inserted between IDAT chunks. This should error according to the png
specification. The property of consecutive chunks is checked since the
zlib decoder must be signalled the end of the compressed data stream.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop when decoding some files on miniz_oxide branch Consider switching to libflate for decoding
1 participant