Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4385347imu; Tue, 29 Jan 2019 00:11:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Re7AIkTCLYSKlnGXeuF2/2H/LTQDa3NrsYZWvOO4fJX89/dFs4vfDO3dmM1Gkq63x4yKX X-Received: by 2002:a63:f141:: with SMTP id o1mr23065837pgk.134.1548749484824; Tue, 29 Jan 2019 00:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548749484; cv=none; d=google.com; s=arc-20160816; b=V/gO+x/6G8UJfwOPeaTpWpLB8r5JvEWu/QOfdyG7rWcajTy9gxMIc62vZhwCtvNFr9 CK9Grr4TaX+kPQZ/NXDtFYb/9Yo3j2WY/KEVc17Jj4OfBm5VqEJ8MvBXrtyOAOKkM7Ne fDWZtt9jWrBxCOq1dol6mvvWNsMhkIVGc70t5FjoQA5AjjiMXUPQCCLiKMvCOvpgiFVq iuuGfko/tnhgdffn5zvZpRZwUxMXGYUZk9d30TkEDXaOwe+4Vsmxn5+gR26JnBb0i6jS ENp/HvJ8b8Jn9mBgf/gW0vqh4rWdkE5TukvvlvWstGlZrTq8tmA408jEX+Lsv+QhCHJ3 VrSA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=2h+jEphaIrbRBw/THi++/PD1R8d46gvWSo9H1p5WFOc=; b=JSmAw0/og1Yj3ZLUh//BbLYz4JuSR3VOR8oeYErkifgcZCSEieiFcMdDXFIno4SpAi g38v6rqreSkV0uIMbKxNV90JjOqgMLmtfjC7LGfUil1cIFeNDs9tVe5yfdeRz6fUMyw2 Vr+uZ205wQ6kHr0ShTnKqbgLcNBRI6hkYU5AsJ72xv6zhnvpbzY20vac7GH66StUPfAr 9fuqTl8hVG2nDkOa6BjPmN5S0vmky4/cL7/kKfGnYNf1GM1MCkblT9R07CmA+sfAYslK /jy3AADsxcZdgUtZlpnVv650aH0uFoQaWMcVVbo78yBXZAcnlr0whawKGcOQl3y1Td3U uMew== 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 e15si34530062pgm.25.2019.01.29.00.11.09; Tue, 29 Jan 2019 00:11:24 -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 S1727951AbfA2IJy convert rfc822-to-8bit (ORCPT + 99 others); Tue, 29 Jan 2019 03:09:54 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:43859 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727882AbfA2IJt (ORCPT ); Tue, 29 Jan 2019 03:09:49 -0500 X-Originating-IP: 90.88.29.206 Received: from localhost (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 2B779E0005; Tue, 29 Jan 2019 08:09:45 +0000 (UTC) Date: Tue, 29 Jan 2019 09:09:44 +0100 From: Maxime Ripard To: Alexandre Courbot Cc: Paul Kocialkowski , Ayaka , Randy Li , Jernej =?utf-8?Q?=C5=A0krabec?= , Linux Media Mailing List , LKML , devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Thomas Petazzoni , linux-rockchip@lists.infradead.org Subject: Re: [linux-sunxi] [PATCH v2 1/2] media: v4l: Add definitions for the HEVC slice format and controls Message-ID: <20190129080944.pfhumtugsm7mzzcc@flea> References: <776e63c9-d4a5-342a-e0f7-200ef144ffc4@rock-chips.com> <64c793e08d61181b78125b3956ec38623fa5d261.camel@bootlin.com> <82FA0C3F-BC54-4D89-AECB-90D81B89B1CE@soulik.info> <42520087-4EAE-4F7F-BCA0-42E422170E91@soulik.info> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 04:44:35PM +0900, Alexandre Courbot wrote: > On Fri, Jan 25, 2019 at 10:04 PM Paul Kocialkowski > > On Thu, 2019-01-24 at 20:23 +0800, Ayaka wrote: > > > > > > Sent from my iPad > > > > > > > On Jan 24, 2019, at 6:27 PM, Paul Kocialkowski wrote: > > > > > > > > Hi, > > > > > > > > > On Thu, 2019-01-10 at 21:32 +0800, ayaka wrote: > > > > > I forget a important thing, for the rkvdec and rk hevc decoder, it would > > > > > requests cabac table, scaling list, picture parameter set and reference > > > > > picture storing in one or various of DMA buffers. I am not talking about > > > > > the data been parsed, the decoder would requests a raw data. > > > > > > > > > > For the pps and rps, it is possible to reuse the slice header, just let > > > > > the decoder know the offset from the bitstream bufer, I would suggest to > > > > > add three properties(with sps) for them. But I think we need a method to > > > > > mark a OUTPUT side buffer for those aux data. > > > > > > > > I'm quite confused about the hardware implementation then. From what > > > > you're saying, it seems that it takes the raw bitstream elements rather > > > > than parsed elements. Is it really a stateless implementation? > > > > > > > > The stateless implementation was designed with the idea that only the > > > > raw slice data should be passed in bitstream form to the decoder. For > > > > H.264, it seems that some decoders also need the slice header in raw > > > > bitstream form (because they take the full slice NAL unit), see the > > > > discussions in this thread: > > > > media: docs-rst: Document m2m stateless video decoder interface > > > > > > Stateless just mean it won’t track the previous result, but I don’t > > > think you can define what a date the hardware would need. Even you > > > just build a dpb for the decoder, it is still stateless, but parsing > > > less or more data from the bitstream doesn’t stop a decoder become a > > > stateless decoder. > > > > Yes fair enough, the format in which the hardware decoder takes the > > bitstream parameters does not make it stateless or stateful per-se. > > It's just that stateless decoders should have no particular reason for > > parsing the bitstream on their own since the hardware can be designed > > with registers for each relevant bitstream element to configure the > > decoding pipeline. That's how GPU-based decoder implementations are > > implemented (VAAPI/VDPAU/NVDEC, etc). > > > > So the format we have agreed on so far for the stateless interface is > > to pass parsed elements via v4l2 control structures. > > > > If the hardware can only work by parsing the bitstream itself, I'm not > > sure what the best solution would be. Reconstructing the bitstream in > > the kernel is a pretty bad option, but so is parsing in the kernel or > > having the data both in parsed and raw forms. Do you see another > > possibility? > > Is reconstructing the bitstream so bad? The v4l2 controls provide a > generic interface to an encoded format which the driver needs to > convert into a sequence that the hardware can understand. Typically > this is done by populating hardware-specific structures. Can't we > consider that in this specific instance, the hardware-specific > structure just happens to be identical to the original bitstream > format? > > I agree that this is not strictly optimal for that particular > hardware, but such is the cost of abstractions, and in this specific > case I don't believe the cost would be particularly high? I mean, that argument can be made for the rockchip driver as well. If reconstructing the bitstream is something we can do, and if we don't care about being suboptimal for one particular hardware, then why the rockchip driver doesn't just recreate the bitstream from that API? After all, this is just a hardware specific header that happens to be identical to the original bitstream format Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com