mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
ffmpeg: update v4l2-request patch
Patch created using revisions 081225c..5d5bbd0 from branch v4l2-request-hwaccel-4.4 of https://github.com/jernejsk/FFmpeg
This commit is contained in:
parent
9ada956434
commit
4f20f408ff
@ -2440,7 +2440,7 @@ index d16e7b6aa3..8ee768d875 100644
|
||||
NULL
|
||||
},
|
||||
|
||||
From 8d663e7b4c006f9e0a775dce2a69c8b6c4f7d4fa Mon Sep 17 00:00:00 2001
|
||||
From 0952cf83284cc4c625b435104cadabbfffff30cc Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Sat, 15 Dec 2018 22:32:16 +0100
|
||||
Subject: [PATCH 08/17] Add V4L2 request API hevc hwaccel
|
||||
@ -2453,8 +2453,8 @@ Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
|
||||
libavcodec/Makefile | 1 +
|
||||
libavcodec/hevcdec.c | 10 +
|
||||
libavcodec/hwaccels.h | 1 +
|
||||
libavcodec/v4l2_request_hevc.c | 579 +++++++++++++++++++++++++++++++++
|
||||
5 files changed, 594 insertions(+)
|
||||
libavcodec/v4l2_request_hevc.c | 578 +++++++++++++++++++++++++++++++++
|
||||
5 files changed, 593 insertions(+)
|
||||
create mode 100644 libavcodec/v4l2_request_hevc.c
|
||||
|
||||
diff --git a/configure b/configure
|
||||
@ -2546,10 +2546,10 @@ index 9f8d41e367..ffb9fa5087 100644
|
||||
extern const AVHWAccel ff_hevc_videotoolbox_hwaccel;
|
||||
diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c
|
||||
new file mode 100644
|
||||
index 0000000000..6caf36f1a9
|
||||
index 0000000000..eaedde0d86
|
||||
--- /dev/null
|
||||
+++ b/libavcodec/v4l2_request_hevc.c
|
||||
@@ -0,0 +1,579 @@
|
||||
@@ -0,0 +1,578 @@
|
||||
+/*
|
||||
+ * This file is part of FFmpeg.
|
||||
+ *
|
||||
@ -2677,8 +2677,7 @@ index 0000000000..6caf36f1a9
|
||||
+ entry->flags |= V4L2_HEVC_DPB_ENTRY_LONG_TERM_REFERENCE;
|
||||
+
|
||||
+ /* TODO: Interleaved: Get the POC for each field. */
|
||||
+ entry->pic_order_cnt[0] = frame->poc;
|
||||
+ entry->pic_order_cnt[1] = frame->poc;
|
||||
+ entry->pic_order_cnt_val = frame->poc;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@ -3130,7 +3129,7 @@ index 0000000000..6caf36f1a9
|
||||
+ .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
|
||||
+};
|
||||
|
||||
From 9a3b291671c06ae4b23d890c1820b8d061aa00df Mon Sep 17 00:00:00 2001
|
||||
From c261611471077bb7a51c1267529a71267c369f99 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Brezillon <boris.brezillon@collabora.com>
|
||||
Date: Thu, 12 Dec 2019 16:13:55 +0100
|
||||
Subject: [PATCH 09/17] Add V4L2 request API VP9 hwaccel
|
||||
@ -3858,10 +3857,10 @@ index 54726df742..fee3568736 100644
|
||||
uint8_t pred_prob[3];
|
||||
struct {
|
||||
|
||||
From 96052082ce698560e5b3f85e58089d794e6f1330 Mon Sep 17 00:00:00 2001
|
||||
From 861a67f402ef4ec9e8de583a0e42b7912c848273 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Thu, 14 Feb 2019 23:20:05 +0100
|
||||
Subject: [PATCH 10/17] Add and use private linux v5.18 headers for V4L2
|
||||
Subject: [PATCH 10/17] Add and use private linux v5.19.2 headers for V4L2
|
||||
request API ctrls
|
||||
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
@ -3888,7 +3887,7 @@ index 0b238c051d..1c1929d2c2 100755
|
||||
hevc_vaapi_hwaccel_select="hevc_decoder"
|
||||
diff --git a/libavcodec/hevc-ctrls.h b/libavcodec/hevc-ctrls.h
|
||||
new file mode 100644
|
||||
index 0000000000..01ccda48d8
|
||||
index 0000000000..88e804578c
|
||||
--- /dev/null
|
||||
+++ b/libavcodec/hevc-ctrls.h
|
||||
@@ -0,0 +1,250 @@
|
||||
@ -4029,7 +4028,7 @@ index 0000000000..01ccda48d8
|
||||
+ __u64 timestamp;
|
||||
+ __u8 flags;
|
||||
+ __u8 field_pic;
|
||||
+ __u16 pic_order_cnt[2];
|
||||
+ __s32 pic_order_cnt_val;
|
||||
+ __u8 padding[2];
|
||||
+};
|
||||
+
|
||||
@ -4072,7 +4071,7 @@ index 0000000000..01ccda48d8
|
||||
+ /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
||||
+ __u8 slice_type;
|
||||
+ __u8 colour_plane_id;
|
||||
+ __u16 slice_pic_order_cnt;
|
||||
+ __s32 slice_pic_order_cnt;
|
||||
+ __u8 num_ref_idx_l0_active_minus1;
|
||||
+ __u8 num_ref_idx_l1_active_minus1;
|
||||
+ __u8 collocated_ref_idx;
|
||||
@ -4143,7 +4142,7 @@ index 0000000000..01ccda48d8
|
||||
+
|
||||
+#endif
|
||||
diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c
|
||||
index 6caf36f1a9..eee33ca8bf 100644
|
||||
index eaedde0d86..3a4b2493b2 100644
|
||||
--- a/libavcodec/v4l2_request_hevc.c
|
||||
+++ b/libavcodec/v4l2_request_hevc.c
|
||||
@@ -19,6 +19,7 @@
|
||||
@ -4155,7 +4154,7 @@ index 6caf36f1a9..eee33ca8bf 100644
|
||||
#define MAX_SLICES 16
|
||||
|
||||
|
||||
From 6cb39c865d85e66bc2d82504046a7e7829288b99 Mon Sep 17 00:00:00 2001
|
||||
From 9eb22ef69c24913344c589588c3d678c2acefeba Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 29 Apr 2019 22:08:59 +0000
|
||||
Subject: [PATCH 11/17] HACK: hwcontext_drm: do not require drm device
|
||||
@ -4182,7 +4181,7 @@ index 7a9fdbd263..6297d1f9b6 100644
|
||||
if (hwctx->fd < 0)
|
||||
return AVERROR(errno);
|
||||
|
||||
From c06fd04826b5a2bc90700896672f04efa9151ffe Mon Sep 17 00:00:00 2001
|
||||
From 1a2409ddee2a3d7ce17504740538f3e4d6252085 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Sat, 15 Dec 2018 22:32:16 +0100
|
||||
Subject: [PATCH 12/17] WIP: hevc entry point offsets
|
||||
@ -4194,7 +4193,7 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libavcodec/hevc-ctrls.h b/libavcodec/hevc-ctrls.h
|
||||
index 01ccda48d8..00bae349d3 100644
|
||||
index 88e804578c..edf3c10080 100644
|
||||
--- a/libavcodec/hevc-ctrls.h
|
||||
+++ b/libavcodec/hevc-ctrls.h
|
||||
@@ -200,7 +200,9 @@ struct v4l2_ctrl_hevc_slice_params {
|
||||
@ -4209,10 +4208,10 @@ index 01ccda48d8..00bae349d3 100644
|
||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: Weighted prediction parameter */
|
||||
struct v4l2_hevc_pred_weight_table pred_weight_table;
|
||||
diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c
|
||||
index eee33ca8bf..ac9a72b6b1 100644
|
||||
index 3a4b2493b2..59f3192c92 100644
|
||||
--- a/libavcodec/v4l2_request_hevc.c
|
||||
+++ b/libavcodec/v4l2_request_hevc.c
|
||||
@@ -231,6 +231,15 @@ static void v4l2_request_hevc_fill_slice_params(const HEVCContext *h,
|
||||
@@ -230,6 +230,15 @@ static void v4l2_request_hevc_fill_slice_params(const HEVCContext *h,
|
||||
}
|
||||
|
||||
v4l2_request_hevc_fill_pred_table(h, &slice_params->pred_weight_table);
|
||||
@ -4229,7 +4228,7 @@ index eee33ca8bf..ac9a72b6b1 100644
|
||||
|
||||
static void fill_sps(struct v4l2_ctrl_hevc_sps *ctrl, const HEVCContext *h)
|
||||
|
||||
From a65269d7347654905aa81fec87f0b7de2389d679 Mon Sep 17 00:00:00 2001
|
||||
From 1064c8cdb5e70aea052cbe0f453d15031d025437 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Fri, 15 May 2020 16:54:05 +0000
|
||||
Subject: [PATCH 13/17] WIP: add NV15 and NV20 support
|
||||
@ -4316,7 +4315,7 @@ index 5234b5049b..0b294feff2 100644
|
||||
default:
|
||||
return -1;
|
||||
|
||||
From 46639ec9e31055e49086a141f715f748605800e1 Mon Sep 17 00:00:00 2001
|
||||
From fccf8d12dba1d072e28c30e8c8a77d9beb054ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 27 Jul 2020 23:15:45 +0000
|
||||
Subject: [PATCH 14/17] HACK: define drm NV15 and NV20 format
|
||||
@ -4345,7 +4344,7 @@ index 0b294feff2..a8f0ee79ee 100644
|
||||
{
|
||||
V4L2RequestDescriptor *req = (V4L2RequestDescriptor*)frame->data[0];
|
||||
|
||||
From aaf15ef32d3adf01139c795ae8c1f253a74124a1 Mon Sep 17 00:00:00 2001
|
||||
From 3c07e6d802d0372ead81fc4088be9481d6369382 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Wed, 13 May 2020 22:51:21 +0000
|
||||
Subject: [PATCH 15/17] WIP: hevc rkvdec fields
|
||||
@ -4357,7 +4356,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
2 files changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libavcodec/hevc-ctrls.h b/libavcodec/hevc-ctrls.h
|
||||
index 00bae349d3..2ecec61866 100644
|
||||
index edf3c10080..9610266f3f 100644
|
||||
--- a/libavcodec/hevc-ctrls.h
|
||||
+++ b/libavcodec/hevc-ctrls.h
|
||||
@@ -58,6 +58,8 @@ enum v4l2_mpeg_video_hevc_start_code {
|
||||
@ -4407,10 +4406,10 @@ index 00bae349d3..2ecec61866 100644
|
||||
__u32 entry_point_offset_minus1[256];
|
||||
__u8 padding[8];
|
||||
diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c
|
||||
index ac9a72b6b1..109943d015 100644
|
||||
index 59f3192c92..bf20b9a849 100644
|
||||
--- a/libavcodec/v4l2_request_hevc.c
|
||||
+++ b/libavcodec/v4l2_request_hevc.c
|
||||
@@ -189,6 +189,9 @@ static void v4l2_request_hevc_fill_slice_params(const HEVCContext *h,
|
||||
@@ -188,6 +188,9 @@ static void v4l2_request_hevc_fill_slice_params(const HEVCContext *h,
|
||||
|
||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: Picture timing SEI message */
|
||||
.pic_struct = h->sei.picture_timing.picture_struct,
|
||||
@ -4420,7 +4419,7 @@ index ac9a72b6b1..109943d015 100644
|
||||
};
|
||||
|
||||
if (sh->slice_sample_adaptive_offset_flag[0])
|
||||
@@ -245,9 +248,12 @@ static void v4l2_request_hevc_fill_slice_params(const HEVCContext *h,
|
||||
@@ -244,9 +247,12 @@ static void v4l2_request_hevc_fill_slice_params(const HEVCContext *h,
|
||||
static void fill_sps(struct v4l2_ctrl_hevc_sps *ctrl, const HEVCContext *h)
|
||||
{
|
||||
const HEVCSPS *sps = h->ps.sps;
|
||||
@ -4433,7 +4432,7 @@ index ac9a72b6b1..109943d015 100644
|
||||
.pic_width_in_luma_samples = sps->width,
|
||||
.pic_height_in_luma_samples = sps->height,
|
||||
.bit_depth_luma_minus8 = sps->bit_depth - 8,
|
||||
@@ -311,6 +317,7 @@ static int v4l2_request_hevc_start_frame(AVCodecContext *avctx,
|
||||
@@ -310,6 +316,7 @@ static int v4l2_request_hevc_start_frame(AVCodecContext *avctx,
|
||||
&pps->scaling_list :
|
||||
sps->scaling_list_enable_flag ?
|
||||
&sps->scaling_list : NULL;
|
||||
@ -4441,7 +4440,7 @@ index ac9a72b6b1..109943d015 100644
|
||||
V4L2RequestControlsHEVC *controls = h->ref->hwaccel_picture_private;
|
||||
|
||||
fill_sps(&controls->sps, h);
|
||||
@@ -334,6 +341,9 @@ static int v4l2_request_hevc_start_frame(AVCodecContext *avctx,
|
||||
@@ -333,6 +340,9 @@ static int v4l2_request_hevc_start_frame(AVCodecContext *avctx,
|
||||
|
||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: Picture parameter set */
|
||||
controls->pps = (struct v4l2_ctrl_hevc_pps) {
|
||||
@ -4451,7 +4450,7 @@ index ac9a72b6b1..109943d015 100644
|
||||
.num_extra_slice_header_bits = pps->num_extra_slice_header_bits,
|
||||
.num_ref_idx_l0_default_active_minus1 = pps->num_ref_idx_l0_default_active - 1,
|
||||
.num_ref_idx_l1_default_active_minus1 = pps->num_ref_idx_l1_default_active - 1,
|
||||
@@ -463,6 +473,8 @@ static int v4l2_request_hevc_queue_decode(AVCodecContext *avctx, int last_slice)
|
||||
@@ -462,6 +472,8 @@ static int v4l2_request_hevc_queue_decode(AVCodecContext *avctx, int last_slice)
|
||||
if (ctx->decode_mode == V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED)
|
||||
return ff_v4l2_request_decode_slice(avctx, h->ref->frame, control, FF_ARRAY_ELEMS(control), controls->first_slice, last_slice);
|
||||
|
||||
@ -4461,7 +4460,7 @@ index ac9a72b6b1..109943d015 100644
|
||||
}
|
||||
|
||||
|
||||
From 326d9cddaef1505b6c662dcf89148e29ee0b32f1 Mon Sep 17 00:00:00 2001
|
||||
From afc228a84fef649497c25ed691e296f3a39dccb7 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sun, 19 Sep 2021 13:10:55 +0200
|
||||
Subject: [PATCH 16/17] v4l2_request: validate supported framesizes
|
||||
@ -4533,7 +4532,7 @@ index a8f0ee79ee..824dcaa8e9 100644
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "%s: set output format failed, %s (%d)\n", __func__, strerror(errno), errno);
|
||||
|
||||
From ab65af8bee5ff6cb6b886223f3e7d9a2fedfe972 Mon Sep 17 00:00:00 2001
|
||||
From 5d5bbd001ba027d0b22c51325570b28f52d8a6f5 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@gmail.com>
|
||||
Date: Sun, 27 Feb 2022 18:54:21 +0100
|
||||
Subject: [PATCH 17/17] Improve VP9 decoding
|
||||
|
Loading…
x
Reference in New Issue
Block a user