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

Rewrite bitstream reader, enable partial decoding #96

Merged
merged 10 commits into from
Oct 29, 2023
Merged

Conversation

tirr-c
Copy link
Owner

@tirr-c tirr-c commented Oct 27, 2023

This PR removes previous Read-based bitstream reader and instead adds memory-backed (&[u8]) reader. As a result the overall interface was rewritten around push-based approach, which users "push" (or "feed") bytes to the decoder, and then get rendered images. This API change has some advantages:

  • The new API is async friendly. Users can asynchronously wait for some data, push them into decoder, then repeat. While waiting for data, they could progressively render images with the data given so far. (Decoding and rendering themselves are not IO-bound, so there's no need to change those interfaces to async.) This use case made me implement...
  • ...improved partial decoding. Now jxl-render allows partial data for even more cases than before, like partial LF/HF coefficients, partial modular subimage of LfGroup, and even partial GlobalModular. Below is an example of this, loading ~379 KiB of JPEG XL image (conformance image bike) in chunks of 4 KiB:
bike.mp4

@tirr-c tirr-c self-assigned this Oct 27, 2023
@tirr-c tirr-c force-pushed the rewrite-bitstream branch from e778fb4 to e547977 Compare October 27, 2023 15:10
@tirr-c tirr-c marked this pull request as ready for review October 28, 2023 18:44
@tirr-c tirr-c merged commit 21c2def into main Oct 29, 2023
@tirr-c tirr-c deleted the rewrite-bitstream branch October 29, 2023 11:58
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.

1 participant