Update libavif to 1.4.0 (#9460)

This commit is contained in:
Hugo van Kemenade 2026-03-10 16:12:14 +02:00 committed by GitHub
commit 27ca696c07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 29 deletions

View File

@ -104,7 +104,7 @@ LIBWEBP_VERSION=1.6.0
BZIP2_VERSION=1.0.8
LIBXCB_VERSION=1.17.0
BROTLI_VERSION=1.2.0
LIBAVIF_VERSION=1.3.0
LIBAVIF_VERSION=1.4.0
function build_pkg_config {
if [ -e pkg-config-stamp ]; then return; fi

View File

@ -145,14 +145,14 @@ class TestFileAvif:
# avifdec hopper.avif avif/hopper_avif_write.png
assert_image_similar_tofile(
reloaded, "Tests/images/avif/hopper_avif_write.png", 6.02
reloaded, "Tests/images/avif/hopper_avif_write.png", 6.88
)
# This test asserts that the images are similar. If the average pixel
# difference between the two images is less than the epsilon value,
# then we're going to accept that it's a reasonable lossy version of
# the image.
assert_image_similar(reloaded, im, 8.62)
assert_image_similar(reloaded, im, 9.28)
def test_AvifEncoder_with_invalid_args(self) -> None:
"""
@ -461,12 +461,9 @@ class TestFileAvif:
@pytest.mark.parametrize(
"advanced",
[
{
"aq-mode": "1",
"enable-chroma-deltaq": "1",
},
(("aq-mode", "1"), ("enable-chroma-deltaq", "1")),
[("aq-mode", "1"), ("enable-chroma-deltaq", "1")],
{"tune": "psnr"},
(("tune", "psnr"),),
[("tune", "psnr")],
],
)
def test_encoder_advanced_codec_options(

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail
version=1.3.0
version=1.4.0
if [[ "$GHA_LIBAVIF_CACHE_HIT" == "true" ]]; then
@ -17,10 +17,6 @@ else
pushd libavif-$version
# Apply patch for SVT-AV1 4.0 compatibility
# Pending release of https://github.com/AOMediaCodec/libavif/pull/2971
patch -p1 < ../libavif-svt4.patch
if [ $(uname) == "Darwin" ] && [ -x "$(command -v brew)" ]; then
PREFIX=$(brew --prefix)
else

View File

@ -1,14 +0,0 @@
--- a/src/codec_svt.c
+++ b/src/codec_svt.c
@@ -162,7 +162,11 @@ static avifResult svtCodecEncodeImage(avifEncoder * encoder,
#else
svt_config->logical_processors = encoder->maxThreads;
#endif
+#if SVT_AV1_CHECK_VERSION(4, 0, 0)
+ svt_config->aq_mode = 2;
+#else
svt_config->enable_adaptive_quantization = 2;
+#endif
// disable 2-pass
#if SVT_AV1_CHECK_VERSION(0, 9, 0)
svt_config->rc_stats_buffer = (SvtAv1FixedBuf) { NULL, 0 };

View File

@ -119,7 +119,7 @@ V = {
"HARFBUZZ": "12.3.2",
"JPEGTURBO": "3.1.3",
"LCMS2": "2.18",
"LIBAVIF": "1.3.0",
"LIBAVIF": "1.4.0",
"LIBIMAGEQUANT": "4.4.1",
"LIBPNG": "1.6.55",
"LIBWEBP": "1.6.0",