[packages/libav] - up to 12.3; current libvpx is not supported by libav (even git master) - added x264 patch from git
qboosh
qboosh at pld-linux.org
Wed Apr 1 20:05:39 CEST 2020
commit dab6d7acec3e115b683b6d410935115144986083
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Apr 1 20:05:34 2020 +0200
- up to 12.3; current libvpx is not supported by libav (even git master)
- added x264 patch from git (support for x264 ABI >= 153)
libav-x264.patch | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
libav.spec | 8 +++---
2 files changed, 87 insertions(+), 3 deletions(-)
---
diff --git a/libav.spec b/libav.spec
index 8362dcb..2e003f8 100644
--- a/libav.spec
+++ b/libav.spec
@@ -29,7 +29,7 @@
%bcond_without x264 # x264 encoder
%bcond_without x265 # H.265/HEVC x265 encoder
%bcond_without va # VAAPI (Video Acceleration API)
-%bcond_without vpx # VP8, a high-quality video codec
+%bcond_with vpx # VP8, a high-quality video codec [not ready for 1.4+?]
%bcond_without wavpack # wavpack encoding support
%bcond_without webp # WebP encoding support
%bcond_without doc # don't build docs
@@ -43,7 +43,7 @@
Summary: libav - Open Source audio and video processing tools
Summary(pl.UTF-8): libav - narzędzia do przetwarzania dźwięku i obrazu o otwartych źródłach
Name: libav
-Version: 12.2
+Version: 12.3
Release: 0.1
# LGPL or GPL, chosen at configure time (GPL version is more featured)
# (some filters, x264, x265, xavs, xvid, x11grab)
@@ -51,9 +51,10 @@ Release: 0.1
License: GPL v3+ with LGPL v3+ parts
Group: Libraries
Source0: https://libav.org/releases/%{name}-%{version}.tar.xz
-# Source0-md5: 69b5d9de6e4b2fbf6956653f61c7ffe1
+# Source0-md5: 753ec26481b0582eb737383bd8a350a5
Patch0: %{name}-opencv24.patch
Patch1: %{name}-omx-libnames.patch
+Patch2: %{name}-x264.patch
URL: https://libav.org/
# libomxil-bellagio-devel or limoi-core-devel (just headers, library is dlopened at runtime)
%{?with_omx:BuildRequires: OpenMAX-IL-devel}
@@ -259,6 +260,7 @@ testowania różnych API libav.
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
# package the grep result for mplayer, the result formatted as ./mplayer/configure
cat <<EOF > libav-avconfig
diff --git a/libav-x264.patch b/libav-x264.patch
new file mode 100644
index 0000000..efd34f8
--- /dev/null
+++ b/libav-x264.patch
@@ -0,0 +1,82 @@
+From c6558e8840fbb2386bf8742e4d68dd6e067d262e Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero at gentoo.org>
+Date: Tue, 26 Dec 2017 12:32:42 +0100
+Subject: [PATCH] x264: Support version 153
+
+It has native simultaneus 8 and 10 bit support.
+---
+ libavcodec/libx264.c | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
+index 0dec12edd2..3dc53aaf38 100644
+--- a/libavcodec/libx264.c
++++ b/libavcodec/libx264.c
+@@ -243,7 +243,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
+
+ x264_picture_init( &x4->pic );
+ x4->pic.img.i_csp = x4->params.i_csp;
++#if X264_BUILD >= 153
++ if (x4->params.i_bitdepth > 8)
++#else
+ if (x264_bit_depth > 8)
++#endif
+ x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
+ x4->pic.img.i_plane = 3;
+
+@@ -395,6 +399,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
+ x4->params.p_log_private = avctx;
+ x4->params.i_log_level = X264_LOG_DEBUG;
+ x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
++#if X264_BUILD >= 153
++ x4->params.i_bitdepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
++#endif
+
+ if (avctx->bit_rate) {
+ x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
+@@ -659,6 +666,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ return 0;
+ }
+
++#if X264_BUILD < 153
+ static const enum AVPixelFormat pix_fmts_8bit[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVJ420P,
+@@ -685,15 +693,37 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
+ AV_PIX_FMT_NV20,
+ AV_PIX_FMT_NONE
+ };
++#else
++static const enum AVPixelFormat pix_fmts_all[] = {
++ AV_PIX_FMT_YUV420P,
++ AV_PIX_FMT_YUVJ420P,
++ AV_PIX_FMT_YUV422P,
++ AV_PIX_FMT_YUVJ422P,
++ AV_PIX_FMT_YUV444P,
++ AV_PIX_FMT_YUVJ444P,
++ AV_PIX_FMT_NV12,
++ AV_PIX_FMT_NV16,
++ AV_PIX_FMT_NV21,
++ AV_PIX_FMT_YUV420P10,
++ AV_PIX_FMT_YUV422P10,
++ AV_PIX_FMT_YUV444P10,
++ AV_PIX_FMT_NV20,
++ AV_PIX_FMT_NONE
++};
++#endif
+
+ static av_cold void X264_init_static(AVCodec *codec)
+ {
++#if X264_BUILD < 153
+ if (x264_bit_depth == 8)
+ codec->pix_fmts = pix_fmts_8bit;
+ else if (x264_bit_depth == 9)
+ codec->pix_fmts = pix_fmts_9bit;
+ else if (x264_bit_depth == 10)
+ codec->pix_fmts = pix_fmts_10bit;
++#else
++ codec->pix_fmts = pix_fmts_all;
++#endif
+ }
+
+ #define OFFSET(x) offsetof(X264Context, x)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libav.git/commitdiff/dab6d7acec3e115b683b6d410935115144986083
More information about the pld-cvs-commit
mailing list