Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp803010rwr; Wed, 19 Apr 2023 13:21:52 -0700 (PDT) X-Google-Smtp-Source: AKy350ZF4WuRv1sHfktbig4KDonhuoSa/iwJ3DG5oQ4QPGCClIunCQKWNCvk5T4Far6TJeGNGPZZ X-Received: by 2002:a17:90a:c24b:b0:249:7224:41cb with SMTP id d11-20020a17090ac24b00b00249722441cbmr3796727pjx.31.1681935712237; Wed, 19 Apr 2023 13:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681935712; cv=none; d=google.com; s=arc-20160816; b=Br9WhqfTBAIuM6V5Y5zxs4JGv1/7p2k1LyepIfnBPC7+KPWwx/n/KcwNkrt8gWwc4E esAhPuqZBiLFxtPhcsg1UG6BVt3V8TAi4RGtSYw8/UqVp6VoG2ZjH0PR5o57l+g5fmIL ko5cu5/fP+6hT3GCyhoN2Q3CRgN1W0Y87o0KBsdA0MS3xHe7BbdLf63s8MCsDXBficc0 y54NUdVbAJi6oZIrnvgbpYuQzWLSyuQARRLfSZmQL2hw9qK/pyFDKnphVwunIlN2RSN0 peCB3khVcvyY22V9DJeQ+SIkjMBUzC4BOu7LoPAuwAqKbU0jnPOqwF29lZMRN+blck2w F0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=BH6fWCm76VbmINlWsHpoQGn+QZAd0MvppX7JToF7NEo=; b=NQxzHd898SKzp5nnL5PMVLCS6FVFIaJoXhUbkNdeUh0q6AvtoEri8wUzfJv0WNlYyv uy4whI0PJPygtjPPAE2upsZpIF8owv3MP5q+oSjIkj1WTYmleGRsShXaWVaeEimIYT8Q lwwGcHogteYQnnqYdtHPd9HOFIqjP49citeekpYgWViZElwZ02AhqCPqiNoTZay01a5D XLOtkHMlxHXuk6ba4bDnX8xOoDJlY+uAymJUnhj4jAE3JKkm+T9NwpYyCWvGm3eI1LeE GrJpYXrO7ShGROWt+mPqOXLsQKhl3MxOHovq7kftuGYYmn/8hPusuUQLOL8+s2HsvW5X n17g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=StBvdoqA; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mg1-20020a17090b370100b002466237f79csi2342596pjb.97.2023.04.19.13.21.40; Wed, 19 Apr 2023 13:21:52 -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=StBvdoqA; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231572AbjDSUKw (ORCPT + 99 others); Wed, 19 Apr 2023 16:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231500AbjDSUKv (ORCPT ); Wed, 19 Apr 2023 16:10:51 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 790D14C33; Wed, 19 Apr 2023 13:10:49 -0700 (PDT) Received: from nicolas-tpx395.localdomain (unknown [IPv6:2606:6d00:15:199e::580]) (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: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id 7137B6603247; Wed, 19 Apr 2023 21:10:47 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681935048; bh=p6Bh6e7Qjn7BRm0mOG9dNdfJlWO9r4yzoXFJ/eJ0NLA=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=StBvdoqAOlrplsSJyWzXdLylHd8PoDk0WZX0t7NOZfSaPPlvSygbXsF/lg2S+aCUl EjZRlkrCSC5KYrsaH/StH7w0yFe1Ixcjrpq62C52CQ5VeJtlJT/Pa28mv4Idy45jt1 ySjCHuTDKukocIt+tMOF+6QYcGeVRpihONrUFnLGbVVQGM0d7dnsUFPFXfnzypCGKz cHD40EKWsTuDuNqLRKq3zjobxJh3Gu6Qr6zmJwMFcmviN+rYmCiAIHgpt9e87AGahn a9EPRJ+4vQZdzBysAvWRYmm3ByeJefq+O2NwlXX8q+m6F1bZY687sIlULnvti/645f ifTx9G6gq8BBw== Message-ID: <511c900070050a5cac317279ee4208cdc1d8d1af.camel@collabora.com> Subject: Re: [PATCH] media: uapi: HEVC: Add num_delta_pocs_of_ref_rps_idx field From: Nicolas Dufresne To: Benjamin Gaignard , mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Date: Wed, 19 Apr 2023 16:10:38 -0400 In-Reply-To: <20230418160717.743517-1-benjamin.gaignard@collabora.com> References: <20230418160717.743517-1-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 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,URIBL_BLOCKED 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 Le mardi 18 avril 2023 =C3=A0 18:07 +0200, Benjamin Gaignard a =C3=A9crit= =C2=A0: > 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. >=20 > This value also exist in DXVA API. >=20 > Signed-off-by: Benjamin Gaignard >=20 Reviewed-by: Nicolas Dufresne For the info, this is in preparation for MTK VCODEC HEVC driver. It makes o= ur API (hopefully) on par with DXVA, which has always been the goal, we simply missed it during review. regards, Nicolas > --- > .../userspace-api/media/v4l/ext-ctrls-codec-stateless.rst | 7 +++++++ > include/uapi/linux/v4l2-controls.h | 6 +++++- > 2 files changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-statel= ess.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.r= st > 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 pa= rameters. See sections > - ``poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` > - PocLtCurr as described in section 8.3.2 "Decoding process for re= ference > 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 ca= n 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 h= eader 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 refere= nces > * in DPB array > * @poc_lt_curr: provides the index of the long term references in DPB a= rray > + * @num_delta_pocs_of_ref_rps_idx: same as the derived value NumDeltaPoc= s[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 frame= s > * @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; > };