Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5563300imu; Tue, 29 Jan 2019 23:04:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ko5fzEJ3IrnC4nHQaK99Kzb5b747jYx1qmi7RIgeTMOXEBBYqWVpfm0LQq39DdirZTr2d X-Received: by 2002:a63:1204:: with SMTP id h4mr26602404pgl.51.1548831881156; Tue, 29 Jan 2019 23:04:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548831881; cv=none; d=google.com; s=arc-20160816; b=iTIANnmJunRBf+MxrhBqK0uUSMh2PnNZhTtnsGhrF0NzuuOJq7aHmSVn3wMxmp78Kt qh8ifl2g9xBwGAnCdZTQpfznkDHXRu2rA+pFeatWzSVxqe28eSMeOSsek26RE1F/4Kmg JPm23W1h2ranCDfs0tlXvSCmrS4OlKDucniwKT5GTe3pg6jcXhx7reDzBCYzLHZGMHAK Twtv4Lfxiortnx0fedVGMjYRHUoW5ENRR6yD+lu5wGw3YHbNXdQ6njVoa/41cEZCW1gj CwSiAUPPLbEpi1+S8KSd3g3r2iA8IpyfydkR0dd9fwLk+f1YUqnR7/A7qlvZT07US3Xx vzlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=86wNlpy572qiDMWIC5YnIsDOExY137P1pndjnx3Ro5E=; b=YKK2OmXRZqgkKAEYOYVrioD5InzW4wu+g61uX0fVvHoxc9jMEJE/MCZB10amo9LYhM GpX6pCR08SM4bjG/Mx9S3wVVa01L34pioYdUhje0BGtrV3lipaNbnc/kdqfeZmPEJ4K8 CdocqWPDkBappdRGtNAg47XSyHic0LYHoOk3f2dPhASBvmpU9BiO0jpzQHF4OIPfCAoE 9Rpwq0e/hgZEGfuTZEzL96abppdYdGIFEi2Pe7i9y6uBBE1QwEjroE+1m87vIDMaDcFi 8mynYXsj8dLNBeFbxJiHv2cj3FVAPz9pMdFlu16ALLWKuKRXfsj8rPWeNs9levat8f2l jQTw== 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 l5si739959pls.423.2019.01.29.23.04.25; Tue, 29 Jan 2019 23:04:41 -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 S1729934AbfA3HD4 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 30 Jan 2019 02:03:56 -0500 Received: from kozue.soulik.info ([108.61.200.231]:35876 "EHLO kozue.soulik.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfA3HD4 (ORCPT ); Wed, 30 Jan 2019 02:03:56 -0500 Received: from [192.168.10.231] (unknown [103.29.142.67]) by kozue.soulik.info (Postfix) with ESMTPSA id 55AE210106E; Wed, 30 Jan 2019 16:05:05 +0900 (JST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [linux-sunxi] [PATCH v2 1/2] media: v4l: Add definitions for the HEVC slice format and controls From: Ayaka X-Mailer: iPad Mail (16A404) In-Reply-To: <2442b23d3b0a00c1bd441298a712888e016acf92.camel@ndufresne.ca> Date: Wed, 30 Jan 2019 15:03:51 +0800 Cc: Alexandre Courbot , Paul Kocialkowski , Randy Li , =?utf-8?Q?Jernej_=C5=A0krabec?= , Linux Media Mailing List , LKML , devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , Maxime Ripard , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Thomas Petazzoni , linux-rockchip@lists.infradead.org Content-Transfer-Encoding: 8BIT Message-Id: <3E2E3087-B2C7-48A9-B465-C4BDFA1250A7@soulik.info> References: <20181123130209.11696-1-paul.kocialkowski@bootlin.com> <20181123130209.11696-2-paul.kocialkowski@bootlin.com> <5515174.7lFZcYkk85@jernej-laptop> <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> <2442b23d3b0a00c1bd441298a712888e016acf92.camel@ndufresne.ca> To: Nicolas Dufresne Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sent from my iPad > On Jan 30, 2019, at 5:41 AM, Nicolas Dufresne wrote: > >> Le mardi 29 janvier 2019 à 16:44 +0900, Alexandre Courbot a écrit : >> On Fri, Jan 25, 2019 at 10:04 PM Paul Kocialkowski >> wrote: >>> Hi, >>> >>>> 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? > > At maximum allowed bitrate for let's say HEVC (940MB/s iirc), yes, it Lucky, most of hardware won’t be able to processing such a big buffer. General speaking, the register is 24bits for stream length in bytes. > would be really really bad. In GStreamer project we have discussed for > a while (but have never done anything about) adding the ability through > a bitmask to select which part of the stream need to be parsed, as > parsing itself was causing some overhead. Maybe similar thing applies, > though as per our new design, it's the fourcc that dictate the driver > behaviour, we'd need yet another fourcc for drivers that wants the full > bitstream (which seems odd if you have already parsed everything, I > think this need some clarification). > >> >> 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?