Skip to content

Commit

Permalink
fixup ffmpeg patches
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Jan 19, 2018
1 parent c52ec85 commit 578ff86
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 214a8ccc1489db28ce6cec2739365d7eebbdb0f9 Mon Sep 17 00:00:00 2001
From 453ef529bccff5946ddbba0538dea18f5f2b72c0 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 c207d3a784..08aa8112b1 100644
index c26b6d607c..6c4b011b5c 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2967,6 +2967,7 @@ typedef struct AVCodecContext {
@@ -2965,6 +2965,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 Down
83 changes: 12 additions & 71 deletions tools/depends/target/ffmpeg/added_upstream_mvc_patches.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8f170986cda0695f28eb2cd4e863aaae0e14d19f Mon Sep 17 00:00:00 2001
From 9699f168d2b55d12a00d11c4d99eea9f6b39a4e3 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
Subject: [PATCH 1/3] avcodec: add h264_mvc codec id and profiles

---
libavcodec/avcodec.h | 3 +++
Expand Down Expand Up @@ -32,12 +32,12 @@ index 6c4b011b5c..8f1f5a3e53 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 478b7c0ffc..ff10f3b2bc 100644
index 6a13bbbf0e..03ae4838d2 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1700,6 +1700,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("YUY2 Lossless Codec"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
@@ -1665,6 +1665,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSLESS,
.mime_types= MT("image/png"),
},
+ {
+ .id = AV_CODEC_ID_H264_MVC,
Expand Down Expand Up @@ -78,10 +78,10 @@ index 53cbcfb543..f93f06fcfb 100644
2.14.1


From 00de72f97e8f69f5d4c614bff956ec726f97fa2e Mon Sep 17 00:00:00 2001
From 336762113945952ca59a03a0970754ec6b347580 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
Subject: [PATCH 2/3] h264_parser: add support for parsing h264 mvc NALUs

---
libavcodec/allcodecs.c | 1 +
Expand Down Expand Up @@ -116,7 +116,7 @@ index 86df5eb9b3..22c4f1d82a 100644

#endif /* AVCODEC_H264_H */
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 053325c26b..855c74896e 100644
index dd0a965af0..855c74896e 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -62,6 +62,7 @@ typedef struct H264ParseContext {
Expand All @@ -139,7 +139,7 @@ index 053325c26b..855c74896e 100644
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) {
+ nalu_type == H264_NAL_IDR_SLICE || (p->is_mvc && nalu_type == H264_NAL_SLICE_EXT)) {
state += 8;
+
Expand Down Expand Up @@ -195,10 +195,10 @@ index 053325c26b..855c74896e 100644
2.14.1


From bbf5daa149ccc2c462be1bd5f6f710eba0e82094 Mon Sep 17 00:00:00 2001
From cd8d99a650351d4dbfc2b2cfdea8c8c937833bb8 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
Subject: [PATCH 3/3] h264_parser: force grabing a new timestamp until a frame
start was found

---
Expand All @@ -222,62 +222,3 @@ index 855c74896e..90a99a19a8 100644
--
2.14.1


From 3a0ebb0f7473a9a5ab93e01f7261862a3d324e50 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 28 Nov 2017 18:32:08 +0000
Subject: [PATCH 4/4] extract_extradata_bsf: Support H264_MVC

---
libavcodec/extract_extradata_bsf.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c
index ed6509c681..188e62a42d 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -56,7 +56,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,
};

ExtractExtradataContext *s = ctx->priv_data;
@@ -88,14 +88,14 @@ 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 (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;
uint8_t *extradata, *filtered_data;

@@ -247,6 +247,7 @@ static const struct {
} extract_tab[] = {
{ 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 },
@@ -306,6 +307,7 @@ fail:
static const enum AVCodecID codec_ids[] = {
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.14.1

0 comments on commit 578ff86

Please sign in to comment.