Skip to content

feat(avif)!: migrate AVIF encode to gamut-avif; delete libaom and ravif - #49

Merged
justin13888 merged 1 commit into
masterfrom
26-migrate-avif-encode-gamut
Jul 19, 2026
Merged

feat(avif)!: migrate AVIF encode to gamut-avif; delete libaom and ravif#49
justin13888 merged 1 commit into
masterfrom
26-migrate-avif-encode-gamut

Conversation

@justin13888

Copy link
Copy Markdown
Collaborator

Closes #26.

Stacked on #48; merge order #42#44#45#46#47#48 → this.

What is Delivered

  • Encode on gamut_avif::AvifEncoderRgb8, 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). One AvifEncodeConfig replaces RavifEncodeConfig/LibaomEncodeConfig/AvifRateControl; EncodeOptions::AvifRavif/AvifLibaom collapse to Avif; codec id avif/gamut. Decode untouched (AVIF decode via gamut-avif container + hardware AV1 #33).
  • The entire libaom stack is deleted per the no-interim policy, with its 10/12-bit capability temporarily gone: codecs/avif_libaom.rs (454 lines), the aom build.rs slice (jpegli is now build.rs's only consumer), deps ravif/libaom-sys/avif-serialize, both libaom features — 26 crates leave the lockfile (rav1e, nasm-rs, …). Ten/Twelve requests return EncodeError::UnsupportedBitDepth whose 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.
  • Metadata: gamut-avif cannot attach EXIF/XMP/ICC on encode yet (deferred upstream in its docs), so the encode path keeps rawshift's existing ISOBMFF item splicing on the gamut-produced container — existing infrastructure, not a new interim dependency. avif_exif_round_trip passes with unchanged assertions.
  • New tests: lossless + lossy encode, and a decode-back round trip through the independent dav1d-backed decoder (strongest bitstream-validity proof available locally).
  • CI: nasm dropped 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 deleted jxl-encode-libjxl-vendored feature 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 --workspace 378/0; --features full 536/0 (fixtures regenerated incl. gamut AVIF; 18 AVIF-named tests ran); --features serde 360/0; clippy workspace + full -D warnings 0 + 0; --no-default-features --features avif standalone 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.

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.
Base automatically changed from 25-migrate-jxl-gamut to master July 19, 2026 01:36
@justin13888
justin13888 merged commit d676347 into master Jul 19, 2026
@justin13888
justin13888 deleted the 26-migrate-avif-encode-gamut branch July 19, 2026 01:41
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.

Migrate AVIF encode to gamut-avif; delete libaom and ravif

1 participant