If we want to build with aom, require version >= 1.1.0

OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libavif?expand=0&rev=8
This commit is contained in:
Andreas Schneider 2020-03-11 06:13:12 +00:00 committed by Git OBS Bridge
parent ae2e97cfa0
commit d28547f282
3 changed files with 10 additions and 60 deletions

View File

@ -1,56 +0,0 @@
From cbcf62c2200be83b85b48059c819ae708216ccec Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Tue, 19 Nov 2019 16:35:03 +0100
Subject: [PATCH] codec: Support building with libaom 1.0.0
---
src/codec_aom.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/codec_aom.c b/src/codec_aom.c
index 090dbbd..b718551 100644
--- a/src/codec_aom.c
+++ b/src/codec_aom.c
@@ -126,7 +126,9 @@ static avifBool aomCodecGetNextImage(avifCodec * codec, avifImage * image)
break;
case AOM_IMG_FMT_YV12:
case AOM_IMG_FMT_AOMYV12:
+#ifdef AOM_IMG_FMT_YV1216
case AOM_IMG_FMT_YV1216:
+#endif
yuvFormat = AVIF_PIXEL_FORMAT_YV12;
break;
case AOM_IMG_FMT_NONE:
@@ -246,8 +248,11 @@ static avifBool aomCodecEncodeImage(avifCodec * codec, avifImage * image, avifEn
// Speed 8: RealTime CpuUsed 6
// Speed 9: RealTime CpuUsed 7
// Speed 10: RealTime CpuUsed 8
- unsigned int aomUsage = AOM_USAGE_GOOD_QUALITY;
+ unsigned int aomUsage = 0;
int aomCpuUsed = -1;
+
+#ifdef AOM_USAGE_GOOD_QUALITY
+ aomUsage = AOM_USAGE_GOOD_QUALITY;
if (encoder->speed != AVIF_SPEED_DEFAULT) {
if (encoder->speed < 8) {
aomUsage = AOM_USAGE_GOOD_QUALITY;
@@ -257,6 +262,7 @@ static avifBool aomCodecEncodeImage(avifCodec * codec, avifImage * image, avifEn
aomCpuUsed = AVIF_CLAMP(encoder->speed - 2, 6, 8);
}
}
+#endif
int yShift = 0;
aom_img_fmt_t aomFormat = avifImageCalcAOMFmt(image, alpha, &yShift);
@@ -300,9 +306,11 @@ static avifBool aomCodecEncodeImage(avifCodec * codec, avifImage * image, avifEn
if (lossless) {
aom_codec_control(&aomEncoder, AV1E_SET_LOSSLESS, 1);
}
+#ifdef AOM_CTRL_AV1E_SET_ROW_MT
if (encoder->maxThreads > 1) {
aom_codec_control(&aomEncoder, AV1E_SET_ROW_MT, 1);
}
+#endif
if (encoder->tileRowsLog2 != 0) {
int tileRowsLog2 = AVIF_CLAMP(encoder->tileRowsLog2, 0, 6);
aom_codec_control(&aomEncoder, AV1E_SET_TILE_ROWS, tileRowsLog2);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 11 06:10:27 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- If we want to build with aom, require version >= 1.1.0
- Removed cbcf62c2200be83b85b48059c819ae708216ccec.patch
-------------------------------------------------------------------
Wed Mar 4 15:09:24 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>

View File

@ -28,16 +28,16 @@ License: BSD-2-Clause
Group: Development/Libraries/C and C++
URL: https://github.com/AOMediaCodec/libavif
Source: https://github.com/AOMediaCodec/libavif/archive/v%{version}/%{name}-%{version}.tar.gz
Patch: https://github.com/cryptomilk/libavif/commit/cbcf62c2200be83b85b48059c819ae708216ccec.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: nasm
BuildRequires: pkgconfig(dav1d)
%if %{with aom}
BuildRequires: pkgconfig(aom)
%endif
BuildRequires: pkgconfig(rav1e)
%if %{with aom}
BuildRequires: pkgconfig(aom) >= 1.1.0
%endif
%description
This library aims to be a friendly, portable C implementation of the AV1 Image
File Format, as described here: