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

uncompressed: generic compression decode support #1208

Merged
merged 9 commits into from
Jul 9, 2024

Conversation

bradh
Copy link
Contributor

@bradh bradh commented Jun 28, 2024

This is from the draft Amendment 2 for ISO/IEC 23001-17. It re-uses and generalises the existing zlib support (from header compression), and adds an optional dependency on Brotli.

This version replaces #1194.

Feedback on the approach and internal API changes would be appreciated.

I still have some work to do on this:

  • decode row compression
  • decode pixel compression (needs test data)
  • icbr byte ranges (needs test data)
  • some unit tests

There is no encoding support for this yet, and we'd likely need some kind of configuration option to specify that. It seems a bit premature given where the draft is up to.

@farindk
Copy link
Contributor

farindk commented Jul 4, 2024

Looks good to me.

Let me know whether I should merge this now or wait until you have added the missing parts.

@bradh
Copy link
Contributor Author

bradh commented Jul 4, 2024

Not yet. I think I'd like to handle the decompression earlier (in the same way we handle compressed metadata).

This approach was fine for the case where the whole file is compressed, but turns out to be hard for the icbr ranges case, since the codec isn't really working at the mdat extent range level.

@bradh bradh force-pushed the generic_compression branch 2 times, most recently from b20e382 to 4efde38 Compare July 6, 2024 04:09
@bradh bradh marked this pull request as ready for review July 6, 2024 06:18
@bradh bradh changed the title uncompressed: wip on generic compression uncompressed: generic compression decode support Jul 9, 2024
@bradh
Copy link
Contributor Author

bradh commented Jul 9, 2024

I think this is going to fail CIFuzz until google/oss-fuzz#12165 is merged

libheif/CMakeLists.txt Outdated Show resolved Hide resolved
#if WITH_DEFLATE_HEADER_COMPRESSION
#include <error.h>

#if WITH_ZLIB_COMPRESSION
std::vector<uint8_t> deflate(const uint8_t* input, size_t size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe deflate_zlib for consistency.

@bradh bradh force-pushed the generic_compression branch from 1f54ffd to 86299ef Compare July 9, 2024 11:36
@farindk farindk merged commit c47a18c into strukturag:master Jul 9, 2024
34 of 35 checks passed
jonathanmetzman pushed a commit to google/oss-fuzz that referenced this pull request Jul 9, 2024
@bradh bradh deleted the generic_compression branch July 9, 2024 22:02
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.

3 participants