diff mbox series

media: hevc: Add sps_max_sub_layers_minus1 to v4l2_ctrl_hevc_sps

Message ID dbco8ghdj1a934s737s9auegilbvafdjpl@4ax.com (mailing list archive)
State New, archived
Headers show
Series media: hevc: Add sps_max_sub_layers_minus1 to v4l2_ctrl_hevc_sps | expand

Commit Message

John Cox April 30, 2021, 4:48 p.m. UTC
sps_max_sub_layers_minus1 is needed if the driver wishes to determine
whether or not a frame might be used for reference.

Signed-off-by: John Cox <jc@kynesim.co.uk>
---
This is useful to the Pi H265 decoder as it allows it to only create
and store MV info for frames that need to.

 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
 include/media/hevc-ctrls.h                                | 3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Hans Verkuil May 27, 2021, 7:19 a.m. UTC | #1
Hi Benjamin,

On 30/04/2021 18:48, John Cox wrote:
> sps_max_sub_layers_minus1 is needed if the driver wishes to determine
> whether or not a frame might be used for reference.

How does this patch from John relate to your "Add HANTRO G2/HEVC decoder
support for IMX8MQ" patch series?

Can I apply both this patch and your patch series? Does this patch make
sense for the HEVC stateless API?

You have been digging into HEVC, so I hope you can help out.

Regards,

	Hans

> 
> Signed-off-by: John Cox <jc@kynesim.co.uk>
> ---
> This is useful to the Pi H265 decoder as it allows it to only create
> and store MV info for frames that need to.
> 
>  Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
>  include/media/hevc-ctrls.h                                | 3 +--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> index b0de4e6e7ebd..9a891202abbf 100644
> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> @@ -2924,6 +2924,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>      * - __u8
>        - ``chroma_format_idc``
>        -
> +    * - __u8
> +      - ``sps_max_sub_layers_minus1``
> +      -
>      * - __u64
>        - ``flags``
>        - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
> diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
> index b4cb2ef02f17..b2d296b77653 100644
> --- a/include/media/hevc-ctrls.h
> +++ b/include/media/hevc-ctrls.h
> @@ -75,8 +75,7 @@ struct v4l2_ctrl_hevc_sps {
>  	__u8	num_short_term_ref_pic_sets;
>  	__u8	num_long_term_ref_pics_sps;
>  	__u8	chroma_format_idc;
> -
> -	__u8	padding;
> +	__u8	sps_max_sub_layers_minus1;
>  
>  	__u64	flags;
>  };
>
Benjamin Gaignard May 27, 2021, 8:37 a.m. UTC | #2
Le 27/05/2021 à 09:19, Hans Verkuil a écrit :
> Hi Benjamin,
>
> On 30/04/2021 18:48, John Cox wrote:
>> sps_max_sub_layers_minus1 is needed if the driver wishes to determine
>> whether or not a frame might be used for reference.
> How does this patch from John relate to your "Add HANTRO G2/HEVC decoder
> support for IMX8MQ" patch series?

Hantro hardware doesn't use this information but that could help to optimize
the number of reference frames.

>
> Can I apply both this patch and your patch series? Does this patch make
> sense for the HEVC stateless API?

Yes it part of the HEVC specification, that will help to move it out of staging.

Regards,
Benjamin

>
> You have been digging into HEVC, so I hope you can help out.
>
> Regards,
>
> 	Hans
>
>> Signed-off-by: John Cox <jc@kynesim.co.uk>

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

>> ---
>> This is useful to the Pi H265 decoder as it allows it to only create
>> and store MV info for frames that need to.
>>
>>   Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 +++
>>   include/media/hevc-ctrls.h                                | 3 +--
>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> index b0de4e6e7ebd..9a891202abbf 100644
>> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> @@ -2924,6 +2924,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>>       * - __u8
>>         - ``chroma_format_idc``
>>         -
>> +    * - __u8
>> +      - ``sps_max_sub_layers_minus1``
>> +      -
>>       * - __u64
>>         - ``flags``
>>         - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
>> diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
>> index b4cb2ef02f17..b2d296b77653 100644
>> --- a/include/media/hevc-ctrls.h
>> +++ b/include/media/hevc-ctrls.h
>> @@ -75,8 +75,7 @@ struct v4l2_ctrl_hevc_sps {
>>   	__u8	num_short_term_ref_pic_sets;
>>   	__u8	num_long_term_ref_pics_sps;
>>   	__u8	chroma_format_idc;
>> -
>> -	__u8	padding;
>> +	__u8	sps_max_sub_layers_minus1;
>>   
>>   	__u64	flags;
>>   };
>>
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 b0de4e6e7ebd..9a891202abbf 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
@@ -2924,6 +2924,9 @@  enum v4l2_mpeg_video_hevc_size_of_length_field -
     * - __u8
       - ``chroma_format_idc``
       -
+    * - __u8
+      - ``sps_max_sub_layers_minus1``
+      -
     * - __u64
       - ``flags``
       - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
index b4cb2ef02f17..b2d296b77653 100644
--- a/include/media/hevc-ctrls.h
+++ b/include/media/hevc-ctrls.h
@@ -75,8 +75,7 @@  struct v4l2_ctrl_hevc_sps {
 	__u8	num_short_term_ref_pic_sets;
 	__u8	num_long_term_ref_pics_sps;
 	__u8	chroma_format_idc;
-
-	__u8	padding;
+	__u8	sps_max_sub_layers_minus1;
 
 	__u64	flags;
 };