Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1227249iog; Tue, 14 Jun 2022 01:43:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLOGtVz3usUVQOD4dPN+oBi/TTZekmFERVQeXYiC4OEWvMw3IBAhO06UzNa/b/MWjW5vmY X-Received: by 2002:a05:6402:5208:b0:431:3a5e:758c with SMTP id s8-20020a056402520800b004313a5e758cmr4649894edd.250.1655196184640; Tue, 14 Jun 2022 01:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655196184; cv=none; d=google.com; s=arc-20160816; b=yBF/UQsuUIE5U5lknEVMMOpbMUc0DMsGGK95lBistBXxAdtMmVlU7KM5KpbMaQqFbH x3D8T7OKx9LkjvmBmLGohUXP524cQ+GbKPFhJyu5+fnof4H2f2SFOkI+rW30+1+fAfZ0 3Hvdd4O4aSohH7XS+QF3JUjYRAJPoBQeppRqA46JiUvnNFVucmPqxGUAj15tBEeQ/fSu jO1iJ5PL4K4jArd6hO8ZN28CFVVo07awL5fkCrCVKJSCyeKUKVsziBk0aOwfacAPzTju OnBspBYihqGvrkvhXKz3x5+Fq8KM30gTZMTVlcwWJ894sr27I/NAFj4QRw/BOpmdrtpv VzeA== 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=C2Phr+1Oz9yjGbf/WYJYpat0USPSP0QcWcD9Eic93/Y=; b=V8C3VD0xf7KwYjekdnMhByqGDw1NjQAEKSbv7Y0AwOw5r/czZ7kvIKzaHLBiWqAjMm +NBdRraLZkEwd/sKDp7xqPtDXwYzfQIlZtObtOsCN83YO3R1sWq981jGvWE4N+xLca1S IiwPmn8mQ/+GFBKdrgC0d0n04DniD11hEoqkQD8tuzuOzzOJH3muSuGSnc9qiCtcZyZ+ AmQxqSZUDt5zOxPM5roBhmFy0cc+ajwa3VCSEN02tzvgJsjiNNTthBC17hMrTxhwudRa MJdQ2GOb4egDyBRSmzpAOFTUNm0vBvufxu8ByDvxR/tNcfCM3X4cYAhVWBhmps2+rogA wbBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=l1WE8PnR; 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 eo15-20020a056402530f00b0043187c8b46esi9925903edb.575.2022.06.14.01.42.37; Tue, 14 Jun 2022 01:43:04 -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=l1WE8PnR; 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 S1355142AbiFNIhH (ORCPT + 99 others); Tue, 14 Jun 2022 04:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240762AbiFNIgg (ORCPT ); Tue, 14 Jun 2022 04:36:36 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 475894162F; Tue, 14 Jun 2022 01:36:35 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:4a7b:8d3a:acaa:ec46]) (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 5C40F66016B4; Tue, 14 Jun 2022 09:36:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655195793; bh=pjNKQqJt+fujWp4j47KE/erfcCEMJ6ylcH5fLNYA0qE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1WE8PnReWEERzHE0tBzu/S6jzAEGOZ0Xqiyve4ZYkmxcpBXwrHkYRkUE98iZh/7V /5OFC1Dj9tleCbKRdqAtTS3Tw/l9B/M2tveDD5QcUZaLIlxAVh9DP0pZ/5KwTGkr6+ 4n93PaBy+0i0FqlNfaI3zTCjkZUt5YUu3wh+BlgkOPlK50TqaORwdCGMJANVoENWZD nNV/XIQY3CpjCxoQh7cwZU+osuxMjreRWWrY0g9GwXcTrBHxDGiw2bw1xxabiiWMGl heGa/vhmqsEZnjgei4JXhwbWt3aXXXay9v3yX+gnKc7sz09BTM/6IKcq7DU05/79Fm 39/t0+Il0NLww== 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 v8 04/17] media: uapi: HEVC: Add missing fields in HEVC controls Date: Tue, 14 Jun 2022 10:36:01 +0200 Message-Id: <20220614083614.240641-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220614083614.240641-1-benjamin.gaignard@collabora.com> References: <20220614083614.240641-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 --- version 6: - Add short_term_ref_pic_set_size and long_term_ref_pic_set_size in v4l2_ctrl_hevc_decode_params structure. .../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..aa7556e200c9 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 descibed 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 descibed 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