diff mbox series

[1/2] media: hevc: Add segment address field

Message ID 20210606082314.454193-2-jernej.skrabec@gmail.com (mailing list archive)
State New, archived
Headers show
Series media: cedrus: hevc: add support for multiple slices | expand

Commit Message

Jernej Škrabec June 6, 2021, 8:23 a.m. UTC
If HEVC frame consists of multiple slices, segment address has to be
known in order to properly decode it.

Add segment address field to slice parameters.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
 include/media/hevc-ctrls.h                                | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Benjamin Gaignard June 7, 2021, 7:43 a.m. UTC | #1
Le 06/06/2021 à 10:23, Jernej Skrabec a écrit :
> If HEVC frame consists of multiple slices, segment address has to be
> known in order to properly decode it.
>
> Add segment address field to slice parameters.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Reviewed-by Benjamin Gaignard <benjamin.gaignard@collabora.com>

> ---
>   Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
>   include/media/hevc-ctrls.h                                | 3 ++-
>   2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> index 9120c5bcaf90..fac4b477da82 100644
> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> @@ -2997,6 +2997,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>       * - __u8
>         - ``pic_struct``
>         -
> +    * - __u32
> +      - ``slice_segment_addr``
> +      -
>       * - __u8
>         - ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
>         - The list of L0 reference elements as indices in the DPB.
> diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
> index dc964ff7cd29..19f8e2ad3375 100644
> --- a/include/media/hevc-ctrls.h
> +++ b/include/media/hevc-ctrls.h
> @@ -197,10 +197,11 @@ struct v4l2_ctrl_hevc_slice_params {
>   	__u8	pic_struct;
>   
>   	/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
> +	__u32	slice_segment_addr;
>   	__u8	ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
>   	__u8	ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
>   
> -	__u8	padding[5];
> +	__u8	padding;
>   
>   	/* ISO/IEC 23008-2, ITU-T Rec. H.265: Weighted prediction parameter */
>   	struct v4l2_hevc_pred_weight_table pred_weight_table;
diff mbox series

Patch

diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
index 9120c5bcaf90..fac4b477da82 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
@@ -2997,6 +2997,9 @@  enum v4l2_mpeg_video_hevc_size_of_length_field -
     * - __u8
       - ``pic_struct``
       -
+    * - __u32
+      - ``slice_segment_addr``
+      -
     * - __u8
       - ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
       - The list of L0 reference elements as indices in the DPB.
diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
index dc964ff7cd29..19f8e2ad3375 100644
--- a/include/media/hevc-ctrls.h
+++ b/include/media/hevc-ctrls.h
@@ -197,10 +197,11 @@  struct v4l2_ctrl_hevc_slice_params {
 	__u8	pic_struct;
 
 	/* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
+	__u32	slice_segment_addr;
 	__u8	ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
 	__u8	ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
 
-	__u8	padding[5];
+	__u8	padding;
 
 	/* ISO/IEC 23008-2, ITU-T Rec. H.265: Weighted prediction parameter */
 	struct v4l2_hevc_pred_weight_table pred_weight_table;