Skip to content

Commit

Permalink
ffmpeg: update to 4.2.2-Matrix-Alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
lrusak committed Mar 6, 2020
1 parent dda26f0 commit f99c2e0
Show file tree
Hide file tree
Showing 34 changed files with 1,126 additions and 1,049 deletions.
6 changes: 3 additions & 3 deletions packages/multimedia/ffmpeg/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="ffmpeg"
# Current branch is: release/4.0-kodi
PKG_VERSION="4.0.4-Leia-18.4"
PKG_SHA256="e11e7594af35f36ab2711252c3d6bb106908f26605498aef4a9be2d7bc001db2"
# Current branch is: release/4.2-kodi
PKG_VERSION="4.2.2-Matrix-Alpha1"
PKG_SHA256="0dba571f9809588cfbdc29d6a551dab4cd5736701653d9263847c9ac67bcde86"
PKG_LICENSE="LGPLv2.1+"
PKG_SITE="https://ffmpeg.org"
PKG_URL="https://github.com/xbmc/FFmpeg/archive/${PKG_VERSION}.tar.gz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
From 7adc8f706efab65d8d7e5f960690faca3d5c190d Mon Sep 17 00:00:00 2001
From 85417a4ba42360248b4999e458a6e05c1c2f9b17 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sat, 4 Mar 2017 19:24:02 +0000
Subject: [PATCH] ffmpeg: Call get_format to fix an issue with MMAL rendering

---
libavcodec/dvdec.c | 7 +++++++
libavcodec/dvdec.c | 6 ++++++
libavcodec/rv34.c | 6 +++++-
2 files changed, 12 insertions(+), 1 deletion(-)
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 0b4c1bc..00081ef 100644
index 89864f2edc..b5f9224d72 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -49,6 +49,7 @@
#include "internal.h"
#include "put_bits.h"
#include "simple_idct.h"
+#include "thread.h"

typedef struct BlockInfo {
const uint32_t *factor_table;
@@ -196,6 +197,12 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
@@ -197,6 +197,12 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
s->idct_put[0] = idsp.idct_put;
s->idct_put[1] = ff_simple_idct248_put;

Expand All @@ -34,10 +26,10 @@ index 0b4c1bc..00081ef 100644
}

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index aca8382..f473f6c 100644
index d171e6e1bd..f6f0aa1f74 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1493,7 +1493,11 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
@@ -1499,7 +1499,11 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
ff_mpv_decode_init(s, avctx);
s->out_format = FMT_H263;

Expand All @@ -51,5 +43,5 @@ index aca8382..f473f6c 100644
s->low_delay = 0;

--
2.7.4
2.20.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d8bdcc8791c501921ee8961f3b0de0bd47668ebf Mon Sep 17 00:00:00 2001
From 848de6c1923820f1de49ed7875d6c8877d0c321c Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 5 Jun 2015 22:48:33 +0100
Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp
Expand All @@ -10,10 +10,10 @@ Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp
2 files changed, 5 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c26b6d607c..6c4b011b5c 100644
index a36b675fba..880284d5bd 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2965,6 +2965,7 @@ typedef struct AVCodecContext {
@@ -2612,6 +2612,7 @@ typedef struct AVCodecContext {
#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
#define FF_BUG_TRUNCATED 16384
#define FF_BUG_IEDGE 32768
Expand All @@ -22,10 +22,10 @@ index c26b6d607c..6c4b011b5c 100644
/**
* strictly follow the standard (MPEG-4, ...).
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index cd39131d55..d8c8227cb4 100644
index 055afabc7e..fa208660c8 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2250,6 +2250,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
@@ -2662,6 +2662,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)

if (ctx->divx_version >= 0)
s->workaround_bugs |= FF_BUG_HPEL_CHROMA;
Expand All @@ -35,7 +35,7 @@ index cd39131d55..d8c8227cb4 100644
}

if (s->workaround_bugs & FF_BUG_STD_QPEL) {
@@ -2274,6 +2277,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
@@ -2686,6 +2689,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
s->workaround_bugs, ctx->lavc_build, ctx->xvid_build,
ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : "");

Expand All @@ -44,5 +44,5 @@ index cd39131d55..d8c8227cb4 100644
s->codec_id == AV_CODEC_ID_MPEG4 &&
avctx->idct_algo == FF_IDCT_AUTO) {
--
2.14.1
2.20.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 20af7af23a9f366476e67669f14957dfaf58f141 Mon Sep 17 00:00:00 2001
From a853a9c70339c30ea4d5081366fee4bb84bc09c5 Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Sat, 9 Jan 2016 16:34:09 +0100
Subject: [PATCH 1/4] avcodec: add h264_mvc codec id and profiles
Expand All @@ -11,19 +11,19 @@ Subject: [PATCH 1/4] avcodec: add h264_mvc codec id and profiles
4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d962b9cf0a..4c4581c895 100644
index 880284d5bd..88e01645cd 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -447,6 +447,8 @@ enum AVCodecID {
AV_CODEC_ID_GDV,
AV_CODEC_ID_FITS,
@@ -458,6 +458,8 @@ enum AVCodecID {
AV_CODEC_ID_LSCR,
AV_CODEC_ID_VP4,

+ AV_CODEC_ID_H264_MVC,
+
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
AV_CODEC_ID_PCM_S16LE = 0x10000,
@@ -2895,6 +2897,7 @@ typedef struct AVCodecContext {
@@ -2950,6 +2952,7 @@ typedef struct AVCodecContext {
#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
#define FF_PROFILE_H264_CAVLC_444 44
Expand All @@ -32,12 +32,12 @@ index d962b9cf0a..4c4581c895 100644
#define FF_PROFILE_VC1_SIMPLE 0
#define FF_PROFILE_VC1_MAIN 1
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 79552a910d..b55955476c 100644
index 4d033c20ff..def006e033 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1647,6 +1647,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("FITS (Flexible Image Transport System)"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
@@ -1726,6 +1726,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("On2 VP4"),
.props = AV_CODEC_PROP_LOSSY,
},
+ {
+ .id = AV_CODEC_ID_H264_MVC,
Expand All @@ -50,10 +50,10 @@ index 79552a910d..b55955476c 100644
/* various PCM "codecs" */
{
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index d7dc960f36..e4651f12f9 100644
index eaf0d68d32..fc1e152420 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -72,6 +72,7 @@ const AVProfile ff_h264_profiles[] = {
@@ -71,6 +71,7 @@ const AVProfile ff_h264_profiles[] = {
{ FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
{ FF_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" },
{ FF_PROFILE_H264_STEREO_HIGH, "Stereo High" },
Expand All @@ -62,10 +62,10 @@ index d7dc960f36..e4651f12f9 100644
};

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 37a6aa8bff..52c5b659c4 100644
index 0415ceea02..264bf9718b 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -701,7 +701,7 @@ static const StreamType ISO_types[] = {
@@ -798,7 +798,7 @@ static const StreamType ISO_types[] = {
#endif
{ 0x1b, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 },
{ 0x1c, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC },
Expand All @@ -75,36 +75,21 @@ index 37a6aa8bff..52c5b659c4 100644
{ 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC },
{ 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS },
--
2.17.0
2.20.1


From 0f3fda4e348e6b12570f5d279713f6da46511846 Mon Sep 17 00:00:00 2001
From 8d479b1b5395f97a8e5ee0eddab6680941edfb5b Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Sat, 9 Jan 2016 16:34:40 +0100
Subject: [PATCH 2/4] h264_parser: add support for parsing h264 mvc NALUs

---
libavcodec/h264.h | 2 ++
libavcodec/h264_parser.c | 34 ++++++++++++++++++++++++++++++----
libavcodec/parser.c | 1 +
3 files changed, 33 insertions(+), 4 deletions(-)
libavcodec/parsers.c | 1 +
2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 650580bf3a..c44a0cbedd 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -41,7 +41,9 @@ enum {
H264_NAL_END_STREAM = 11,
H264_NAL_FILLER_DATA = 12,
H264_NAL_SPS_EXT = 13,
+ H264_NAL_SPS_SUBSET = 15,
H264_NAL_AUXILIARY_SLICE = 19,
+ H264_NAL_SLICE_EXT = 20,
};


diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 1a9840a62c..be8b9db9b0 100644
index 5f9a9c46ef..991e8e82f3 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -62,6 +62,7 @@ typedef struct H264ParseContext {
Expand All @@ -121,22 +106,22 @@ index 1a9840a62c..be8b9db9b0 100644
if (nalu_type == H264_NAL_SEI || nalu_type == H264_NAL_SPS ||
- nalu_type == H264_NAL_PPS || nalu_type == H264_NAL_AUD) {
+ nalu_type == H264_NAL_PPS || nalu_type == H264_NAL_AUD ||
+ nalu_type == H264_NAL_SPS_SUBSET) {
+ nalu_type == H264_NAL_SUB_SPS) {
if (pc->frame_start_found) {
i++;
goto found;
}
} else if (nalu_type == H264_NAL_SLICE || nalu_type == H264_NAL_DPA ||
- nalu_type == H264_NAL_IDR_SLICE) {
+ nalu_type == H264_NAL_IDR_SLICE || (p->is_mvc && nalu_type == H264_NAL_SLICE_EXT)) {
+ nalu_type == H264_NAL_IDR_SLICE || (p->is_mvc && nalu_type == H264_NAL_EXTEN_SLICE)) {
state += 8;
+
+ if (nalu_type == H264_NAL_SLICE_EXT)
+ if (nalu_type == H264_NAL_EXTEN_SLICE)
+ i += 3; // skip mvc extension
continue;
}
state = 7;
@@ -601,7 +606,8 @@ static int h264_parse(AVCodecParserContext *s,
@@ -604,7 +609,8 @@ static int h264_parse(AVCodecParserContext *s,
}
}

Expand All @@ -146,16 +131,16 @@ index 1a9840a62c..be8b9db9b0 100644

if (avctx->framerate.num)
avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
@@ -658,7 +664,7 @@ static int h264_split(AVCodecContext *avctx,
@@ -661,7 +667,7 @@ static int h264_split(AVCodecContext *avctx,
if ((state & 0xFFFFFF00) != 0x100)
break;
nalu_type = state & 0x1F;
- if (nalu_type == H264_NAL_SPS) {
+ if (nalu_type == H264_NAL_SPS || nalu_type == H264_NAL_SPS_SUBSET) {
+ if (nalu_type == H264_NAL_SPS || nalu_type == H264_NAL_SUB_SPS) {
has_sps = 1;
} else if (nalu_type == H264_NAL_PPS)
has_pps = 1;
@@ -710,3 +716,23 @@ AVCodecParser ff_h264_parser = {
@@ -713,3 +719,23 @@ AVCodecParser ff_h264_parser = {
.parser_close = h264_close,
.split = h264_split,
};
Expand All @@ -179,11 +164,11 @@ index 1a9840a62c..be8b9db9b0 100644
+ .parser_close = h264_close,
+ .split = h264_split,
+};
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index f43b197d5e..f96e005ef3 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -54,6 +54,7 @@ extern AVCodecParser ff_gsm_parser;
diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c
index 33a71de8a0..80b269b324 100644
--- a/libavcodec/parsers.c
+++ b/libavcodec/parsers.c
@@ -47,6 +47,7 @@ extern AVCodecParser ff_gsm_parser;
extern AVCodecParser ff_h261_parser;
extern AVCodecParser ff_h263_parser;
extern AVCodecParser ff_h264_parser;
Expand All @@ -192,10 +177,10 @@ index f43b197d5e..f96e005ef3 100644
extern AVCodecParser ff_mjpeg_parser;
extern AVCodecParser ff_mlp_parser;
--
2.17.0
2.20.1


From cdd668dc436b9c78dcb31df477e329492356e7ec Mon Sep 17 00:00:00 2001
From e2cad00490c9cd339b9266e8b9fe5d86afe2abe1 Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Tue, 28 Nov 2017 16:12:12 +0000
Subject: [PATCH 3/4] h264_parser: force grabing a new timestamp until a frame
Expand All @@ -206,10 +191,10 @@ Subject: [PATCH 3/4] h264_parser: force grabing a new timestamp until a frame
1 file changed, 3 insertions(+)

diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index be8b9db9b0..81c9a1bbae 100644
index 991e8e82f3..f573bd8629 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -594,6 +594,9 @@ static int h264_parse(AVCodecParserContext *s,
@@ -597,6 +597,9 @@ static int h264_parse(AVCodecParserContext *s,
} else {
next = h264_find_frame_end(p, buf, buf_size, avctx);

Expand All @@ -220,10 +205,10 @@ index be8b9db9b0..81c9a1bbae 100644
*poutbuf = NULL;
*poutbuf_size = 0;
--
2.17.0
2.20.1


From fb0ec9a132d6eb8fd74348ef87b1176c7ca34a00 Mon Sep 17 00:00:00 2001
From fc2954e5eba1791443016cdd17fcea280f464db5 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 28 May 2018 13:35:36 +0100
Subject: [PATCH 4/4] fixup
Expand All @@ -233,52 +218,52 @@ Subject: [PATCH 4/4] fixup
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c
index 082b3e749b..7612749efc 100644
index 85cf615ffa..b5f1657528 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -59,7 +59,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
@@ -138,7 +138,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS,
};
static const int extradata_nal_types_h264[] = {
- H264_NAL_SPS, H264_NAL_PPS,
+ H264_NAL_SPS, H264_NAL_SPS_SUBSET, H264_NAL_PPS,
+ H264_NAL_SPS, H264_NAL_SUB_SPS, H264_NAL_PPS,
};

ExtractExtradataContext *s = ctx->priv_data;
@@ -90,7 +90,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
@@ -169,7 +169,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
if (nal->type == HEVC_NAL_SPS) has_sps = 1;
if (nal->type == HEVC_NAL_VPS) has_vps = 1;
} else {
- if (nal->type == H264_NAL_SPS) has_sps = 1;
+ if (nal->type == H264_NAL_SPS || nal->type == H264_NAL_SPS_SUBSET) has_sps = 1;
+ if (nal->type == H264_NAL_SPS || nal->type == H264_NAL_SUB_SPS) has_sps = 1;
}
} else if (s->remove) {
filtered_size += nal->raw_size + 3;
@@ -99,7 +99,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
@@ -178,7 +178,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,

if (extradata_size &&
((ctx->par_in->codec_id == AV_CODEC_ID_HEVC && has_sps && has_vps) ||
- (ctx->par_in->codec_id == AV_CODEC_ID_H264 && has_sps))) {
+ ((ctx->par_in->codec_id == AV_CODEC_ID_H264 || ctx->par_in->codec_id == AV_CODEC_ID_H264_MVC) && has_sps))) {
AVBufferRef *filtered_buf;
AVBufferRef *filtered_buf = NULL;
uint8_t *extradata, *filtered_data;

@@ -253,6 +253,7 @@ static const struct {
} extract_tab[] = {
@@ -334,6 +334,7 @@ static const struct {
{ AV_CODEC_ID_AVS2, extract_extradata_mpeg4 },
{ AV_CODEC_ID_CAVS, extract_extradata_mpeg4 },
{ AV_CODEC_ID_H264, extract_extradata_h2645 },
+ { AV_CODEC_ID_H264_MVC, extract_extradata_h2645 },
{ AV_CODEC_ID_HEVC, extract_extradata_h2645 },
{ AV_CODEC_ID_MPEG1VIDEO, extract_extradata_mpeg12 },
{ AV_CODEC_ID_MPEG2VIDEO, extract_extradata_mpeg12 },
@@ -317,6 +318,7 @@ static void extract_extradata_close(AVBSFContext *ctx)
static const enum AVCodecID codec_ids[] = {
@@ -401,6 +402,7 @@ static const enum AVCodecID codec_ids[] = {
AV_CODEC_ID_AVS2,
AV_CODEC_ID_CAVS,
AV_CODEC_ID_H264,
+ AV_CODEC_ID_H264_MVC,
AV_CODEC_ID_HEVC,
AV_CODEC_ID_MPEG1VIDEO,
AV_CODEC_ID_MPEG2VIDEO,
--
2.17.0
2.20.1

Loading

0 comments on commit f99c2e0

Please sign in to comment.