mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
Allwinner: linux: Fix HEVC decoding
This commit is contained in:
parent
a1d19d2288
commit
e545266a4c
@ -172,24 +172,3 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void cedrus_h265_trigger(struct cedrus_ctx *ctx)
|
static void cedrus_h265_trigger(struct cedrus_ctx *ctx)
|
||||||
--- a/include/media/hevc-ctrls.h
|
|
||||||
+++ b/include/media/hevc-ctrls.h
|
|
||||||
@@ -169,6 +169,7 @@ struct v4l2_ctrl_hevc_slice_params {
|
|
||||||
|
|
||||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
|
||||||
__u32 slice_segment_addr;
|
|
||||||
+ __u32 num_entry_point_offsets;
|
|
||||||
|
|
||||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */
|
|
||||||
__u8 nal_unit_type;
|
|
||||||
@@ -203,7 +204,9 @@ struct v4l2_ctrl_hevc_slice_params {
|
|
||||||
__u8 num_rps_poc_st_curr_after;
|
|
||||||
__u8 num_rps_poc_lt_curr;
|
|
||||||
|
|
||||||
- __u8 padding[5];
|
|
||||||
+ __u8 padding;
|
|
||||||
+
|
|
||||||
+ __u32 entry_point_offset_minus1[256];
|
|
||||||
|
|
||||||
/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
|
||||||
struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
|
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||||
|
Date: Sat, 10 Apr 2021 18:55:09 +0200
|
||||||
|
Subject: [PATCH] media: cedrus: Fix HEVC status macros
|
||||||
|
|
||||||
|
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||||
|
---
|
||||||
|
.../staging/media/sunxi/cedrus/cedrus_regs.h | 17 +++++++++--------
|
||||||
|
1 file changed, 9 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h
|
||||||
|
index 6cb1c279790f..7ab3a2b0aa10 100644
|
||||||
|
--- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h
|
||||||
|
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h
|
||||||
|
@@ -443,16 +443,17 @@
|
||||||
|
#define VE_DEC_H265_STATUS_STCD_BUSY BIT(21)
|
||||||
|
#define VE_DEC_H265_STATUS_WB_BUSY BIT(20)
|
||||||
|
#define VE_DEC_H265_STATUS_BS_DMA_BUSY BIT(19)
|
||||||
|
-#define VE_DEC_H265_STATUS_IQIT_BUSY BIT(18)
|
||||||
|
+#define VE_DEC_H265_STATUS_IT_BUSY BIT(18)
|
||||||
|
#define VE_DEC_H265_STATUS_INTER_BUSY BIT(17)
|
||||||
|
#define VE_DEC_H265_STATUS_MORE_DATA BIT(16)
|
||||||
|
-#define VE_DEC_H265_STATUS_VLD_BUSY BIT(14)
|
||||||
|
-#define VE_DEC_H265_STATUS_DEBLOCKING_BUSY BIT(13)
|
||||||
|
-#define VE_DEC_H265_STATUS_DEBLOCKING_DRAM_BUSY BIT(12)
|
||||||
|
-#define VE_DEC_H265_STATUS_INTRA_BUSY BIT(11)
|
||||||
|
-#define VE_DEC_H265_STATUS_SAO_BUSY BIT(10)
|
||||||
|
-#define VE_DEC_H265_STATUS_MVP_BUSY BIT(9)
|
||||||
|
-#define VE_DEC_H265_STATUS_SWDEC_BUSY BIT(8)
|
||||||
|
+#define VE_DEC_H265_STATUS_DBLK_BUSY BIT(15)
|
||||||
|
+#define VE_DEC_H265_STATUS_IREC_BUSY BIT(14)
|
||||||
|
+#define VE_DEC_H265_STATUS_INTRA_BUSY BIT(13)
|
||||||
|
+#define VE_DEC_H265_STATUS_MCRI_BUSY BIT(12)
|
||||||
|
+#define VE_DEC_H265_STATUS_IQIT_BUSY BIT(11)
|
||||||
|
+#define VE_DEC_H265_STATUS_MVP_BUSY BIT(10)
|
||||||
|
+#define VE_DEC_H265_STATUS_IS_BUSY BIT(9)
|
||||||
|
+#define VE_DEC_H265_STATUS_VLD_BUSY BIT(8)
|
||||||
|
#define VE_DEC_H265_STATUS_OVER_TIME BIT(3)
|
||||||
|
#define VE_DEC_H265_STATUS_VLD_DATA_REQ BIT(2)
|
||||||
|
#define VE_DEC_H265_STATUS_ERROR BIT(1)
|
@ -0,0 +1,37 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||||
|
Date: Sun, 11 Apr 2021 10:45:50 +0200
|
||||||
|
Subject: [PATCH] media: cedrus: wip: hevc: dependent flag
|
||||||
|
|
||||||
|
---
|
||||||
|
drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 4 ++--
|
||||||
|
include/media/hevc-ctrls.h | 1 +
|
||||||
|
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
|
||||||
|
index 8861e1535886..ab6fc857a477 100644
|
||||||
|
--- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
|
||||||
|
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
|
||||||
|
@@ -634,8 +634,8 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx,
|
||||||
|
slice_params->flags);
|
||||||
|
|
||||||
|
reg |= VE_DEC_H265_FLAG(VE_DEC_H265_DEC_SLICE_HDR_INFO0_FLAG_DEPENDENT_SLICE_SEGMENT,
|
||||||
|
- V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT,
|
||||||
|
- pps->flags);
|
||||||
|
+ V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT,
|
||||||
|
+ slice_params->flags);
|
||||||
|
|
||||||
|
if (ctx->fh.m2m_ctx->new_frame)
|
||||||
|
reg |= VE_DEC_H265_DEC_SLICE_HDR_INFO0_FLAG_FIRST_SLICE_SEGMENT_IN_PIC;
|
||||||
|
diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
|
||||||
|
index eb83c1d61b8d..cd51fb6df1f0 100644
|
||||||
|
--- a/include/media/hevc-ctrls.h
|
||||||
|
+++ b/include/media/hevc-ctrls.h
|
||||||
|
@@ -162,6 +162,7 @@ struct v4l2_hevc_pred_weight_table {
|
||||||
|
#define V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV (1ULL << 6)
|
||||||
|
#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED (1ULL << 7)
|
||||||
|
#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED (1ULL << 8)
|
||||||
|
+#define V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT (1ULL << 9)
|
||||||
|
|
||||||
|
struct v4l2_ctrl_hevc_slice_params {
|
||||||
|
__u32 bit_size;
|
@ -0,0 +1,69 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonas Karlman <jonas@kwiboo.se>
|
||||||
|
Date: Sat, 23 May 2020 15:03:46 +0000
|
||||||
|
Subject: [PATCH] WIP: media: uapi: hevc: add fields needed for rkvdec
|
||||||
|
|
||||||
|
NOTE: these fields are used by rkvdec hevc backend
|
||||||
|
|
||||||
|
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||||
|
---
|
||||||
|
include/media/hevc-ctrls.h | 16 ++++++++++++----
|
||||||
|
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
|
||||||
|
index 6e881b7896bc..46936bae7c30 100644
|
||||||
|
--- a/include/media/hevc-ctrls.h
|
||||||
|
+++ b/include/media/hevc-ctrls.h
|
||||||
|
@@ -56,6 +56,9 @@ enum v4l2_mpeg_video_hevc_start_code {
|
||||||
|
/* The controls are not stable at the moment and will likely be reworked. */
|
||||||
|
struct v4l2_ctrl_hevc_sps {
|
||||||
|
/* ISO/IEC 23008-2, ITU-T Rec. H.265: Sequence parameter set */
|
||||||
|
+ __u8 video_parameter_set_id;
|
||||||
|
+ __u8 seq_parameter_set_id;
|
||||||
|
+ __u8 chroma_format_idc;
|
||||||
|
__u16 pic_width_in_luma_samples;
|
||||||
|
__u16 pic_height_in_luma_samples;
|
||||||
|
__u8 bit_depth_luma_minus8;
|
||||||
|
@@ -76,9 +79,8 @@ struct v4l2_ctrl_hevc_sps {
|
||||||
|
__u8 log2_diff_max_min_pcm_luma_coding_block_size;
|
||||||
|
__u8 num_short_term_ref_pic_sets;
|
||||||
|
__u8 num_long_term_ref_pics_sps;
|
||||||
|
- __u8 chroma_format_idc;
|
||||||
|
|
||||||
|
- __u8 padding;
|
||||||
|
+ __u8 padding[7];
|
||||||
|
|
||||||
|
__u64 flags;
|
||||||
|
};
|
||||||
|
@@ -105,7 +107,10 @@ struct v4l2_ctrl_hevc_sps {
|
||||||
|
|
||||||
|
struct v4l2_ctrl_hevc_pps {
|
||||||
|
/* ISO/IEC 23008-2, ITU-T Rec. H.265: Picture parameter set */
|
||||||
|
+ __u8 pic_parameter_set_id;
|
||||||
|
__u8 num_extra_slice_header_bits;
|
||||||
|
+ __u8 num_ref_idx_l0_default_active_minus1;
|
||||||
|
+ __u8 num_ref_idx_l1_default_active_minus1;
|
||||||
|
__s8 init_qp_minus26;
|
||||||
|
__u8 diff_cu_qp_delta_depth;
|
||||||
|
__s8 pps_cb_qp_offset;
|
||||||
|
@@ -118,7 +123,7 @@ struct v4l2_ctrl_hevc_pps {
|
||||||
|
__s8 pps_tc_offset_div2;
|
||||||
|
__u8 log2_parallel_merge_level_minus2;
|
||||||
|
|
||||||
|
- __u8 padding[4];
|
||||||
|
+ __u8 padding;
|
||||||
|
__u64 flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -204,7 +209,10 @@ struct v4l2_ctrl_hevc_slice_params {
|
||||||
|
__u8 num_rps_poc_st_curr_after;
|
||||||
|
__u8 num_rps_poc_lt_curr;
|
||||||
|
|
||||||
|
- __u8 padding[5];
|
||||||
|
+ __u16 short_term_ref_pic_set_size;
|
||||||
|
+ __u16 long_term_ref_pic_set_size;
|
||||||
|
+
|
||||||
|
+ __u8 padding;
|
||||||
|
|
||||||
|
/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
||||||
|
struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
|
@ -0,0 +1,42 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonas Karlman <jonas@kwiboo.se>
|
||||||
|
Date: Sat, 23 May 2020 15:07:15 +0000
|
||||||
|
Subject: [PATCH] HACK: media: uapi: hevc: tiles and num_slices
|
||||||
|
|
||||||
|
---
|
||||||
|
include/media/hevc-ctrls.h | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
|
||||||
|
index 46936bae7c30..4d51c148d0ba 100644
|
||||||
|
--- a/include/media/hevc-ctrls.h
|
||||||
|
+++ b/include/media/hevc-ctrls.h
|
||||||
|
@@ -80,7 +80,8 @@ struct v4l2_ctrl_hevc_sps {
|
||||||
|
__u8 num_short_term_ref_pic_sets;
|
||||||
|
__u8 num_long_term_ref_pics_sps;
|
||||||
|
|
||||||
|
- __u8 padding[7];
|
||||||
|
+ __u8 num_slices;
|
||||||
|
+ __u8 padding[6];
|
||||||
|
|
||||||
|
__u64 flags;
|
||||||
|
};
|
||||||
|
@@ -175,6 +176,7 @@ struct v4l2_ctrl_hevc_slice_params {
|
||||||
|
|
||||||
|
/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
||||||
|
__u32 slice_segment_addr;
|
||||||
|
+ __u32 num_entry_point_offsets;
|
||||||
|
|
||||||
|
/* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */
|
||||||
|
__u8 nal_unit_type;
|
||||||
|
@@ -212,7 +214,9 @@ struct v4l2_ctrl_hevc_slice_params {
|
||||||
|
__u16 short_term_ref_pic_set_size;
|
||||||
|
__u16 long_term_ref_pic_set_size;
|
||||||
|
|
||||||
|
- __u8 padding;
|
||||||
|
+ __u8 padding[5];
|
||||||
|
+
|
||||||
|
+ __u32 entry_point_offset_minus1[256];
|
||||||
|
|
||||||
|
/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
|
||||||
|
struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
|
Loading…
x
Reference in New Issue
Block a user