Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp422065imu; Fri, 25 Jan 2019 04:48:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN4fSe0TkR1FswljMlUXakXmF0HH8PfSddWuhqXyXRStYAGDgT6no9M1fdUsevf/n5ZOxIIh X-Received: by 2002:a17:902:7e44:: with SMTP id a4mr10904775pln.338.1548420493884; Fri, 25 Jan 2019 04:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548420493; cv=none; d=google.com; s=arc-20160816; b=VmcTRv68GWWczEJNHRj5gNBAhdh+Rg14jGUE8iz1JgZ1XQBYS/TbL8mOXFZWRrqYPZ KnIAY5HnZTXr43usPMk99MAexAyZa+/lSil0W0ej0dbG7tSUjiWV6Zl/clCYe+INPhmU 90iLMmpHTkU9I4haMvKkSUyNhBaseIZSSGOBzeUk2mpz5Z0bgvOM6A8aLXedUALJ9yek IRwgZOP5zzlJm6r292ZBrMTW/XlXf1VD7JiDLoTfGoaLKlAqpoBkux597BFxi9UfCGe7 O4j/d72LqZiSR5kyiwUrYrjuG8A2px18LSMqIOwMibq5yWOLepMHNasWpEg8jT2HBhv2 Juxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TdqiX+Q/0zxjRAJA4JwfO96MdUi0ztKV56vQf43pgOs=; b=GMeOLPO7zZib9XShxs3FAlqmVEEWemZSZ9mVtNXqpLJ84Xml/yh9mWNG+052gaeb8Y 8r+rtr/MzcxFNfiUiLC0w5hZ3bN6+rM5dqwu4H/uF+q9lcq9OliXR1vXK1Hwfory9NND so6nnUibpWrwJNOY6qRyw5Vle0UhjfsqStC206JE9InNsYrcMssmhlIjvAi2k+3Wp42K jFYGVODc7EIkZQiKRwSFWeujoyUL021uDFzfxnLdzYQDMuQbV4XAZO47qKpbov18Atal IEUt7ev9oo2N+b5XVM2bbwQ+hsqVrzEewWF3L9GN4NkA/n65Wk9+jkpeBoJQuclKCfRw PnNg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si8375477pgs.8.2019.01.25.04.47.55; Fri, 25 Jan 2019 04:48:13 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726311AbfAYMru (ORCPT + 99 others); Fri, 25 Jan 2019 07:47:50 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49656 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbfAYMrt (ORCPT ); Fri, 25 Jan 2019 07:47:49 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id BF42F207B0; Fri, 25 Jan 2019 13:47:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) by mail.bootlin.com (Postfix) with ESMTPSA id 8F9C620798; Fri, 25 Jan 2019 13:47:46 +0100 (CET) Date: Fri, 25 Jan 2019 13:47:47 +0100 From: Maxime Ripard To: Ayaka Cc: tfiga@chromium.org, acourbot@chromium.org, hans.verkuil@cisco.com, sakari.ailus@linux.intel.com, Laurent Pinchart , jenskuske@gmail.com, linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, Paul Kocialkowski , Chen-Yu Tsai , posciak@chromium.org, Thomas Petazzoni , Guenter Roeck , nicolas.dufresne@collabora.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: [PATCH v2 1/2] media: uapi: Add H264 low-level decoder API compound controls. Message-ID: <20190125124747.u32sgm3kto5uo3op@flea> References: <20181115145650.9827-1-maxime.ripard@bootlin.com> <20181115145650.9827-2-maxime.ripard@bootlin.com> <20190108095228.GA5161@misaki.sumomo.pri> <20190117110130.lvmwqmn6wd5eeoxi@flea> <20190124142353.hnhd5kez6wrwcyrn@flea> <2C346EE9-7066-497C-BDE2-D4ED0BC3E8CF@soulik.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4j77cwpxkml3x2rt" Content-Disposition: inline In-Reply-To: <2C346EE9-7066-497C-BDE2-D4ED0BC3E8CF@soulik.info> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --4j77cwpxkml3x2rt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 24, 2019 at 10:37:23PM +0800, Ayaka wrote: > >>>>> +#define V4L2_H264_DPB_ENTRY_FLAG_VALID 0x01 > >>>>> +#define V4L2_H264_DPB_ENTRY_FLAG_ACTIVE 0x02 > >>>>> +#define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM 0x04 > >>>>> + > >>>>> +struct v4l2_h264_dpb_entry { > >>>>> + __u32 tag; > >>>>> + __u16 frame_num; > >>>>> + __u16 pic_num; > >>>> Although the long term reference would use picture order count > >>>> and short term for frame num, but only one of them is used > >>>> for a entry of a dpb. > >>>>=20 > >>>> Besides, for a frame picture frame_num =3D pic_num * 2, > >>>> and frame_num =3D pic_num * 2 + 1 for a filed. > >>>=20 > >>> I'm not sure what is your point? > >>=20 > >> I found I was wrong at the last email. > >>=20 > >> But stateless hardware decoder usually don't care about whether it is = long > >> term or short term, as the real dpb updating or management work are no= t done > >> by the the driver or device and decoding job would only use the two li= st(or > >> one list for slice P) for reference pictures. So those flag for long t= erm or > >> status can be removed as well. > >=20 > > I'll remove the LONG_TERM flag then. We do need the other two for the > > Allwinner driver though. > > > > I would ask Paulk and check the manual and vendor library later. > > Even there are two register fields, it don=E2=80=99t mean they would be u= sed > and required at the same times. Because it don=E2=80=99t follow ISO manua= l. It's not a matter of decoding per se, but how the hardware behaves. All the buffers needed for one particular frame to be decoded are uploaded to an SRAM, and the position of each buffer in that SRAM cannot change during the time when it has been decoded, and then later on when it's used as a reference. If you only have the frames needed to decode the current frame, you will have no idea which slot in the SRAM can be reused, whereas having the full DPB allows you to do that. And that's what _FLAG_ACTIVE gives you. > >> And I agree above with my last mail, so I would suggest to keep a prop= erty > >> as index for both frame_num and pic_num, as only one of them would be = used > >> for a picture decoding once time. > >=20 > > I'd really prefer to keep everything that is in the bitstream defined > > here. We don't want to cover the usual cases, but all of them even the > > one that haven't been designed yet, so we should be really > > conservative. > > As I mention in the other mail, a stateless decoder or encoder like > means the device won=E2=80=99t track the previous result. But you have no > idea on what data the device would need to process this picture. It > is hard to define a standard structure for it. > > As you see, even allwinner doesn=E2=80=99t obey all the standard the IOS > document said. It's not that it disobeys it, it's that it requires the full blown DPB to have a working driver. > In my original suggestion, I would just to add more reservation > fields then future driver can use it. This interface is not stable at the moment, so it doesn't really matter does it? Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --4j77cwpxkml3x2rt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXEsFcwAKCRDj7w1vZxhR xU9NAQCZ1qMdFglALC1FLCsl6lJcRymPFtnvZK3rEaitAU6G7gEAuNPCTfcLx9q5 hobcl0NLL0Glc+KUy2OgGK9srXLahgA= =OB3Z -----END PGP SIGNATURE----- --4j77cwpxkml3x2rt--