Compare commits
40 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
10245f7ad5 | ||
|
384761e159 | ||
|
0d185a9dfd | ||
|
bba906907a | ||
|
89808a2632 | ||
|
86ce0a99ea | ||
|
51eebc4843 | ||
|
d2a36694ac | ||
|
deb6ac34d7 | ||
|
74fe8c1c53 | ||
|
0a18fc4c00 | ||
|
8e684a6f1e | ||
|
f926b019e8 | ||
|
04e68c22f3 | ||
|
fce50c3ca7 | ||
|
764a8bd4e0 | ||
|
ee784a334e | ||
|
b2268f1483 | ||
|
ce45f637de | ||
|
3dd8c9f065 | ||
|
86c17e6d04 | ||
|
6b08a1112d | ||
|
5e2c32c304 | ||
|
e5ea9fec53 | ||
|
b53103de55 | ||
|
ab13f007ae | ||
|
b85251cdd2 | ||
|
2868dcffff | ||
|
fd6b5a479f | ||
|
309d41c007 | ||
|
6f1a12d20d | ||
|
d72ab6a44f | ||
|
269edbe53f | ||
|
69b7b3cfa5 | ||
|
c0f09f6e9d | ||
|
e181f84e09 | ||
|
27b9d5b930 | ||
|
3e1858b096 | ||
|
d19e550a17 | ||
|
3391bfb0e9 |
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,7 +1,3 @@
|
|||||||
/libavif-0.5.7.tar.gz
|
/libavif-*.tar.gz
|
||||||
/libavif-0.7.1.tar.gz
|
/results_*
|
||||||
/libavif-0.7.2.tar.gz
|
/*.rpm
|
||||||
/libavif-0.7.3.tar.gz
|
|
||||||
/libavif-0.8.0.tar.gz
|
|
||||||
/libavif-0.8.1.tar.gz
|
|
||||||
/libavif-0.8.2.tar.gz
|
|
||||||
|
88
b10d2697e9ed2fb09cb722335ff4342c353612b8.patch
Normal file
88
b10d2697e9ed2fb09cb722335ff4342c353612b8.patch
Normal file
@ -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);
|
63
changelog
Normal file
63
changelog
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
* 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
|
91
libavif.spec
91
libavif.spec
@ -1,19 +1,34 @@
|
|||||||
# Force out of source build
|
# Build with aom
|
||||||
%undefine __cmake_in_source_build
|
|
||||||
|
|
||||||
%bcond_without aom
|
%bcond_without aom
|
||||||
|
# Build SVT-AV1
|
||||||
|
%bcond_without svt
|
||||||
|
%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
|
Name: libavif
|
||||||
Version: 0.8.2
|
Version: 1.0.4
|
||||||
Release: 1%{?dist}
|
Release: %autorelease
|
||||||
Summary: Library for encoding and decoding .avif files
|
Summary: Library for encoding and decoding .avif files
|
||||||
|
|
||||||
License: BSD
|
License: BSD-2-Clause
|
||||||
URL: https://github.com/AOMediaCodec/libavif
|
URL: https://github.com/AOMediaCodec/libavif
|
||||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
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: cmake
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
|
%{?with_check:%{?with_gtest:BuildRequires: gtest-devel}}
|
||||||
BuildRequires: nasm
|
BuildRequires: nasm
|
||||||
%if %{with aom}
|
%if %{with aom}
|
||||||
BuildRequires: pkgconfig(aom)
|
BuildRequires: pkgconfig(aom)
|
||||||
@ -21,7 +36,8 @@ BuildRequires: pkgconfig(aom)
|
|||||||
BuildRequires: pkgconfig(dav1d)
|
BuildRequires: pkgconfig(dav1d)
|
||||||
BuildRequires: pkgconfig(libjpeg)
|
BuildRequires: pkgconfig(libjpeg)
|
||||||
BuildRequires: pkgconfig(libpng)
|
BuildRequires: pkgconfig(libpng)
|
||||||
BuildRequires: pkgconfig(rav1e)
|
%{?with_rav1e:BuildRequires: pkgconfig(rav1e)}
|
||||||
|
%{?with_svt:BuildRequires: pkgconfig(SvtAv1Enc)}
|
||||||
BuildRequires: pkgconfig(zlib)
|
BuildRequires: pkgconfig(zlib)
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -51,7 +67,7 @@ This package holds the commandline tools to encode and decode AVIF files.
|
|||||||
%package -n avif-pixbuf-loader
|
%package -n avif-pixbuf-loader
|
||||||
Summary: AVIF image loader for GTK+ applications
|
Summary: AVIF image loader for GTK+ applications
|
||||||
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
|
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
|
||||||
Requires: gdk-pixbuf2
|
Requires: gdk-pixbuf2%{?_isa}
|
||||||
|
|
||||||
%description -n avif-pixbuf-loader
|
%description -n avif-pixbuf-loader
|
||||||
Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
|
Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
|
||||||
@ -60,19 +76,30 @@ Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
|
|||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake %{?with_aom:-DAVIF_CODEC_AOM=1} \
|
%cmake \
|
||||||
-DAVIF_CODEC_DAV1D=1 \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
-DAVIF_CODEC_RAV1E=1 \
|
%{?with_aom:-DAVIF_CODEC_AOM=1} \
|
||||||
-DAVIF_BUILD_APPS=1 \
|
-DAVIF_CODEC_DAV1D=1 \
|
||||||
-DAVIF_BUILD_GDK_PIXBUF=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
|
%cmake_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%cmake_install
|
%cmake_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
|
%check
|
||||||
|
%ctest
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{_libdir}/libavif.so.*
|
# Do not glob the soname
|
||||||
|
%{_libdir}/libavif.so.16*
|
||||||
|
%{_datadir}/thumbnailers/avif.thumbnailer
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/libavif.so
|
%{_libdir}/libavif.so
|
||||||
@ -89,38 +116,4 @@ Avif-pixbuf-loader contains a plugin to load AVIF images in GTK+ applications.
|
|||||||
%{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-avif.so
|
%{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-avif.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Oct 19 2020 Andreas Schneider <asn@redhat.com> - 0.8.2-1
|
%autochangelog
|
||||||
- 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
|
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (libavif-0.8.2.tar.gz) = 51034084b5a508763653e16512298c3ad57c07022327cf42c9e12728ac30e102c69dc43d6569cb39ee4a63cb81a98947b72201373d3a909b3f1b2f6f59aaa433
|
SHA512 (libavif-1.0.4.tar.gz) = 37f0de757180c6414778e688006940395960b316c25192d6beb97a07942aff4bd3b712dec2eff52cd26f5d72c352731442175dfeb90e2e1381133539760142b0
|
||||||
|
Loading…
Reference in New Issue
Block a user