diff --git a/README.md b/README.md index ffdcf12..a938694 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # libavif +Library for encoding and decoding .avif files . + diff --git a/libavif-0.9.3-libsvt-av1-0.9.1.patch b/libavif-0.9.3-libsvt-av1-0.9.1.patch new file mode 100644 index 0000000..4618dd1 --- /dev/null +++ b/libavif-0.9.3-libsvt-av1-0.9.1.patch @@ -0,0 +1,77 @@ +From 74a21444397e323a088fa1f274c9fc942ee7a870 Mon Sep 17 00:00:00 2001 +From: Jamaika1 +Date: Wed, 26 Jan 2022 18:24:31 +0100 +Subject: [PATCH] Change function in SVT-AV1 0.9.0 (#807) + +--- + CHANGELOG.md | 1 + + ext/svt.cmd | 2 +- + ext/svt.sh | 2 +- + src/codec_svt.c | 6 ++++++ + 4 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index b3416169..583d3092 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 + * - speed 8-9: re-test and re-adjust speed according to your app needs + * Update aom.cmd: v3.2.0 + * Update dav1d.cmd: 0.9.2 ++* Update svt-av1.cmd: v0.9.0 + * Pass TestCase's minQuantizer, maxQuantizer, speed to encoder. + * Regenerate tests.json + * Disable JSON-based tests for now, the metrics are inconsistent/unreliable +diff --git a/ext/svt.cmd b/ext/svt.cmd +index e97de2be..03485b83 100755 +--- a/ext/svt.cmd ++++ b/ext/svt.cmd +@@ -11,7 +11,7 @@ + : # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir): + : # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" + +-git clone -b v0.8.7 --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git ++git clone -b v0.9.0 --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git + + cd SVT-AV1 + cd Build/windows +diff --git a/ext/svt.sh b/ext/svt.sh +index 049bed80..8e3b0f9b 100644 +--- a/ext/svt.sh ++++ b/ext/svt.sh +@@ -2,7 +2,7 @@ + # then enable CMake's AVIF_CODEC_SVT and AVIF_LOCAL_SVT options. + # cmake and ninja must be in your PATH. + +-git clone -b v0.8.7 --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git ++git clone -b v0.9.0 --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git + + cd SVT-AV1 + cd Build/linux +diff --git a/src/codec_svt.c b/src/codec_svt.c +index dfd085a7..3c84defc 100644 +--- a/src/codec_svt.c ++++ b/src/codec_svt.c +@@ -92,7 +92,9 @@ static avifResult svtCodecEncodeImage(avifCodec * codec, + } + svt_config->encoder_color_format = color_format; + svt_config->encoder_bit_depth = (uint8_t)image->depth; ++#if !SVT_AV1_CHECK_VERSION(0, 9, 0) + svt_config->is_16bit_pipeline = image->depth > 8; ++#endif + + // Follow comment in svt header: set if input is HDR10 BT2020 using SMPTE ST2084. + svt_config->high_dynamic_range_input = (image->depth == 10 && image->colorPrimaries == AVIF_COLOR_PRIMARIES_BT2020 && +@@ -104,8 +106,12 @@ static avifResult svtCodecEncodeImage(avifCodec * codec, + svt_config->logical_processors = encoder->maxThreads; + svt_config->enable_adaptive_quantization = AVIF_FALSE; + // disable 2-pass ++#if SVT_AV1_CHECK_VERSION(0, 9, 0) ++ svt_config->rc_stats_buffer = (SvtAv1FixedBuf) { NULL, 0 }; ++#else + svt_config->rc_firstpass_stats_out = AVIF_FALSE; + svt_config->rc_twopass_stats_in = (SvtAv1FixedBuf) { NULL, 0 }; ++#endif + + if (alpha) { + svt_config->min_qp_allowed = AVIF_CLAMP(encoder->minQuantizerAlpha, 0, 63); diff --git a/libavif.spec b/libavif.spec new file mode 100644 index 0000000..70034e6 --- /dev/null +++ b/libavif.spec @@ -0,0 +1,112 @@ +Name: libavif +Version: 0.9.3 +Release: 3mamba +Summary: Library for encoding and decoding .avif files +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/AOMediaCodec/libavif/ +Source: https://github.com/AOMediaCodec/libavif.git/v%{version}/libavif-%{version}.tar.bz2 +Patch0: libavif-0.9.3-libsvt-av1-0.9.1.patch +License: Apache License 2.0 +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libaom-devel +BuildRequires: libdav1d-devel +BuildRequires: libgdk-pixbuf-devel +BuildRequires: libglib-devel +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +%ifnarch %ix86 +BuildRequires: libsvt-av1-devel +%endif +%ifnarch aarch64 +BuildRequires: libyuv-devel +%endif +BuildRequires: libz-devel +## AUTOBUILDREQ-END +BuildRequires: cmake + +%description +Library for encoding and decoding .avif files . + +%package devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: pkg-config + +%description devel +This package contains libraries and header files for developing applications that use %{name}. + +%package tools +Group: Applications/Graphics +Summary: Utility applications for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description tools +This package contains utility applications for %{name}. + +%debug_package + +%prep +%setup -q +%patch0 -p1 -b .libsvt-av1-0.9.1 + +%build +%cmake -d build \ +\ +%ifnarch %ix86 + -DAVIF_CODEC_SVT=ON \ +%endif + -DAVIF_CODEC_AOM=ON \ + -DAVIF_CODEC_DAV1D=ON \ + -DAVIF_BUILD_APPS=ON \ + -DAVIF_BUILD_GDK_PIXBUF=ON + +# TODO: +# -DAVIF_CODEC_RAV1E=ON \ + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall -C build + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_libdir}/libavif.so.* +%{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-avif.so +%doc LICENSE + +%files devel +%defattr(-,root,root) +%dir %{_includedir}/avif +%{_includedir}/avif/avif.h +%dir %{_libdir}/cmake/libavif +%{_libdir}/libavif.so +%{_libdir}/cmake/libavif/libavif-config*.cmake +%{_libdir}/pkgconfig/libavif.pc +%doc README.md + +%files tools +%defattr(-,root,root) +%{_bindir}/avifdec +%{_bindir}/avifenc + +%changelog +* Thu Mar 24 2022 Silvan Calarco 0.9.3-3mamba +- rebuilt with libdav1d and libaom + +* Thu Mar 24 2022 Silvan Calarco 0.9.3-2mamba +- rebuilt with libyuv, libsvt-av1 and tools + +* Thu Mar 24 2022 Silvan Calarco 0.9.3-1mamba +- package created using the webbuild interface