Commit 3d5b5f04 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all:
tar xf libav-12.3.tar.xz
patch -Np1 -d libav-12.3 < libav-12.3-new_libx264.patch
cd libav-12.3 && ./configure --prefix=/usr --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --enable-libx264
$(MAKE) -C libav-12.3
$(MAKE) -C libav-12.3 install
rm -rf libav-12.3
From: Vladimir Bashkirtsev <vladimir@bashkirtsev.com>
Date: Sun, 7 Feb 2021 08:41:09 +0000
Subject: avcodec/libx264: fix compilation with x264 >= 153
avcodec/libx264: fix compilation with x264 >= 153
libav uses very dated libx264. Modern libx264 is needed to avoid incompatibilities
with modern browsers (which use relative new libx264 with support of current
levels of H264 standard).
Signed-off-by: Vladimir Bashkirtsev <vladimir@bashkirtsev.com>
---
diff -uNr libav-12.3/libavcodec/libx264.c libav-12.3-new_libx264/libavcodec/libx264.c
--- libav-12.3/libavcodec/libx264.c 2018-02-13 07:55:59.000000000 +1030
+++ libav-12.3-new_libx264/libavcodec/libx264.c 2021-02-08 12:20:00.116829209 +1030
@@ -243,7 +243,11 @@
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 @@
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;
@@ -701,15 +708,40 @@
AV_PIX_FMT_NV20,
AV_PIX_FMT_NONE
};
+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,
+#ifdef X264_CSP_NV21
+ AV_PIX_FMT_NV21,
+#endif
+ AV_PIX_FMT_YUV420P10,
+ AV_PIX_FMT_YUV422P10,
+ AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_NV20,
+#ifdef X264_CSP_I400
+ AV_PIX_FMT_GRAY8,
+#endif
+ AV_PIX_FMT_NONE
+};
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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment