Repository navigation
Add a CPU JPEG XR encoder and prepare 0.5.2 - #31
Merged
Merged
Conversation
jxr::encode writes an Annex-A file from SourceImage samples; encode_codestream and encode_codestreams return the raw codestreams. The encoder takes grayscale, RGB and BGR samples at every depth the decoder returns, CMYK, three- to eight-channel samples, and YUV 4:4:4, 4:2:2 and 4:2:0, with separate or integrated alpha. It codes losslessly, at a quality from 0 to 100, or with per-band quantizers, in spatial or frequency bitstream mode, with optional chroma subsampling. Full-resolution CPU decodes now run as a stream of row strips shared with the encoder's analysis stages, replacing the per-format tile_decode modules. With SCALED_FLAG set, every component after the first is reconstructed at double weight in any colour format through jxr_core::scaled_after_first_transform, on CPU, Metal and CUDA; before, only YUV was. Coverage: encode round-trip suites in jxr, an encode_roundtrip fuzz target whose fixed cases CI runs, the dev-only jxr-alloc-probe memory tests, and a size gate for the decode-only WebAssembly module (jxr-wasm-size, tools/wasm_size_check.py).
Publish the CPU encoder. cargo semver-checks reports no semver update required for any changed package, so the release stays on the 0.5 line. jxr-math moves to 0.2.1, jxr-core and jxr-cuda to 0.5.1, jxr-native, jxr-metal and jxr to 0.5.2; jxr-image and jxr-mpsgraph follow their exact pins to 0.5.2 and 0.6.2. Both lockfiles follow. docs/releasing.md gives the release notes and publish order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a CPU JPEG XR encoder and prepares the 0.5.2 release.
jxr::encodewrites an Annex-A.jxrfile from aSourceImage;encode_codestreamandencode_codestreamsreturn the raw codestreams.SourceSamplesconverts fromDecodedSamples, so decoder output can be re-encoded.EncodeRequest::quality(0–100), or per-band quantizers; spatial or frequency bitstream mode (thumbnail decode at 1/4 and 1/16); chroma subsampling to 4:2:2 / 4:2:0; overlap filtering, tiling, flexbits trimming, and packet layout.tile_decodemodules.jxr-alloc-probe(memory tests) andjxr-wasm-size, plustools/wasm_size_check.py. CI now runs the WebAssembly size gate and the fixed cases of theencode_roundtripfuzz harness.Decode output change
With
SCALED_FLAGset, every component after the first is now reconstructed at double weight in any colour format, throughjxr_core::scaled_after_first_transform. 0.5.1 applied this only to YUV. CPU, Metal and CUDA share the rule. Decoded output changes only for scaled CMYK and N-component images. The T.834 comparisons below are unchanged, so the corpus may not include such files.Release
cargo semver-checksreports no semver update required for any changed package, so the release stays on the 0.5 line. All eight published crates are re-released because of the exact internal pins. Publish order, also indocs/releasing.md:Checks run (aarch64 macOS, Rust 1.99.0)
ci.ymlgates locally:-D warningscargo test --workspace --all-featuresandcargo test -p jxr --no-default-features: 699 passed, 0 failed, 16 ignoredcargo docwith-D warningsencode_roundtripfixed cases--rewrap) and Metal each passed 517 in-scope cases, 179 out of scope, 0 harness-unsupported, 0 failed.cargo packagefor all eight crates builds each tarball against crates.io dependencies, including J2K 0.14.0. All verified.cargo semver-checks check-release: no semver update required for jxr-math, jxr-core, jxr-native, jxr-metal, jxr-cuda or jxr.Not yet validated