Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp681022imw; Fri, 8 Jul 2022 09:46:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vcSRFQQPfBx/+SSlwPAQ7e3MDJ99que308h4Ph7T6RHH7mSpFoDs12QX5Gb/hxbhTGlV/6 X-Received: by 2002:aa7:de88:0:b0:435:9a54:168a with SMTP id j8-20020aa7de88000000b004359a54168amr5940112edv.73.1657298795335; Fri, 08 Jul 2022 09:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657298795; cv=none; d=google.com; s=arc-20160816; b=QibgNQFtHS64h0gR2QIz6z4PZJ2JdspHz3TExcBMydBF8vNmqSGyiA8GJjA57B2UaK WPHxp6RENVRzvmKjJTlLrpF2M6q3IIMI8xwUkQ9uRkgizdTceiwNJQkV8BZhgolOyYRS oSwZdcRaygtJNRYhWOCk/dYy2CduNPvx5f1etUfagv7P93M2WWYzXDQRaP0+cUfqZ6nM eTIvDJp4+UgbsG9X0lLNsR635ubKqIEgsHMxtTV1kqeMWD6Odhgq0YDCg/mPfbVfTnRW RRv8Box6InQ2Oreco97CxJAuP2WXGiXr+TXiNaX/HCeLmwtOivog9SxIgy2hELDh2Gpa beZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DcLwAOCn1AxxSVP5ZMsXke1Suj5bLxsDGfhJShbyd2I=; b=m4SrMkiFpSBy5okFXvh5bdGUBiVvXMSCVcD+FbAXpbddwBYIOS/Me2Ty0pqIppVjAy e8i+X5kc1ZeudFJX8gIbQ6YDNRDy8uVOrvgTiV3cHy/ZIM0v9pYUpFIvoyY1ARL6ieoc lEgD6KWbyUNRUEWNzEGA0TGX+MzZUAI2oQsx9vc8kk+twDgqb/pC2JNbTK5oUmmN8dw3 qQ2p0GNKhU5pwTkD9B+IR7ocS07iwRuIoxAQJIRMYwJqR3HsLVtIOqiy5Ekmu3DZ+qcb 99xdcI0PDDqbALOuahYzk/KOnz3qXgCZRcupkWyH+ThzK2TLcpnoeBTCKwBhMHRlOr3F 6aAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=EarC3gRp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb9-20020a170907160900b0072b14352ac4si6361959ejc.583.2022.07.08.09.46.04; Fri, 08 Jul 2022 09:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=EarC3gRp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239075AbiGHQWa (ORCPT + 99 others); Fri, 8 Jul 2022 12:22:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239016AbiGHQWS (ORCPT ); Fri, 8 Jul 2022 12:22:18 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE2151A056; Fri, 8 Jul 2022 09:22:16 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:3cab:61a1:2b1f:896b]) (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: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id 39B2666019F5; Fri, 8 Jul 2022 17:22:15 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657297335; bh=C5Btgw3+c5EvnhMNonf2NhctTzpNaqRXUw4T2X+a+KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EarC3gRpC9gTC8U/uU1DkXJFgSnb9V1x/cDutJpKWCSnwriUnd2zLACyTahcKEbHW WMPWqlAYMH02HLxe/qKeiFpGmE83OlkMuEpMTDXSCc8RtGtOJL21ja2Mh8ycYQZb6T hE/UATHd403ef7dDt+wnhXslTHVS8FPYjkJTaclAPm2788lw9SUX0dtjjcUgPFOucO nzWgtUEZ+mHcTk4C/fez0j5qJxqfq5VjZ7GvrfEWwhPlq2ATEyWK3FYGGyzM3QsqKt uTKS8eu4OaIlBv2uDe2x3UteBO9EZLVDmrBWPO3ZnAMX9EMO7lq9sMAsVJv8fY2YdP 3CBF4NnE36YGQ== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v13 04/17] media: uapi: HEVC: Add missing fields in HEVC controls Date: Fri, 8 Jul 2022 18:21:43 +0200 Message-Id: <20220708162156.815772-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220708162156.815772-1-benjamin.gaignard@collabora.com> References: <20220708162156.815772-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Complete the HEVC controls with missing fields from H.265 specifications. Even if these fields aren't used by the current mainlined drivers they will be required for (at least) the rkvdec driver. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Acked-by: Nicolas Dufresne Tested-by: Jernej Skrabec --- .../media/v4l/ext-ctrls-codec.rst | 32 +++++++++++++++++++ include/media/hevc-ctrls.h | 8 ++++- 2 files changed, 39 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 6183f43f4d73..cff742142a55 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2683,6 +2683,16 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - :stub-columns: 0 :widths: 1 1 2 + * - __u8 + - ``video_parameter_set_id`` + - Specifies the value of the vps_video_parameter_set_id of the active VPS + as described in section "7.4.3.2.1 General sequence parameter set RBSP semantics" + of H.265 specifications. + * - __u8 + - ``seq_parameter_set_id`` + - Provides an identifier for the SPS for reference by other syntax elements + as described in section "7.4.3.2.1 General sequence parameter set RBSP semantics" + of H.265 specifications. * - __u16 - ``pic_width_in_luma_samples`` - @@ -2822,6 +2832,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - :stub-columns: 0 :widths: 1 1 2 + * - __u8 + - ``pic_parameter_set_id`` + - Identifies the PPS for reference by other syntax elements. * - __u8 - ``num_extra_slice_header_bits`` - @@ -3048,6 +3061,15 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - * - __u8 - ``ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` - The list of L1 reference elements as indices in the DPB. + * - __u16 + - ``short_term_ref_pic_set_size`` + - Specifies the size, in bits, of the short-term reference picture set, described as st_ref_pic_set() + in the specification, included in the slice header or SPS (section 7.3.6.1). + * - __u16 + - ``long_term_ref_pic_set_size`` + - Specifies the size, in bits, of the long-term reference picture set include in the slice header + or SPS. It is the number of bits in the conditional block if(long_term_ref_pics_present_flag) + in section 7.3.6.1 of the specification. * - __u8 - ``padding`` - Applications and drivers must set this to zero. @@ -3385,6 +3407,16 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - - ``pic_order_cnt_val`` - PicOrderCntVal as described in section 8.3.1 "Decoding process for picture order count" of the specification. + * - __u16 + - ``short_term_ref_pic_set_size`` + - Specifies the size, in bits, of the short-term reference picture set, of the first slice + described as st_ref_pic_set() in the specification, included in the slice header + or SPS (section 7.3.6.1). + * - __u16 + - ``long_term_ref_pic_set_size`` + - Specifies the size, in bits, of the long-term reference picture set, of the first slice + included in the slice header or SPS. It is the number of bits in the conditional block + if(long_term_ref_pics_present_flag) in section 7.3.6.1 of the specification. * - __u8 - ``num_active_dpb_entries`` - The number of entries in ``dpb``. diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h index 01ccda48d8c5..752a8d10782c 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -58,6 +58,8 @@ 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; __u16 pic_width_in_luma_samples; __u16 pic_height_in_luma_samples; __u8 bit_depth_luma_minus8; @@ -108,6 +110,7 @@ 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; @@ -199,7 +202,8 @@ struct v4l2_ctrl_hevc_slice_params { __u32 slice_segment_addr; __u8 ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; __u8 ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; - + __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: Weighted prediction parameter */ @@ -214,6 +218,8 @@ struct v4l2_ctrl_hevc_slice_params { struct v4l2_ctrl_hevc_decode_params { __s32 pic_order_cnt_val; + __u16 short_term_ref_pic_set_size; + __u16 long_term_ref_pic_set_size; __u8 num_active_dpb_entries; struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; __u8 num_poc_st_curr_before; -- 2.32.0