feat(avif)!: migrate AVIF encode to gamut-avif; delete libaom and ravif - #49
Merged
Conversation
AVIF encoding moves to gamut_avif::AvifEncoder (Rgb8; lossless default plus lossy quality 0-100 — gamut ships lossy at this pin, so it is exposed rather than artificially hidden). One AvifEncodeConfig replaces RavifEncodeConfig/ LibaomEncodeConfig/AvifRateControl; EncodeOptions::AvifRavif/AvifLibaom collapse to Avif; codec id avif/gamut. AVIF decode is untouched (#33). Per the no-interim policy, the entire libaom stack is deleted in this change even though gamut does not yet cover its 10/12-bit capability: codecs/avif_libaom.rs, the aom build.rs slice (jpegli is now the only build.rs consumer), deps ravif/libaom-sys/avif-serialize, and the avif-encode-libaom(-vendored) features — 26 crates leave the lockfile (rav1e, nasm-rs and friends). Ten/Twelve-bit requests now return EncodeError::UnsupportedBitDepth citing visualcommons/gamut#251; Eight and Sixteen (16->8, as with ravif) remain accepted. Documented in the config rustdoc and README. gamut-avif cannot attach EXIF/XMP/ICC on encode yet (deferred upstream), so the encode path keeps rawshift's existing ISOBMFF item splicing on the gamut-produced container; avif_exif_round_trip passes unchanged. New tests cover lossless+lossy encode and a decode-back round trip through the independent dav1d-backed decoder. CI drops nasm (nothing needs it once rav1e is gone) and the stale rav1e/libaom comments; dav1d/cmake/clang stay for decode and the remaining vendored builds. BREAKING CHANGE: AVIF encode config/variant names changed; 10/12-bit AVIF encode is temporarily unavailable pending visualcommons/gamut#251.
This was referenced Jul 18, 2026
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.
Closes #26.
Stacked on #48; merge order #42 → #44 → #45 → #46 → #47 → #48 → this.
What is Delivered
gamut_avif::AvifEncoder—Rgb8, lossless by default plus lossy quality 0–100 (gamut ships lossy at the pin, so it is exposed rather than artificially hidden; the epic's wording predated it). OneAvifEncodeConfigreplacesRavifEncodeConfig/LibaomEncodeConfig/AvifRateControl;EncodeOptions::AvifRavif/AvifLibaomcollapse toAvif; codec idavif/gamut. Decode untouched (AVIF decode via gamut-avif container + hardware AV1 #33).codecs/avif_libaom.rs(454 lines), the aom build.rs slice (jpegli is now build.rs's only consumer), depsravif/libaom-sys/avif-serialize, both libaom features — 26 crates leave the lockfile (rav1e, nasm-rs, …).Ten/Twelverequests returnEncodeError::UnsupportedBitDepthwhose message cites gamut-avif: encoder support for high-bit-depth and non-Rgb8 inputs gamut#251; a test pins the citation. Documented in config rustdoc + README.avif_exif_round_trippasses with unchanged assertions.nasmdropped from the all-features apt list (nothing needs it with rav1e gone), stale rav1e/libaom comments removed. This branch also carries (via rebase) the Migrate JXL to gamut-jxl #25 CI fix that drops the deletedjxl-encode-libjxl-vendoredfeature from the all-features invocation — pushed to the Migrate JXL to gamut-jxl #25 branch so PR feat(jxl)!: migrate JXL to gamut-jxl; drop jxl-oxide, zune-jpegxl, and the libjxl glue #48 goes green too.Verification Done
Run independently after implementation:
cargo test --workspace378/0;--features full536/0 (fixtures regenerated incl. gamut AVIF; 18 AVIF-named tests ran);--features serde360/0; clippy workspace + full-D warnings0 + 0;--no-default-features --features avifstandalone clean; greps confirm ravif/libaom-sys/avif-serialize/rav1e absent from manifests and lockfile, no aom slice in build.rs. Post-rebase full-features check re-run clean. lefthook green.