From nobody Mon Oct 6 06:43:01 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68C192ECD31; Thu, 24 Jul 2025 18:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753380636; cv=none; b=fzlrQLBFq1xeFR71bvtkVMclo4TObjwKPzTzPMXjRMHvuNi/K3bUeZiWcWyo+y6p6NMqpXkJmG3tKJEQPY6y4GRPjFKtqlqB6UUTon2A9Ez0E39guPDqq+Ih6/0BjXLNSSPZt9pqssH5LiRnByaH9Mk4AUmJNIqs5t0KaWHc300= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753380636; c=relaxed/simple; bh=d1vN5ht4k4e3/CyslVvpw51bMxCJnJytmG8PCNolL+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jti+/YF88VdL161xXmZIzlJ65dk6xy6o9+vjVvF+TkhjCJvAVM2+3TMcNtcKOJjVHdUruxEw+zlwCiN8k3pTjFPH5opTXE12Dk4ht5I800+5kDEPbnPwdW/3p7b15Mx50Hbur7r7sNqzw8Lx6zhjqJoyIU9VaIi45XBctWDH/o8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=XCGDnRV6; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="XCGDnRV6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1753380632; bh=d1vN5ht4k4e3/CyslVvpw51bMxCJnJytmG8PCNolL+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XCGDnRV6v+pmNezwl6M+jehkgbBhsuIFW96j8gLXCTe8Fm+5xnSzgWEtmdy36yuBv kDdClBgHfGe1cG0X+Qrm341kvEw2k4SJr8n21bT9cHl19n0BmuHQul+YnPsc9RJZVi F/bM5xgPzBe+4C56yhX3n4uN+e70NZ3GXLtsqsToCvFlxMEwQI9pv/wWtje8rb5Z8O u4H1zXDOQZ8cJ1eHCquv7oD3gQHmwhfnDmyIE1dJGdirAmUUx6fvyy5F034iKjIjCy +Vk7a6p1WYJ6ni08wldeHmntDANJJPMwvfjMKw3jZmX2m2bo1y+WjaWGyp3ZiGbLVR v9nqeiUIvMGHg== Received: from earth.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9CAC317E1110; Thu, 24 Jul 2025 20:10:30 +0200 (CEST) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Mauro Carvalho Chehab , Fritz Koenig , Hans Verkuil , Sebastian Fricke , Daniel Almeida , Detlev Casanova , Ricardo Ribalda , Hans de Goede , Yunke Cao , Sergey Senozhatsky , Laurent Pinchart , Sakari Ailus , James Cowgill , linux-media@vger.kernel.org, kernel@collabora.com Subject: [PATCH v2 1/2] media: uapi: HEVC: Add v4l2_ctrl_hevc_ext_sps_[ls]t_rps controls Date: Thu, 24 Jul 2025 14:10:18 -0400 Message-ID: <20250724181019.242514-2-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250724181019.242514-1-detlev.casanova@collabora.com> References: <20250724181019.242514-1-detlev.casanova@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some hardware (e.g.: Rockchip's rk3588 hevc decoder) need the long and short term reference information for HEVC decoding. Add controls to provide it as the raw data form the stream. Signed-off-by: Detlev Casanova --- .../media/v4l/ext-ctrls-codec-stateless.rst | 114 ++++++++++++++++++ .../media/v4l/vidioc-queryctrl.rst | 12 ++ 2 files changed, 126 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateles= s.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst index 0da635691fdc..bb6772cf3cee 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst @@ -2958,6 +2958,120 @@ This structure contains all loop filter related par= ameters. See sections - 0x00000004 - =20 +``V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS (struct)`` + Specifies the list of Long-Term reference sets parameters from the SPS. + These parameters are defined according to :ref:`hevc`. + They are described in section 7.4.3.2.1 "General sequence parameter set + RBSP semantics" of the specification. + This control is a dynamically sized 1-dimensional array, + V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when using it. + +.. c:type:: v4l2_ctrl_hevc_ext_sps_lt_rps + +.. cssclass:: longtable + +.. flat-table:: struct v4l2_ctrl_hevc_ext_sps_lt_rps + :header-rows: 0 + :stub-columns: 0 + :widths: 1 1 2 + + * - __u16 + - ``lt_ref_pic_poc_lsb_sps`` + - Long term reference picture order count as described in section 7.= 4.3.2.1 + "General sequence parameter set RBSP semantics" of the specificati= on. + * - __u8 + - ``flags`` + - See :ref:`Extended Long-Term RPS Flags ` + +.. _hevc_ext_sps_lt_rps_flags: + +``Extended SPS Long-Term RPS Flags`` + +.. cssclass:: longtable + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + :widths: 1 1 2 + + * - ``V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT`` + - 0x00000001 + - Specifies if the long-term reference picture is used 7.4.3.2.1 "Ge= neral sequence parameter + set RBSP semantics" of the specification. + +``V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS (struct)`` + Specifies the list of Short-Term reference sets parameters from the SP= S. + These parameters are defined according to :ref:`hevc`. + They are described in section 7.4.8 "Short-term reference picture set + semantics" of the specification. + This control is a dynamically sized 1-dimensional array, + V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when using it. + +.. c:type:: v4l2_ctrl_hevc_ext_sps_st_rps + +.. cssclass:: longtable + +.. flat-table:: struct v4l2_ctrl_hevc_ext_sps_st_rps + :header-rows: 0 + :stub-columns: 0 + :widths: 1 1 2 + + * - __u8 + - ``delta_idx_minus1`` + - Specifies the delta compare to the index. See details in section 7= .4.8 "Short-term + reference picture set semantics" of the specification. + * - __u8 + - ``delta_rps_sign`` + - Sign of the delta as specified in section 7.4.8 "Short-term refere= nce picture set + semantics" of the specification. + * - __u16 + - ``abs_delta_rps_minus1`` + - Absolute delta RPS as specified in section 7.4.8 "Short-term refer= ence picture set + semantics" of the specification. + * - __u8 + - ``num_negative_pics`` + - Number of short-term RPS entries that have picture order count val= ues less than the + picture order count value of the current picture. + * - __u8 + - ``num_positive_pics`` + - Number of short-term RPS entries that have picture order count val= ues greater than the + picture order count value of the current picture. + * - __u32 + - ``used_by_curr_pic`` + - Bit i specifies if short-term RPS i is used by the current picture. + * - __u32 + - ``use_delta_flag`` + - Bit i specifies if short-term RPS i is included in the short-term = RPS entries. + * - __u16 + - ``delta_poc_s0_minus1[16]`` + - Specifies the negative picture order count delta for the i-th entr= y in the short-term RPS. + See details in section 7.4.8 "Short-term reference picture set sem= antics" of the + specification. + * - __u16 + - ``delta_poc_s1_minus1[16]`` + - Specifies the positive picture order count delta for the i-th entr= y in the short-term RPS. + See details in section 7.4.8 "Short-term reference picture set sem= antics" of the + specification. + * - __u8 + - ``flags`` + - See :ref:`Extended Short-Term RPS Flags ` + +.. _hevc_ext_sps_st_rps_flags: + +``Extended SPS Short-Term RPS Flags`` + +.. cssclass:: longtable + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + :widths: 1 1 2 + + * - ``V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED`` + - 0x00000001 + - Specifies if the short-term RPS is predicted from another short te= rm RPS. See details in + section 7.4.8 "Short-term reference picture set semantics" of the = specification. + .. _v4l2-codec-stateless-av1: =20 ``V4L2_CID_STATELESS_AV1_SEQUENCE (struct)`` diff --git a/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst b/D= ocumentation/userspace-api/media/v4l/vidioc-queryctrl.rst index 3549417c7feb..128c044d2e3c 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst @@ -523,6 +523,18 @@ See also the examples in :ref:`control`. - n/a - A struct :c:type:`v4l2_ctrl_hevc_decode_params`, containing HEVC decoding parameters for stateless video decoders. + * - ``V4L2_CTRL_TYPE_HEVC_EXT_SPS_LT_RPS`` + - n/a + - n/a + - n/a + - A struct :c:type:`v4l2_ctrl_hevc_ext_sps_lt_rps`, containing HEVC + extended Long-Term RPS for stateless video decoders. + * - ``V4L2_CTRL_TYPE_HEVC_EXT_SPS_ST_RPS`` + - n/a + - n/a + - n/a + - A struct :c:type:`v4l2_ctrl_hevc_ext_sps_st_rps`, containing HEVC + extended Short-Term RPS for stateless video decoders. * - ``V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR`` - n/a - n/a --=20 2.50.1