Commit e0f96136 for libheif

commit e0f961366c1de0291c8afdddbb1d5c94d9189342
Author: Dirk Farin <dirk.farin@gmail.com>
Date:   Mon Sep 7 23:21:54 2026 +0200

    aom: link the upstream libaom issue for the tune=iq lossless workaround (#1890)

    libaom rejects tune=iq together with lossless coding because handle_tuning()
    enables chroma delta-q and validate_config() refuses that combination. This is
    tracked upstream as https://aomedia.g-issues.chromium.org/issues/383595066 and
    is still present in libaom v3.15.0. Reference the issue at both workaround
    sites so the veto can be dropped once libaom lifts the restriction.

diff --git a/libheif/plugins/encoder_aom.cc b/libheif/plugins/encoder_aom.cc
index eb642708..d891a353 100644
--- a/libheif/plugins/encoder_aom.cc
+++ b/libheif/plugins/encoder_aom.cc
@@ -202,6 +202,10 @@ static const char* const kParam_tune_valid_values[] = {
 };

 #if defined(AOM_HAVE_TUNE_IQ)
+// libaom's handle_tuning() enables chroma delta-q for AOM_TUNE_IQ, and validate_config()
+// then rejects that combination with lossless coding. Tracked upstream as
+// https://aomedia.g-issues.chromium.org/issues/383595066 (still present in libaom v3.15.0).
+// Once libaom lifts the restriction, this workaround can be dropped for those versions.
 static heif_error heif_error_lossless_with_tune_iq = {
   heif_error_Usage_error,
   heif_suberror_Invalid_parameter_value,
@@ -1112,6 +1116,7 @@ static heif_error aom_start_sequence_encoding_intern(void* encoder_raw, const he

       // libaom turns on chroma delta-q for AOM_TUNE_IQ and then refuses to combine
       // that with lossless coding, so keep AOM_TUNE_SSIM for lossless images.
+      // See https://aomedia.g-issues.chromium.org/issues/383595066
       if (!is_identity_matrix && !is_lossless &&
           (cfg.g_usage == AOM_USAGE_ALL_INTRA || iq_supports_inter) &&
           aom_version >= aom_version_3_13_0) {