Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2251436imw; Wed, 6 Jul 2022 02:43:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1um8dNOGqvVWYzNLAdbT2N+Us2tuuGHH3h99KYRM+2n/oEYqFUpU7cwmZCUe63NIhxcajpd X-Received: by 2002:a17:907:7612:b0:72a:fb4b:5cf9 with SMTP id jx18-20020a170907761200b0072afb4b5cf9mr1594999ejc.463.1657100633596; Wed, 06 Jul 2022 02:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657100633; cv=none; d=google.com; s=arc-20160816; b=Q+YdJJZAWebHtz73yHrGwFzXk0JNOML0vdetwjchLR4hSsHnqXxi5v7mu2E6HNoGrH jXQ8rp83r05OrVEJObneY+gNxJbNQyXfl69SybGt0CbkKEeIujOT6dyPerW4N2rfZviO RGxEBNpEFbEu5j3KREQl8Gz1bP9cBnu+3vYikL82d/+6Ftts1Wk7MZVZgbKhM02Y4Ss2 md1VPsJ7crjvmkjreXPTA+xz6xFfeMpF4DdQgxWVwcIl1sqFRWh0zw3hS+NxOQaPykki FTPx7DtfjbJucrXrIPNlRPLv8X2fb6QMC50ft38HvM9XHFcAvEMLGf9G3D+/snweighl hCZw== 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=vdXh2miq+2oa1Q7owl13Z+8QLdRrzWRC/HfPjgMeDJcpUtfnPcwcJ78Zt65xb3ECiU iJmzpZuDiKVbSSCHeDzeMiVNKcZCNMfGihYJeHxgcl8q6hnGbXhIjrJmOtV7bCIacDuS Nj8HNbYBZnwbTpBOlQ7z8zD9Cca9+h7EyVbh9lkencKAcRYiDkKePeZ6/JwjgwJv6xSL cn6+ponQrQQwEQYdiDhLZlWev+nJD7TL4tu4djD5cYVrjf4cksJg+naonmYec2UVKyGv ubu7Z5N0mnCbJJhwTbWYzDOq+spQGNSmimnd9Ya68SrXHVj7w2iF2YXIeke01nTIeQYw ViGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RH4CvE1c; 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 gt15-20020a1709072d8f00b0072af4acdd6esi2479693ejc.841.2022.07.06.02.43.28; Wed, 06 Jul 2022 02:43:53 -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=RH4CvE1c; 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 S232815AbiGFJi2 (ORCPT + 99 others); Wed, 6 Jul 2022 05:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbiGFJiQ (ORCPT ); Wed, 6 Jul 2022 05:38:16 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 164F0237CB; Wed, 6 Jul 2022 02:38:15 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:3a70:988d:42ce:f5cc]) (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 560C766019A6; Wed, 6 Jul 2022 10:38:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657100293; bh=C5Btgw3+c5EvnhMNonf2NhctTzpNaqRXUw4T2X+a+KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RH4CvE1cJmsOBw9GgufSCDBjAeuHLvdIcJ/ks4+ZVtafYjuFlmsCRGYfGnJ0vVCUa ex4PQvicnEIV84609JgvjCSoAOda3Mtjy76fSZhDXyQLPvn4FQxeCdIo2oRyGmLECl NVfyUJGCh2GGnn8d38hvgr5wQqXJEuh7adqFhvzVXyQ8BL0Ln4pmUAhlekTp0gbfnU 69DO1mPqJI7AEOuM7xCyn/LDnuqqomb/GRzLnwjnL3mK9OWvbENh1yN2hYppLqgau9 eB2e1LFQtoV6xYFDeij3d0DW7l8MsWpYGSeKWZ852ylZD8mDSVt99ZdllWbsa0JZJu rOhvsHa0jo8ZQ== 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 v11 04/17] media: uapi: HEVC: Add missing fields in HEVC controls Date: Wed, 6 Jul 2022 11:37:50 +0200 Message-Id: <20220706093803.158810-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220706093803.158810-1-benjamin.gaignard@collabora.com> References: <20220706093803.158810-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