Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1335338pxm; Sat, 26 Feb 2022 12:09:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKwcZTR5w6FhDcAEF/bzshjeWs9ezbOJH+ehDJxqb/glR+9ttcZdqwlNkRm5L4YBEMF20q X-Received: by 2002:a17:90b:1509:b0:1bc:d225:365 with SMTP id le9-20020a17090b150900b001bcd2250365mr9195287pjb.37.1645906140327; Sat, 26 Feb 2022 12:09:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645906140; cv=none; d=google.com; s=arc-20160816; b=xYPLIR+tCdPpfVb8j8n0eHq+/Bb2Vsake5jmdHh8BrJfEH9Cgat6wZBhOtmwANInmi NEBMIWMutwJBW2OIS89V2WrF6/YKrA8+K8wlATtaPldLZwLY6tCjI5qqQHy9v5Fjcuei 9alIpaWOvnU5+Tj5lhmMyb+Ka3IZKvU8Lo3LLth1ZbaZT3n9S85duKbM3RIEWEQdvxTH 2UdvBZ+tpmzZXqvYAx9VJJx2lUFMS2LFEgJ+cxoRUTs/sWd5LSq87K6j8TwYXVkajMR4 9THSOsifL34vrf1rtDIl4uGRnOoH/2f1z3jhdZu7Y1FYp6yQjAsjbWwgDHgLLOg9P7K3 KC9Q== 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=9V9Jct16AZTz4K2DeDR/xCDxmdE9Vl1rLYHKFySR8Q8=; b=SxDFhEs/LOeNZlyHwTz3AmMZL3y9Q1q5IOny2vlMSVIkKzRIxAvBzZGzDw6gxMPyC9 UqG+LETNeFF8q0bv6XuepxyDW6MJSEvpI+pqJq2WrpZNg0beLDLqB+sPrK3DQMrj+o5Q c7is0kZ9ix/eeptVAlqEWi0i7MZs3ZK2SCuFH5o10ADvyhILeZ2T+jV5XdiTLaDg43wG jlqlrLYOlH77GD+sMC44OPRuaJkVvDB19wiJHjLsFNO3/NZsd4yxBUTEvokOARUgXf1B edJHmOBkb9dud571e0ARTA16bThXOTD9hNZCOl5yI/VXn/IFeGN9hUxQIaHaNGG9xRoh oTLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OS5rKUhE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a19-20020a637053000000b003744a05e89fsi5655320pgn.504.2022.02.26.12.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 12:09:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OS5rKUhE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 17C5720FCAF; Sat, 26 Feb 2022 12:07:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbiBZSAA (ORCPT + 99 others); Sat, 26 Feb 2022 13:00:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbiBZR76 (ORCPT ); Sat, 26 Feb 2022 12:59:58 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C049140C9; Sat, 26 Feb 2022 09:59:22 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id n25-20020a05600c3b9900b00380f41e51e6so3593773wms.2; Sat, 26 Feb 2022 09:59:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9V9Jct16AZTz4K2DeDR/xCDxmdE9Vl1rLYHKFySR8Q8=; b=OS5rKUhE7WXuiZzAYW7cwzYiV8SBfaes2cbt2tE8S+TsEw1AJJ/EtauXm86t/sGGOk 6Gtznw8XzXomN2E/jJX1Ab/F4luPeUHfombr9N4K93wAUclK1Q5xLFFAlq8pEUfN/85P nPPov3wToi44wYltDMShEha7ixTIYA0kQadq5sw8EiEUEo5T+zhVbzoouPd8RuNibsNc vjFiFWeAb1mlzc9ubE77Lg4FPwakw78ykg0kXAEL06cUaWCdknrUlqstev+v2hqB4Zvb eZG3EyajjZ2e4Y+1Akl3IqfS7qbDc7pvcencVFz3EUr+Kn+9K/kb4i0buxEI2YwpKCR9 ZWzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9V9Jct16AZTz4K2DeDR/xCDxmdE9Vl1rLYHKFySR8Q8=; b=cUECq/T4PFbb2QswJGm7U8b3JDcHvQW02cNiwh5tG1/qR+2TIyFueQmijiD/RCP0s+ aZYNow0+dslgY/N64L2Wg5Sn/oatrQCc+WZoYAGiBWxUMTuLxhHZbn7buDL4mwWYNwF6 5OxCB061+np1aZNZlZmpMC44x2d6pzB7VOMQnRY0QsFRxFNSw/k8/oQ1rzEVbHjRYQNT nuCsPEp/+elIDmPvCYDZYsCTpQUYeDvIRl7Aan9FFLOg2y5zCH5sIORLkFvjJTc03JeY id1yliYey2n1S0hg9P2OKo9H7NRLGwsvLMJQPEY8EuFqnxEz8CqyhA/WG6uxM0p47tfr 1wGw== X-Gm-Message-State: AOAM532lt6PNPIPUikOKnlcP/WVdqfEtrJZSV07IyfBqyh6+VPWD3vG4 lRH8m8NOA73r9zKurUaBOVw= X-Received: by 2002:a05:600c:4281:b0:381:40e5:6cea with SMTP id v1-20020a05600c428100b0038140e56ceamr5143482wmc.151.1645898360547; Sat, 26 Feb 2022 09:59:20 -0800 (PST) Received: from kista.localnet (cpe-86-58-32-107.static.triera.net. [86.58.32.107]) by smtp.gmail.com with ESMTPSA id e15-20020a5d6d0f000000b001ef7dca67fasm3741211wrq.114.2022.02.26.09.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 09:59:20 -0800 (PST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: mchehab@kernel.org, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jonas@kwiboo.se, nicolas@ndufresne.ca, Benjamin Gaignard Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, knaerzche@gmail.com, jc@kynesim.co.uk, Benjamin Gaignard Subject: Re: Re: [PATCH v3 09/14] media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSET control Date: Sat, 26 Feb 2022 18:59:18 +0100 Message-ID: <1884298.PYKUYFuaPT@kista> In-Reply-To: <4378293.LvFx2qVVIh@kista> References: <20220225164600.1044663-1-benjamin.gaignard@collabora.com> <20220225164600.1044663-10-benjamin.gaignard@collabora.com> <4378293.LvFx2qVVIh@kista> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Hi! Dne petek, 25. februar 2022 ob 20:30:20 CET je Jernej =C5=A0krabec napisal(= a): > Hi! >=20 > Dne petek, 25. februar 2022 ob 17:45:55 CET je Benjamin Gaignard napisal(= a): > > The number of 'entry point offset' could be very variable. > > Rather than use a large static array define a v4l2 dynamic array > > of integer control. >=20 > I suggest we should be more specific and say U32 (V4L2_CTRL_TYPE_U32). >=20 > > The number of entry point offsets is reported by the elems field. I did few more tests and these are my findings: 1. dynamic array can't be set over size, specified in .dims array 2. entry point offsets are per slice, so if we make slices dynamic array, t= hen=20 entry points would become two dimensional dynamic array 3. num_entry_point_offsets must be part of slice control, because it can be= =20 zero, but size of array can't be 4. fortunately, not setting entry points doesn't impact decoding correctnes= s.=20 This is in line what John told me about them. Hans, can you comment points 1-3? I might misunderstand point 1. In short, it seems like we don't really need entry points, even if they are= =20 used in BSP library. In both cases, I got fluster score 119/138 (10-bit=20 excluded), so we can just drop this patch, although I'm a bit uneasy not=20 setting entry points... Best regards, Jernej > >=20 > > Signed-off-by: Benjamin Gaignard > > --- > > .../userspace-api/media/v4l/ext-ctrls-codec.rst | 9 +++++++++ > > include/media/hevc-ctrls.h | 1 + > > 2 files changed, 10 insertions(+) > >=20 > > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst = b/ > Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > > index 44a268a948c0..71f7dc1c1ccd 100644 > > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > > @@ -3128,6 +3128,15 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - > > =20 > > \normalsize > > =20 > > +``V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS (integer)`` >=20 > Here you have OFFSETS (plural) ... >=20 > > + Specifies the i-th entry point offset in bytes and is represented = by > > + offset_len_minus1 plus 1 bits. >=20 > You probably mean entry_point_offset_minus1? offset_len_minus1 just tells= how=20 > much bits need to be read for each element and it's not important for act= ual=20 > decoding. >=20 > > + This control is a dynamically sized array. The number of entry poi= nt > > + offsets is reported by the ``elems`` field. > > + This bitstream parameter is defined according to :ref:`hevc`. > > + They are described in section 7.4.7.1 "General slice segment header > > + semantics" of the specification. > > + > > ``V4L2_CID_STATELESS_HEVC_SCALING_MATRIX (struct)`` > > Specifies the HEVC scaling matrix parameters used for the scaling= =20 > process > > for transform coefficients. > > diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h > > index 3016c1abb1d0..3f8a67924df3 100644 > > --- a/include/media/hevc-ctrls.h > > +++ b/include/media/hevc-ctrls.h > > @@ -20,6 +20,7 @@ > > #define V4L2_CID_STATELESS_HEVC_DECODE_PARAMS (V4L2_CID_CODEC_BASE +=20 > 1012) > > #define V4L2_CID_STATELESS_HEVC_DECODE_MODE (V4L2_CID_CODEC_BASE +=20 > 1015) > > #define V4L2_CID_STATELESS_HEVC_START_CODE (V4L2_CID_CODEC_BASE +=20 1016) > > +#define V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSET (V4L2_CID_CODEC_BAS= E +=20 > 1017) >=20 > ... and here you have OFFSET (singlular). I suggest plural form to be use= d=20 in=20 > all places, including subject line of this commit. >=20 > Additionally, it would be nice if control is initialized, like so: > https://github.com/jernejsk/linux-1/commit/ > f938e162cd8dd77c9f6f1b248d80144840a37bce >=20 > Best regards, > Jernej >=20 > > =20 > > /* enum v4l2_ctrl_type type values */ > > #define V4L2_CTRL_TYPE_HEVC_SPS 0x0120 > > --=20 > > 2.32.0 > >=20 > >=20 >=20 >=20 >=20