Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5428200rwd; Wed, 24 May 2023 01:22:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NklS2wGT0poX6h2fceaqdkHQTZuMedkiKsT9v8uvkdxnxYG17j8yc5DVIkzJdBNKMEOQz X-Received: by 2002:a05:6a20:3c87:b0:10c:7c72:bdf9 with SMTP id b7-20020a056a203c8700b0010c7c72bdf9mr6013223pzj.29.1684916552002; Wed, 24 May 2023 01:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684916551; cv=none; d=google.com; s=arc-20160816; b=y64yW+NzNR6qmWl/Nj8jt+yoHXwz6BNwlveNbQtxxLb3hWgO95u8mgE1ZaXcfgwF4x 86xm6QZd9hepxNO96+MXa7vtaf/P8wkt/NuUThdem6JUpKrUN8wA+XbVqCBRcnCG2SQc AgBKzEhkc7ZX9TV9klV03D+CtFdKUGaFaHUsWimFgl6KhSl7VM27VCMflKi103Fe6lqr oVXcH8e9fn10lP+8hd+n5CzkR/ICoQqLGwwkaeHDqR3Jpi9NyL9l3M6VMlKebT7msc3C s1+i87Nu5Ogvxy9ym/8Z44l68PvM/DidRqZ/wISpK9DI1VYLNGa1N/6M171+sL/XpayL kmcQ== 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=Bv6nOcmtrOP3vAtD6WhjV7wPXUYmC++OmTTD669OyTs=; b=ieoSFKZIYJQCetgVGJrfN//RFShK7EbxdWpl22Oh0DG6CeqV0C1IvSGk9scm6ndB8P q8mEDhmiYI2HeyU0UKPiGW9A/MFvFisUqeASTrXV+F1QsFTqjvhbmVJ6XyCWbaCLZ8u4 RVLMiNFr83yM1x+1BEY8GU3oW/set/rJ1Xe7zi6DIv4F3M//G2GIs8x3AQGynG9ElujU 7ZUY8EGB7aoUO1l75+W42AEi2i3AvSoNl+43NwVqIsbN5Mhfvbt9oAPozDjsbGI3OMNL wjsAdgHAoewsIudgdY0DZOhQV5jGohLZiwEcG0xav5dlnToh201CVj0Fc5b3iBZg+5m4 5WYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XzYGzLeu; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b00528617ab3ddsi7975194pge.133.2023.05.24.01.22.17; Wed, 24 May 2023 01:22:31 -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=@mediatek.com header.s=dk header.b=XzYGzLeu; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239992AbjEXIIC (ORCPT + 99 others); Wed, 24 May 2023 04:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239229AbjEXIIA (ORCPT ); Wed, 24 May 2023 04:08:00 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAF7BE6; Wed, 24 May 2023 01:07:51 -0700 (PDT) X-UUID: 0ef21a46fa0a11edb20a276fd37b9834-20230524 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Bv6nOcmtrOP3vAtD6WhjV7wPXUYmC++OmTTD669OyTs=; b=XzYGzLeusU9Vzxa6vXCVKCOjKV6pSRMwhwhJd7rS+qrkletOv3kPJUURgC/qUBX4jlPUFACNRXis/wtbaRbTiwM0QWjsmt5Q3R0YSqcVV59N9ypM173cbTIOywTNNsPsQUbX+PGmR2nBUQI3AVLNEabjvm/uHxl2AMywaorYcL4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:29023c4f-3360-4b70-9552-641f9435445c,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.25,REQID:29023c4f-3360-4b70-9552-641f9435445c,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:d5b0ae3,CLOUDID:c4a8323c-de1e-4348-bc35-c96f92f1dcbb,B ulkID:230524160743OV04UARX,BulkQuantity:0,Recheck:0,SF:48|38|29|28|17|19,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 0ef21a46fa0a11edb20a276fd37b9834-20230524 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2048319583; Wed, 24 May 2023 16:07:42 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 24 May 2023 16:07:42 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 24 May 2023 16:07:41 +0800 From: Yunfei Dong To: Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nathan Hebert CC: Yunfei Dong , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v7,1/2] media: uapi: HEVC: Add num_delta_pocs_of_ref_rps_idx field Date: Wed, 24 May 2023 16:07:38 +0800 Message-ID: <20230524080739.17264-2-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230524080739.17264-1-yunfei.dong@mediatek.com> References: <20230524080739.17264-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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 From: Benjamin Gaignard Some drivers firmwares parse by themselves slice header and need num_delta_pocs_of_ref_rps_idx value to parse slice header short_term_ref_pic_set(). Use one of the 4 reserved bytes to store this value without changing the v4l2_ctrl_hevc_decode_params structure size and padding. This value also exist in DXVA API. Signed-off-by: Benjamin Gaignard Signed-off-by: Yunfei Dong Reviewed-by: Nicolas Dufresne --- .../userspace-api/media/v4l/ext-ctrls-codec-stateless.rst | 7 +++++++ include/uapi/linux/v4l2-controls.h | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst index 3d8411acd5b8..92ce3e126929 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst @@ -2923,6 +2923,13 @@ This structure contains all loop filter related parameters. See sections - ``poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` - PocLtCurr as described in section 8.3.2 "Decoding process for reference picture set": provides the index of the long term references in DPB array. + * - __u8 + - ``num_delta_pocs_of_ref_rps_idx`` + - When the short_term_ref_pic_set_sps_flag in the slice header is equal to 0, + it is the same than derived value NumDeltaPocs[RefRpsIdx]. It can be used to parse + the RPS data in slice headers instead of skipping it with @short_term_ref_pic_set_size. + When the value of short_term_ref_pic_set_sps_flag in the slice header is + equal to 1, num_delta_pocs_of_ref_rps_idx shall be set to 0. * - struct :c:type:`v4l2_hevc_dpb_entry` - ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` - The decoded picture buffer, for meta-data about reference frames. diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 5e80daa4ffe0..7bf59a87a1bf 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -2385,6 +2385,9 @@ struct v4l2_ctrl_hevc_slice_params { * @poc_st_curr_after: provides the index of the short term after references * in DPB array * @poc_lt_curr: provides the index of the long term references in DPB array + * @num_delta_pocs_of_ref_rps_idx: same as the derived value NumDeltaPocs[RefRpsIdx], + * can be used to parse the RPS data in slice headers + * instead of skipping it with @short_term_ref_pic_set_size. * @reserved: padding field. Should be zeroed by applications. * @dpb: the decoded picture buffer, for meta-data about reference frames * @flags: see V4L2_HEVC_DECODE_PARAM_FLAG_{} @@ -2400,7 +2403,8 @@ struct v4l2_ctrl_hevc_decode_params { __u8 poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; __u8 poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; __u8 poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; - __u8 reserved[4]; + __u8 num_delta_pocs_of_ref_rps_idx; + __u8 reserved[3]; struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; __u64 flags; }; -- 2.25.1