diff --git a/depends/install_libavif.sh b/depends/install_libavif.sh index 50ba01755..a6686f3ef 100755 --- a/depends/install_libavif.sh +++ b/depends/install_libavif.sh @@ -7,6 +7,10 @@ version=1.3.0 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 diff --git a/depends/libavif-svt4.patch b/depends/libavif-svt4.patch new file mode 100644 index 000000000..7abfc5299 --- /dev/null +++ b/depends/libavif-svt4.patch @@ -0,0 +1,14 @@ +--- 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 };