Compare commits

...

1 Commits
epel9 ... i10ce

Author SHA1 Message Date
Arkady L. Shane b3b254979c
import libavif-1.0.4-7.el10
2 days ago

15
.gitignore vendored

@ -1,14 +1 @@
/libavif-0.5.7.tar.gz SOURCES/libavif-1.0.4.tar.gz
/libavif-0.7.1.tar.gz
/libavif-0.7.2.tar.gz
/libavif-0.7.3.tar.gz
/libavif-0.8.0.tar.gz
/libavif-0.8.1.tar.gz
/libavif-0.8.2.tar.gz
/libavif-0.8.4.tar.gz
/libavif-0.9.0.tar.gz
/libavif-0.9.1.tar.gz
/libavif-0.9.2.tar.gz
/libavif-0.9.3.tar.gz
/libavif-0.10.1.tar.gz
/libavif-0.11.1.tar.gz

@ -0,0 +1 @@
17c55031b395305b2694cfba63193912778525bb SOURCES/libavif-1.0.4.tar.gz

@ -0,0 +1,88 @@
From b10d2697e9ed2fb09cb722335ff4342c353612b8 Mon Sep 17 00:00:00 2001
From: Yannis Guyon <yguyon@google.com>
Date: Mon, 12 Feb 2024 10:29:02 +0000
Subject: [PATCH] Encode alpha as 4:2:0 with SVT (#2004)
---
src/codec_svt.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/src/codec_svt.c b/src/codec_svt.c
index 58a92cdce..ea9efc2b5 100644
--- a/src/codec_svt.c
+++ b/src/codec_svt.c
@@ -7,6 +7,7 @@
#include "svt-av1/EbSvtAv1Enc.h"
+#include <stdint.h>
#include <string.h>
// The SVT_AV1_VERSION_MAJOR, SVT_AV1_VERSION_MINOR, SVT_AV1_VERSION_PATCHLEVEL, and
@@ -76,6 +77,7 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
avifResult result = AVIF_RESULT_UNKNOWN_ERROR;
EbColorFormat color_format = EB_YUV420;
+ uint8_t * uvPlanes = NULL; // 4:2:0 U and V placeholder for alpha because SVT-AV1 does not support 4:0:0.
EbBufferHeaderType * input_buffer = NULL;
EbErrorType res = EB_ErrorNone;
@@ -98,6 +100,7 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
y_shift = 1;
break;
case AVIF_PIXEL_FORMAT_YUV400:
+ // Setting color_format = EB_YUV400; results in "Svt[error]: Instance 1: Only support 420 now".
case AVIF_PIXEL_FORMAT_NONE:
case AVIF_PIXEL_FORMAT_COUNT:
default:
@@ -198,16 +201,38 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
}
EbSvtIOFormat * input_picture_buffer = (EbSvtIOFormat *)input_buffer->p_buffer;
- int bytesPerPixel = image->depth > 8 ? 2 : 1;
+ const uint32_t bytesPerPixel = image->depth > 8 ? 2 : 1;
+ const uint32_t uvHeight = (image->height + y_shift) >> y_shift;
if (alpha) {
input_picture_buffer->y_stride = image->alphaRowBytes / bytesPerPixel;
input_picture_buffer->luma = image->alphaPlane;
input_buffer->n_filled_len = image->alphaRowBytes * image->height;
+
+#if SVT_AV1_CHECK_VERSION(1, 8, 0)
+ // Simulate 4:2:0 UV planes. SVT-AV1 does not support 4:0:0 samples.
+ const uint32_t uvWidth = (image->width + y_shift) >> y_shift;
+ const uint32_t uvRowBytes = uvWidth * bytesPerPixel;
+ const uint32_t uvSize = uvRowBytes * uvHeight;
+ uvPlanes = avifAlloc(uvSize);
+ if (uvPlanes == NULL) {
+ goto cleanup;
+ }
+ memset(uvPlanes, 0, uvSize);
+ input_picture_buffer->cb = uvPlanes;
+ input_buffer->n_filled_len += uvSize;
+ input_picture_buffer->cr = uvPlanes;
+ input_buffer->n_filled_len += uvSize;
+ input_picture_buffer->cb_stride = uvWidth;
+ input_picture_buffer->cr_stride = uvWidth;
+#else
+ // This workaround was not needed before SVT-AV1 1.8.0.
+ // See https://github.com/AOMediaCodec/libavif/issues/1992.
+ (void)uvPlanes;
+#endif
} else {
input_picture_buffer->y_stride = image->yuvRowBytes[0] / bytesPerPixel;
input_picture_buffer->luma = image->yuvPlanes[0];
input_buffer->n_filled_len = image->yuvRowBytes[0] * image->height;
- uint32_t uvHeight = (image->height + y_shift) >> y_shift;
input_picture_buffer->cb = image->yuvPlanes[1];
input_buffer->n_filled_len += image->yuvRowBytes[1] * uvHeight;
input_picture_buffer->cr = image->yuvPlanes[2];
@@ -232,6 +257,9 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
result = dequeue_frame(codec, output, AVIF_FALSE);
cleanup:
+ if (uvPlanes) {
+ avifFree(uvPlanes);
+ }
if (input_buffer) {
if (input_buffer->p_buffer) {
avifFree(input_buffer->p_buffer);

@ -0,0 +1,300 @@
## START: Set by rpmautospec
## (rpmautospec version 0.7.2)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 7;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
# Break dependency cycles by disabling certain optional dependencies.
%bcond_with bootstrap
# Break aom dependency cycle:
# vmaf → aom → avif
%if %{with bootstrap}
# Build without aom
%bcond_with aom
# Build without SVT-AV1
%bcond_with svt
%else
# Build with aom
%bcond_without aom
# Build SVT-AV1
%bcond_without svt
%endif
%if (0%{?rhel} && 0%{?rhel} < 9) || 0%{?rhel} >= 10
%bcond_with rav1e
%else
%bcond_without rav1e
%endif
%if 0%{?rhel} >= 10
%bcond_with gtest
%else
%bcond_without gtest
%endif
%bcond_without check
Name: libavif
Version: 1.0.4
Release: %autorelease
Summary: Library for encoding and decoding .avif files
License: BSD-2-Clause
URL: https://github.com/AOMediaCodec/libavif
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Encode alpha as 4:2:0 with SVT. Fix build with SVT-AV1 2.0.0
Patch0: https://github.com/AOMediaCodec/libavif/commit/b10d2697e9ed2fb09cb722335ff4342c353612b8.patch
BuildRequires: cmake
BuildRequires: gcc-c++
%{?with_check:%{?with_gtest:BuildRequires: gtest-devel}}
BuildRequires: nasm
%if %{with aom}
BuildRequires: pkgconfig(aom)
%endif
BuildRequires: pkgconfig(dav1d)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
%{?with_rav1e:BuildRequires: pkgconfig(rav1e)}
%{?with_svt:BuildRequires: pkgconfig(SvtAv1Enc)}
BuildRequires: pkgconfig(zlib)
%description
This library aims to be a friendly, portable C implementation of the AV1 Image
File Format, as described here:
https://aomediacodec.github.io/av1-avif/
%package devel
Summary: Development files for libavif
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
This package holds the development files for libavif.
%package tools
Summary: Tools to encode and decode AVIF files
%description tools
This library aims to be a friendly, portable C implementation of the AV1 Image
File Format, as described here:
https://aomediacodec.github.io/av1-avif/
This package holds the commandline tools to encode and decode AVIF files.
%package -n avif-pixbuf-loader
Summary: AVIF image loader for GTK+ applications
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
Requires: gdk-pixbuf2%{?_isa}
%description -n avif-pixbuf-loader
Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
%prep
%autosetup -p1
%build
%cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
%{?with_aom:-DAVIF_CODEC_AOM=1} \
-DAVIF_CODEC_DAV1D=1 \
%{?with_rav1e:-DAVIF_CODEC_RAV1E=1} \
%{?with_svt:-DAVIF_CODEC_SVT=1} \
-DAVIF_BUILD_APPS=1 \
-DAVIF_BUILD_GDK_PIXBUF=1 \
%{?with_check:-DAVIF_BUILD_TESTS=1 -DAVIF_ENABLE_GTEST=%{with gtest}}
%cmake_build
%install
%cmake_install
%if %{with check}
%check
%ctest
%endif
%files
%license LICENSE
# Do not glob the soname
%{_libdir}/libavif.so.16*
%{_datadir}/thumbnailers/avif.thumbnailer
%files devel
%{_libdir}/libavif.so
%{_includedir}/avif/
%{_libdir}/cmake/libavif/
%{_libdir}/pkgconfig/libavif.pc
%files tools
%doc CHANGELOG.md README.md
%{_bindir}/avifdec
%{_bindir}/avifenc
%files -n avif-pixbuf-loader
%{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-avif.so
%changelog
* Tue Dec 24 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 1.0.4-7
- Rebuilt for MSVSphere 10
## START: Generated by rpmautospec
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Jul 16 2024 Nicolas Chauvet <kwizart@gmail.com> - 1.0.4-6
- Un-bootstrap for vmaf
* Tue Jul 16 2024 Nicolas Chauvet <kwizart@gmail.com> - 1.0.4-5
- Fix description
* Tue Jul 16 2024 Nicolas Chauvet <kwizart@gmail.com> - 1.0.4-4
- Implement bootstrap for aom/svt deps
* Wed May 29 2024 Robert-André Mauchin <zebob.m@gmail.com> - 1.0.4-3
- Rebuild for svt-av1 2.1.0
* Sat Apr 13 2024 Robert-André Mauchin <zebob.m@gmail.com> - 1.0.4-2
- Fix build with SVT-AV1 2.0.0
* Sun Feb 25 2024 Robert-André Mauchin <zebob.m@gmail.com> - 1.0.4-1
- Update to 1.0.4
* Wed Jan 31 2024 František Zatloukal <fzatlouk@redhat.com> - 1.0.3-1
- Update to 1.0.3
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 12 2024 Fabio Valentini <decathorpe@gmail.com> - 0.11.1-12
- Rebuild for dav1d 1.3.0
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 21 2023 Jiri Kucera <jkucera@redhat.com> - 0.11.1-10
- Drop gtest on RHEL
* Fri Mar 17 2023 Dominik 'Rathann' Mierzejewski <dominik@greysector.net> - 0.11.1-9
- ensure gdk-pixbuf2 dependency matches avif-pixbuf-loader arch
* Fri Mar 17 2023 Dominik 'Rathann' Mierzejewski <dominik@greysector.net> - 0.11.1-8
- enable tests
* Fri Mar 17 2023 Dominik 'Rathann' Mierzejewski <dominik@greysector.net> - 0.11.1-7
- enable svt-av1 support on all arches (resolves rhbz#2162675)
* Thu Feb 23 2023 Andreas Schneider <asn@cryptomilk.org> - 0.11.1-6
- Update License to SPDX expressions
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Dec 01 2022 Kalev Lember <klember@redhat.com> - 0.11.1-4
- Enable rav1e support for EPEL 9
* Wed Nov 30 2022 Kalev Lember <klember@redhat.com> - 0.11.1-3
- Fix rav1e conditional for non-RHEL
* Thu Nov 03 2022 Kalev Lember <klember@redhat.com> - 0.11.1-2
- Fix typo in devel package summary
* Sun Oct 23 2022 Robert-André Mauchin <zebob.m@gmail.com> - 0.11.1-1
- Update to 0.11.1
* Sun Oct 23 2022 Robert-André Mauchin <zebob.m@gmail.com> - 0.10.1-4
- Add condition for rav1e for EPEL integration - Close: rhbz#2071940
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jun 24 2022 Stephen Gallagher <sgallagh@redhat.com> - 0.10.1-2
- Rebuild for libdav1d soname bump in ELN
* Mon Jun 20 2022 Robert-André Mauchin <zebob.m@gmail.com> - 0.10.1-1
- Update to 0.10.1 Close: rhbz#2073138
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Dec 28 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.9.3-2
- Rebuild
* Mon Nov 29 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.9.3-1
- Update to 0.9.3 Close: rhbz#2016224
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sun Jun 13 13:40:21 CEST 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.9.1-2
- Rebuilt for aom v3.1.1
* Sun May 23 19:44:09 CEST 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.9.1-1
- Update to 0.9.1
- Close: rhbz#1937556
* Mon Mar 15 2021 Andreas Schneider <asn@redhat.com> - 0.9.0-1
- Update to version 0.9.0
* Wed Mar 10 2021 Leigh Scott <leigh123linux@gmail.com> - 0.8.4-5
- Build with aom
* Wed Mar 10 2021 Leigh Scott <leigh123linux@gmail.com> - 0.8.4-4
- Build without aom for new vmaf version
* Sat Feb 20 2021 Andreas Schneider <asn@redhat.com> - 0.8.4-4
- Build release with debug info
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Dec 14 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.4-2
- Rebuild for dav1d SONAME bump
* Wed Dec 09 05:52:07 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.4-1
- Update to version 0.8.4
* Mon Oct 19 2020 Andreas Schneider <asn@redhat.com> - 0.8.2-1
- Update to version 0.8.2
https://github.com/AOMediaCodec/libavif/blob/master/CHANGELOG.md
* Thu Aug 06 22:14:02 CEST 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.1-1
- Update to 0.8.1
* Wed Aug 05 21:17:23 CEST 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.0-1
- Update to 0.8.0
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.3-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri May 22 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.7.3-1
- Update to 0.7.3
* Wed Apr 29 2020 Andreas Schneider <asn@redhat.com> - 0.7.2-1
- Update to version 0.7.2
* https://github.com/AOMediaCodec/libavif/blob/master/CHANGELOG.md
* Wed Apr 29 2020 Andreas Schneider <asn@redhat.com> - 0.7.1-1
- Update to version 0.7.1
* Wed Mar 04 2020 Andreas Schneider <asn@redhat.com> - 0.5.7-1
- Update to version 0.5.7
* Wed Mar 04 2020 Andreas Schneider <asn@redhat.com> - 0.5.3-2
- Fix License
* Sun Feb 16 2020 Andreas Schneider <asn@redhat.com> - 0.5.3-1
- Initial version
## END: Generated by rpmautospec

@ -1,105 +0,0 @@
# Build with aom
%bcond_without aom
# Build SVT-AV1
%ifarch x86_64
%bcond_without svt
%endif
%if 0%{?rhel} && 0%{?rhel} < 9
%bcond_with rav1e
%else
%bcond_without rav1e
%endif
Name: libavif
Version: 0.11.1
Release: %autorelease
Summary: Library for encoding and decoding .avif files
License: BSD
URL: https://github.com/AOMediaCodec/libavif
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: nasm
%if %{with aom}
BuildRequires: pkgconfig(aom)
%endif
BuildRequires: pkgconfig(dav1d)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
%{?with_rav1e:BuildRequires: pkgconfig(rav1e)}
%{?with_svt:BuildRequires: pkgconfig(SvtAv1Enc)}
BuildRequires: pkgconfig(zlib)
%description
This library aims to be a friendly, portable C implementation of the AV1 Image
File Format, as described here:
https://aomediacodec.github.io/av1-avif/
%package devel
Summary: Development files for libavif
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
This package holds the development files for libavif.
%package tools
Summary: Tools to encode and decode AVIF files
%description tools
This library aims to be a friendly, portable C implementation of the AV1 Image
File Format, as described here:
https://aomediacodec.github.io/av1-avif/
This package holds the commandline tools to encode and decode AVIF files.
%package -n avif-pixbuf-loader
Summary: AVIF image loader for GTK+ applications
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
Requires: gdk-pixbuf2
%description -n avif-pixbuf-loader
Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
%prep
%autosetup -p1
%build
%cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
%{?with_aom:-DAVIF_CODEC_AOM=1} \
-DAVIF_CODEC_DAV1D=1 \
%{?with_rav1e:-DAVIF_CODEC_RAV1E=1} \
%{?with_svt:-DAVIF_CODEC_SVT=1} \
-DAVIF_BUILD_APPS=1 \
-DAVIF_BUILD_GDK_PIXBUF=1
%cmake_build
%install
%cmake_install
%files
%license LICENSE
# Do not glob the soname
%{_libdir}/libavif.so.15*
%{_datadir}/thumbnailers/avif.thumbnailer
%files devel
%{_libdir}/libavif.so
%{_includedir}/avif/
%{_libdir}/cmake/libavif/
%{_libdir}/pkgconfig/libavif.pc
%files tools
%doc CHANGELOG.md README.md
%{_bindir}/avifdec
%{_bindir}/avifenc
%files -n avif-pixbuf-loader
%{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-avif.so
%changelog
%autochangelog

@ -1 +0,0 @@
SHA512 (libavif-0.11.1.tar.gz) = 4a9e2711fccddf35c477db6e2fa2f76c0648aafaa98b4e3f34df62c0fbd02ddcd57762f1f8149822da4f1bc3757ee75ec1d9ced5e56a54dbe9d0b43265aacd4c
Loading…
Cancel
Save