Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3102877yba; Tue, 16 Apr 2019 04:56:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiMLEN/7PeMDv9b7qkolcDzDMtr/syahdiujSPkww+QcgsnDec3EDT+61cqnCG+W+wt181 X-Received: by 2002:aa7:87c5:: with SMTP id i5mr76936129pfo.20.1555415796803; Tue, 16 Apr 2019 04:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555415796; cv=none; d=google.com; s=arc-20160816; b=C/hPrndC7646Bzo9fZ3UISKdoT6+QdyUs0ul36KLVhT08sAsZqMqVfCc7w/o4gQMwj VQiZ3XpigM1UCxAwFeGtzEexKNtEsikEUWeE7diB2LiBb8GfNy+0O0TsIjSHwzoUAjL0 9UHM8uwZCvJMO8Vkgapcgr0zkIrGmHVPi5raJgWnWQvfMIiLeKRGrvSxeGVZwPDJ3pXX dk4KMYnGHM1deuw6ZsJlDhKnvwzVHsvkhscFdsuGzCvMjkIYxifkux/x+mjsrHKzFzvg go0EngjXDOazk3d8rAkns9gNBRI5/7IKoGZ6OihrX3S/p308kjus62vpBCF3l7gIHqOD trQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id; bh=nCs10jTQUlmuLDFhyncg+gBZgkovw3Dcmli5id3nJwk=; b=vZaBSNCgTAAxGyEbG4eNgr4XT8T/i95i1LFb3d9yNnwx0vDCjcbIMy917rdG4IawwJ VtuzU5FLwAj66ED/iUp5DEX+FhTE6iolFdnqrhRxOzoQWJiJP9v0gBTrcQA5iSskK6pE 53vPaBRGhcApeAQx3Yd9L23WPGTLhx73IWmy07uc+w4DREHOSN0mGTzYI0XqfgpzZlKZ 0g78sl4VAhoX8Xl+NR8zuefzEv/XTltrX091El+gI9HUNsphBjQy1219p0z/0hWSMldp vRTZKRJXkTvYB08oCXo4tEgjqD/GHsnLvva1pXiX6U7uaFpN1oAyt6+UQjqNpdzKeiMP +7zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g87si27243158pfg.44.2019.04.16.04.56.20; Tue, 16 Apr 2019 04:56:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729154AbfDPLyN (ORCPT + 99 others); Tue, 16 Apr 2019 07:54:13 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50028 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbfDPLyN (ORCPT ); Tue, 16 Apr 2019 07:54:13 -0400 Received: from skullcanyon (unknown [IPv6:2002:c0de:c115:0:481e:e17e:2f68:43f8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: nicolas) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 0499A281D52; Tue, 16 Apr 2019 12:54:07 +0100 (BST) Message-ID: Subject: Re: [PATCH RESEND v7 1/2] media: uapi: Add H264 low-level decoder API compound controls. From: Nicolas Dufresne Reply-To: Nicolas Dufresne To: Tomasz Figa , Maxime Ripard Cc: Chen-Yu Tsai , Hans Verkuil , Alexandre Courbot , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Paul Kocialkowski , Linux Kernel Mailing List , "list@263.net:IOMMU DRIVERS , Joerg " "Roedel ," , Linux Media Mailing List , Jens Kuske , Jernej Skrabec , Jonas Karlman , Ezequiel Garcia , linux-sunxi , Thomas Petazzoni , Guenter Roeck Date: Tue, 16 Apr 2019 07:54:03 -0400 In-Reply-To: References: <7cd913545cfc80fa9999839c62c4bf7b354a7904.1554380738.git-series.maxime.ripard@bootlin.com> <20190405151552.biesirbs35uivk7d@flea> <05078223a4098c96f6260f77e9ef2a01b966daa6.camel@collabora.com> <20190411155749.crdpidehjxa6edya@flea> Organization: Collabora Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-H6h/eLDKF45bATKuH42m" User-Agent: Evolution 3.32.0 (3.32.0-1.fc30) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-H6h/eLDKF45bATKuH42m Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le mardi 16 avril 2019 =C3=A0 16:16 +0900, Tomasz Figa a =C3=A9crit : > On Fri, Apr 12, 2019 at 12:57 AM Maxime Ripard > wrote: > > Hi, > >=20 > > On Fri, Apr 05, 2019 at 12:27:48PM -0400, Nicolas Dufresne wrote: > > > Le vendredi 05 avril 2019 =C3=A0 17:15 +0200, Maxime Ripard a =C3=A9c= rit : > > > > Hi Nicolas, > > > >=20 > > > > On Thu, Apr 04, 2019 at 11:41:13AM -0400, Nicolas Dufresne wrote: > > > > > > > > + * - __u16 > > > > > > > > + - ``pic_width_in_mbs_minus1`` > > > > > > > > + - > > > > > > > > + * - __u16 > > > > > > > > + - ``pic_height_in_map_units_minus1`` > > > > > > > > + - > > > > > > >=20 > > > > > > > We recently had some reflection with Alex that this is redund= ant with > > > > > > > the width and height in the OUTPUT format. It may also apply = to some > > > > > > > other fields in these structs. I feel like they should be rem= oved and > > > > > > > passed via corresponding generic V4L2 properties - format, se= lection, > > > > > > > etc. > > > > > > >=20 > > > > > > > The same problem is also present in the MPEG2 controls. In fa= ct, there > > > > > > > was a patch already which used some fields from the controls = to > > > > > > > calculate the destination buffer strides, rather than bytespe= rline in > > > > > > > the format. > > > > > > >=20 > > > > > > > Since we're in staging, it could be done with a follow-up pat= ch, though. > > > > > >=20 > > > > > > Just my two cents. I played with some codecs a while back. IIRC= some > > > > > > specify a "codec" size in addition to the actual picture size, = like > > > > > > when the encoder does padding to fit the requirements of the co= dec > > > > > > (spec). Is this needed anywhere? > > > > >=20 > > > > > With state-less encoders, the headers, which contains the crop > > > > > information is created by userspace and for state less decoder, t= he > > > > > headers that contains this information is parsed by userspace. So= I > > > > > believe that in theory, the accelerator does not strictly need to= be > > > > > aware of the cropped dimensions. > > > > >=20 > > > > > Another thing, is that there is not guarantied matches between e.= g. > > > > > depth of the chrome/luma and the final image buffers. Some hardwa= re may > > > > > have bandwidth limitation or internal converter and could possibl= y > > > > > decode 10bit data into 8bit buffers. > > > > >=20 > > > > > A third reason why I would not try and encode this header informa= tion > > > > > is that there can be multiple PPS/SPS at the same time, and I thi= nk > > > > > it's confusing if the relevant information to differentiate them = is > > > > > removed. > > > >=20 > > > > Sorry if that sounds a bit dumb, but it's not really clear to me if > > > > you're arguing for the removal of the data as Tomasz suggests, or i= f > > > > you want to keep them. > > > >=20 > > > > The first paragrah seems to advocate for the former, but the two > > > > others for the latter. > > >=20 > > > I think the data should stay. As I said, there can be multiple SPS/PP= S, > > > while there is only one format. That being said, how does SPS/PPS > > > activation works ? How do you tell the driver about all the SPS/PPS a= nd > > > which one is being activated ? > >=20 > > The current way of dealing with this is that the _SLICE_PARAMS control > > actually takes an array of SPS's. And same thing for PPS. > >=20 > > There's no difference between activated and deactivated ones > > though. What is the use case for this? >=20 > Uhm, there is only one format, but so there is only one active > SPS/PPS, isn't it? Yes, and the active one can only change on frame boundary. > An alternative would be to just make the OUTPUT format a function of > the currently set controls, so that it would always match the active > PPS/SPS, without the ability for the application to change it. >=20 > I just want to avoid the case when the OUTPUT format can be set > randomly to something different than in the stream and also drivers > reading randomly the format-related information sometimes from the > controls and sometimes from the format state. Understood. >=20 > Best regards, > Tomasz --=-H6h/eLDKF45bATKuH42m Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSScpfJiL+hb5vvd45xUwItrAaoHAUCXLXCWwAKCRBxUwItrAao HEwGAKC9vzS05UNWnMStFON4Z1xXPRm6oACeJm2bqgyFqXpZCkdiFXN29ux7DW8= =ac8L -----END PGP SIGNATURE----- --=-H6h/eLDKF45bATKuH42m--