-
Notifications
You must be signed in to change notification settings - Fork 623
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
Allow using zune-jpeg
for JPEG decoding
#1845
Comments
Sounds good with regards to maturity. There's some API details for implementation:
|
Note that development has moved from https://github.com/etemesi254/zune-jpeg to https://github.com/etemesi254/zune-image repository, and the decoder is now always single-threaded. There have been API changes as well, so please take a look at the zune-image repository. I'll defer the rest of the questions to the author, @etemesi254 |
I assume some combination of downsampling and plain old resizing will do the trick. For example, downsample only to 2x of the requested size in all dimensions, and let the user then run the final resizing step. This will save a lot of memory on huge images without degrading the output quality much.
Unless |
All decoders in
This is a bit trickier. When we hit the |
The concern isn't so much multiple images in a single reader, but that buffering all the available data beyond the image presents a change in semantics that has somewhat unknown consequences. Just not sure about it and if it's cheap I'd rather terminate the reading properly. |
All remaining panics on fuzzer inputs are fixed and the fuzzer has run for 250,000,000 inputs without any panics. It has also been tested for correctness on a whole imageboard, 300,000 images. It's time to wire it up. |
Simple plan for |
Won't that be expensive? |
I have a compiling but untested zune-jpeg adapter in #1876 |
### Why It is much faster. On my Mac, it takes objectron JPEG decoding from 15 to 10 ms. On the web the difference is smaller: 35ms -> 29ms. See https://github.com/emilk/image-decode-bench for more. It can also decode directly to RGBA, which means we don't need to spend cycles later padding RGB to RGBA. This takes the entire `objectron` demo `App::update` down from 21 ms to 14 ms. Sadly, the `gltf` crate still use the `"jpeg"` feature of the `image` crate, so weneed to pay for the compilation and code bloat of two jpeg decoders. The `.wasm` of the web-viewer increases by 23kB (pre-compression) because of this PR. This PR also adds support for monochrome JPEGs. ### Related * image-rs/image#1845 * image-rs/image#1876 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2376 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/1aae8d4/docs Examples preview: https://rerun.io/preview/1aae8d4/examples <!-- pr-link-docs:end -->
It looks like the latest MR for this is #1877. |
Yep. And the plan is to adopt it in the next major release |
Oh! I see 0.25 has shipped. Do you want any help with writing a release announcement? |
@Shnatsel that would be awesome. I wrote a changelog entry but haven't written up anything beyond that |
zune-jpeg
is a pure-Rust JPEG decoder with performance on par with libjpeg-turbo, and far exceeding that ofjpeg-decoder
.It now passes rigorous correctness tests on real-world images, and shows no issues when fuzzed. I believe it is mature enough to add to
image
as an optional backend for JPEG decoding, and you know I don't make claims like these lightly.The text was updated successfully, but these errors were encountered: