Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1021992imw; Tue, 5 Jul 2022 02:20:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t9zYxJo+rxSfQ5pM3obgEowG/6M8lMqQs34jpU8GNYjR5hrK+Ix6q0mlWDDxt3+7gVJACa X-Received: by 2002:a65:6054:0:b0:411:5e12:21b2 with SMTP id a20-20020a656054000000b004115e1221b2mr28333050pgp.222.1657012853566; Tue, 05 Jul 2022 02:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657012853; cv=none; d=google.com; s=arc-20160816; b=Dot2uZ3f0GCrlO8Buwvg02sXzk1XEovKPp6GZMpxK28b8p0jYkaWMVPHCcCSyxG/D5 UOIaP+/D7mzIlm6+Y6gz2H6bkP3Aby2t8GC6UOJzZgP5D0tEbrY3xINHejyt4aZ2UbQ2 EzCbRf2aPdc6MvqWs88/y7phWsYuxB5px07QFSSBucv521rMx6tEuClhKIVHdeAvtzD/ Qrg0pO2rFpPDH3IB7+PSzntJFMBSJlbGDVOxIm9mgiuaaN/cSMWhC+5tTuYa+IEzZjxd 9QCa3QOUAHn3mEEbkcYr/OXObwvyvSjUVPmS/bf/aSgzqL8CCvKD9Gh9zt2N7Cxotj5Y kpDw== 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=i2IsRp4JZjrl5rDoje0cgpo3CxfNC9TQk98IY1mTtKs=; b=A6ou5BwzdI3367E/ntqlI8RwsI3OPeh4bJqMD2bQfF/DV0bNSJXRtYG7VN/lf6tRBZ Ms4/Gae/wxme9W7F8LrontwbS91Isy3owsA7S81nPK87Kzqg4c9Q3V5pIXv0JIQEuNIP ldeWWnHrym0sxt/hA3Cioi3Q2PI3zEl8qieJaBZYDWu1AqeOr6NHaAa0akwFTwQGY5kQ +pQ5p7Wksh+SYBYzRTfn3cvkXiiTPapl0bGav2Dmwxt3sl0/LL/tzrolwX8lG1b2Bt+v DcJBjK9X78sCCMsv5K5ImqhI6JTejUUt8gxIms0ZT2H4WMJnpMCVZkdVj1bUbJgDR/Iz kLPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LMyNVaWJ; 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 s6-20020a17090a440600b001ef74314f73si11869147pjg.125.2022.07.05.02.20.42; Tue, 05 Jul 2022 02:20: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=LMyNVaWJ; 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 S230450AbiGEIyp (ORCPT + 99 others); Tue, 5 Jul 2022 04:54:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbiGEIyd (ORCPT ); Tue, 5 Jul 2022 04:54:33 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 483C8EE12; Tue, 5 Jul 2022 01:54:32 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:6610:ee84:2ba:7917]) (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 8289A66019A9; Tue, 5 Jul 2022 09:54:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657011271; bh=74m1fNyKKTWNkvvgOeIYSIUU2D5I7i5Y9LQkpaIM6SY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LMyNVaWJ+9x+1beTSaA1VQ6u6UF/WW9gp7fms57pDRz278Gsb88c+rF6M9884Z42U RydbPZZyOyHia3WJzLfdt0EfOnuwmlultsZ3Y5/cYPT6IpzND3/pjitNuXZYXLBPL0 ZLQ3KJWoouCXDpp6qlsnW7A4un9Ns24W+19W9QmEVZEB/Bw32TiwKMUGsFRP3mG3YI F4TiemRY+rCqeVpg8z1TT9DLNdfgeEFXFEb6VOU8PvwF4Xfr8YGK9Bvbb//1Jv3By+ jdQtGqkzbCCmrkykgQSUui6k/bMk+4BKyYHc5G0fU+k5RTotQOklEwTDv5XpGfQNBC elp1FOdmBHwCQ== 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 v10 04/17] media: uapi: HEVC: Add missing fields in HEVC controls Date: Tue, 5 Jul 2022 10:54:07 +0200 Message-Id: <20220705085420.272912-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220705085420.272912-1-benjamin.gaignard@collabora.com> References: <20220705085420.272912-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 Acked-by: Nicolas Dufresne Tested-by: Jernej Skrabec --- version 9: - fix typo .../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