Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: uapi: HEVC: Add v4l2_ctrl_hevc_ext_sps_[ls]t_rps controls

Some hardware (e.g.: Rockchip's rk3588 hevc decoder) need to fully parse
the slice header, which cannot be passed with the current controls.
There is also no skip method similar as to what can be found in
verisilicon HW.

The SPS is therefore extended through these 2 new controls, providing the
long and short term reference information from the slice header for HEVC
decoding.

These now controls are similar as what is passed in the Vulkan Video API
with the StdVideoH265ShortTermRefPicSet and StdVideoH265LongTermRefPicsSps
structures embedded in the SPS struct.

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Detlev Casanova and committed by
Hans Verkuil
8a5586d4 a505ca2d

+134
+120
Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
··· 2959 2959 - 0x00000004 2960 2960 - 2961 2961 2962 + ``V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS (struct)`` 2963 + Subset of the :c:type:`v4l2_ctrl_hevc_sps` control. 2964 + It extends it with the list of Long-term reference sets parameters. 2965 + These parameters are defined according to :ref:`hevc`. 2966 + They are described in section 7.4.3.2.1 "General sequence parameter set 2967 + RBSP semantics" of the specification. 2968 + This control is a dynamically sized 1-dimensional array. 2969 + The values in the array should be ignored when either 2970 + num_long_term_ref_pics_sps is 0 or the 2971 + V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT flag is not set in 2972 + :c:type:`v4l2_ctrl_hevc_sps`. 2973 + 2974 + .. c:type:: v4l2_ctrl_hevc_ext_sps_lt_rps 2975 + 2976 + .. cssclass:: longtable 2977 + 2978 + .. flat-table:: struct v4l2_ctrl_hevc_ext_sps_lt_rps 2979 + :header-rows: 0 2980 + :stub-columns: 0 2981 + :widths: 1 1 2 2982 + 2983 + * - __u16 2984 + - ``lt_ref_pic_poc_lsb_sps`` 2985 + - Long term reference picture order count as described in section 7.4.3.2.1 2986 + "General sequence parameter set RBSP semantics" of the specification. 2987 + * - __u16 2988 + - ``flags`` 2989 + - See :ref:`Extended Long-Term RPS Flags <hevc_ext_sps_lt_rps_flags>` 2990 + 2991 + .. _hevc_ext_sps_lt_rps_flags: 2992 + 2993 + ``Extended SPS Long-Term RPS Flags`` 2994 + 2995 + .. cssclass:: longtable 2996 + 2997 + .. flat-table:: 2998 + :header-rows: 0 2999 + :stub-columns: 0 3000 + :widths: 1 1 2 3001 + 3002 + * - ``V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT`` 3003 + - 0x00000001 3004 + - Specifies if the long-term reference picture is used 7.4.3.2.1 "General sequence parameter 3005 + set RBSP semantics" of the specification. 3006 + 3007 + ``V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS (struct)`` 3008 + Subset of the :c:type:`v4l2_ctrl_hevc_sps` control. 3009 + It extends it with the list of Short-term reference sets parameters. 3010 + These parameters are defined according to :ref:`hevc`. 3011 + They are described in section 7.4.8 "Short-term reference picture set 3012 + semantics" of the specification. 3013 + This control is a dynamically sized 1-dimensional array. 3014 + The values in the array should be ignored when 3015 + num_short_term_ref_pic_sets is 0. 3016 + 3017 + .. c:type:: v4l2_ctrl_hevc_ext_sps_st_rps 3018 + 3019 + .. cssclass:: longtable 3020 + 3021 + .. flat-table:: struct v4l2_ctrl_hevc_ext_sps_st_rps 3022 + :header-rows: 0 3023 + :stub-columns: 0 3024 + :widths: 1 1 2 3025 + 3026 + * - __u8 3027 + - ``delta_idx_minus1`` 3028 + - Specifies the delta compare to the index. See details in section 7.4.8 "Short-term 3029 + reference picture set semantics" of the specification. 3030 + * - __u8 3031 + - ``delta_rps_sign`` 3032 + - Sign of the delta as specified in section 7.4.8 "Short-term reference picture set 3033 + semantics" of the specification. 3034 + * - __u8 3035 + - ``num_negative_pics`` 3036 + - Number of short-term RPS entries that have picture order count values less than the 3037 + picture order count value of the current picture. 3038 + * - __u8 3039 + - ``num_positive_pics`` 3040 + - Number of short-term RPS entries that have picture order count values greater than the 3041 + picture order count value of the current picture. 3042 + * - __u32 3043 + - ``used_by_curr_pic`` 3044 + - Bit i specifies if short-term RPS i is used by the current picture. 3045 + * - __u32 3046 + - ``use_delta_flag`` 3047 + - Bit i specifies if short-term RPS i is included in the short-term RPS entries. 3048 + * - __u16 3049 + - ``abs_delta_rps_minus1`` 3050 + - Absolute delta RPS as specified in section 7.4.8 "Short-term reference picture set 3051 + semantics" of the specification. 3052 + * - __u16 3053 + - ``delta_poc_s0_minus1[16]`` 3054 + - Specifies the negative picture order count delta for the i-th entry in the short-term RPS. 3055 + See details in section 7.4.8 "Short-term reference picture set semantics" of the 3056 + specification. 3057 + * - __u16 3058 + - ``delta_poc_s1_minus1[16]`` 3059 + - Specifies the positive picture order count delta for the i-th entry in the short-term RPS. 3060 + See details in section 7.4.8 "Short-term reference picture set semantics" of the 3061 + specification. 3062 + * - __u16 3063 + - ``flags`` 3064 + - See :ref:`Extended Short-Term RPS Flags <hevc_ext_sps_st_rps_flags>` 3065 + 3066 + .. _hevc_ext_sps_st_rps_flags: 3067 + 3068 + ``Extended SPS Short-Term RPS Flags`` 3069 + 3070 + .. cssclass:: longtable 3071 + 3072 + .. flat-table:: 3073 + :header-rows: 0 3074 + :stub-columns: 0 3075 + :widths: 1 1 2 3076 + 3077 + * - ``V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED`` 3078 + - 0x00000001 3079 + - Specifies if the short-term RPS is predicted from another short term RPS. See details in 3080 + section 7.4.8 "Short-term reference picture set semantics" of the specification. 3081 + 2962 3082 .. _v4l2-codec-stateless-av1: 2963 3083 2964 3084 ``V4L2_CID_STATELESS_AV1_SEQUENCE (struct)``
+2
Documentation/userspace-api/media/v4l/videodev2.h.rst.exceptions
··· 150 150 replace symbol V4L2_CTRL_TYPE_H264_PRED_WEIGHTS :c:type:`V4L.v4l2_ctrl_type` 151 151 replace symbol V4L2_CTRL_TYPE_H264_SLICE_PARAMS :c:type:`V4L.v4l2_ctrl_type` 152 152 replace symbol V4L2_CTRL_TYPE_H264_DECODE_PARAMS :c:type:`V4L.v4l2_ctrl_type` 153 + replace symbol V4L2_CTRL_TYPE_HEVC_EXT_SPS_ST_RPS :c:type:`V4L.v4l2_ctrl_type` 154 + replace symbol V4L2_CTRL_TYPE_HEVC_EXT_SPS_LT_RPS :c:type:`V4L.v4l2_ctrl_type` 153 155 replace symbol V4L2_CTRL_TYPE_HEVC_SPS :c:type:`V4L.v4l2_ctrl_type` 154 156 replace symbol V4L2_CTRL_TYPE_HEVC_PPS :c:type:`V4L.v4l2_ctrl_type` 155 157 replace symbol V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS :c:type:`V4L.v4l2_ctrl_type`
+12
Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst
··· 531 531 - n/a 532 532 - A struct :c:type:`v4l2_ctrl_hevc_decode_params`, containing HEVC 533 533 decoding parameters for stateless video decoders. 534 + * - ``V4L2_CTRL_TYPE_HEVC_EXT_SPS_LT_RPS`` 535 + - n/a 536 + - n/a 537 + - n/a 538 + - A struct :c:type:`v4l2_ctrl_hevc_ext_sps_lt_rps`, containing HEVC 539 + extended Long-Term RPS for stateless video decoders. 540 + * - ``V4L2_CTRL_TYPE_HEVC_EXT_SPS_ST_RPS`` 541 + - n/a 542 + - n/a 543 + - n/a 544 + - A struct :c:type:`v4l2_ctrl_hevc_ext_sps_st_rps`, containing HEVC 545 + extended Short-Term RPS for stateless video decoders. 534 546 * - ``V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR`` 535 547 - n/a 536 548 - n/a