Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4371347imu; Mon, 28 Jan 2019 23:54:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN51R6rVcCLevyOrbdAAqIOIC1tgpY2xGbT5iiQU2lnR7K67zR+zmYXsYPPeTTXT4UzO80DI X-Received: by 2002:a17:902:a411:: with SMTP id p17mr24715859plq.292.1548748452221; Mon, 28 Jan 2019 23:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548748452; cv=none; d=google.com; s=arc-20160816; b=gqECwza5yg/Ez6Q7oHy6x1AiAgidMeqFuAf9PIXeFhmoVEgqRzc+A8Y/E/yBCbOggz N/3xRxiDlPGevn5OSQqrFOa0yS3Cp2afWjAjQTRygxjCClaiarFfnF85aiWuishJ8Rt4 v260fO8Lnc/Ou3AsFBTFK4bK9epFWyzUWJUH+YeoX8svogHWKNm50eV9o5EqhJF3Ofk0 xfMb9DmtT4sFOJ8HjD0TNCVNKBYR/jDEA5uXVMLZDGwXVqHuMF73KlYjm84SgiJ/POsk mNlR6L4ORCX8tIBpP6hQvo5KoKe24WmfmsqKe8Qaxqlcp5Kf18Wi9RtNsX77OTk1Gagw fE1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=sg8RsoaeVSyRM13cr5tOwJLRDxxtn7MjroRD+akYFO8=; b=LQc8hdUfIsG6UY0br7wnyY9Tv1+NQMX0RN84cBYzsXykcrqtN9+K4jYgr141ZFbXx4 S1qrQ829wN7+hHz84kbhO30/JlYwvCfwYFrkGbtaQ7vuIgHeVyKJ7XbSRiA8+2CG7RZ6 1ZYaf0kTF3+fNsl/k1x5DSH5NMY74NGSEebF/05ofscZj/X7gyICBhjA6ERLkMSKXTjz /vtxSbEUMRBX84Jsk2za6mLxNsp+jkjPQtw0nO3w91I60b3SoTD4UNvePJbxKMCilS9Z q+e8s7UuN1wvVpRDrnARw5UNyRRioPrYUxSmSUlJcsDwiNJya1RBWOsWv8ELT3ZYm/N/ w8Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EDc3rw5R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f63si22908181pfg.136.2019.01.28.23.53.54; Mon, 28 Jan 2019 23:54:12 -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; dkim=pass header.i=@chromium.org header.s=google header.b=EDc3rw5R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbfA2Hvn (ORCPT + 99 others); Tue, 29 Jan 2019 02:51:43 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:32973 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbfA2Hvn (ORCPT ); Tue, 29 Jan 2019 02:51:43 -0500 Received: by mail-oi1-f194.google.com with SMTP id c206so15447276oib.0 for ; Mon, 28 Jan 2019 23:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sg8RsoaeVSyRM13cr5tOwJLRDxxtn7MjroRD+akYFO8=; b=EDc3rw5RmGhwyCdR1w79Ob9Bp8OAgfX8H2Y7qobBPURN3XUJWK+gOmWJ1p2Wtl5qjk f+mmr6SX/2LFC/j8SpeDPn/FTZ9GKoua45nie5ASbXR99pDf+8V1bMQ2ow5TSyFLV41X 9yKTUhQpBi+oc6nVNyshshx/POxsjJ2Zn6+sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sg8RsoaeVSyRM13cr5tOwJLRDxxtn7MjroRD+akYFO8=; b=N46uwlS3m8+4I4uQava28Ke0BNM12UtlvFfhagNkoncwJvwoUGBcdPvszCKYmDVP+7 fYac2FP0rvm7FgSGjAX2rzj9hQdrvoxwdTSgABz3VEcP0rBbBSVUcI3hg3M/I0KKpQkw pnkLYR65s+Mk1ElY9e5ZyUx6HaGxLNBDK0d/mnGDXXdilrfZgl0f0WU5GMjRY97I8hMk Ll/9+QUpymF0UMBrdz4jzicddTSqU7ChTtcwfNrpeI3hrLyZaDHhOqtrzIUCigmokFDG 9kDSka/uEbaYDG0JNo3g1pcoIL1GePdDyyZdw7ssU8JgYXiXENj9B1+7SYJlrx5hvlM2 YnIw== X-Gm-Message-State: AJcUukd5bKeluJwSmL9Az52AEAb9G7DvZ9xnN4tSIn+fxNBC+PKcWnHe Jln03suQyJ8vZDgggWyvQ/LADao4O8tmeA== X-Received: by 2002:aca:ea57:: with SMTP id i84mr8608746oih.346.1548748301829; Mon, 28 Jan 2019 23:51:41 -0800 (PST) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com. [209.85.210.41]) by smtp.gmail.com with ESMTPSA id h64sm2362142otb.45.2019.01.28.23.51.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 23:51:41 -0800 (PST) Received: by mail-ot1-f41.google.com with SMTP id n8so17091437otl.6 for ; Mon, 28 Jan 2019 23:51:41 -0800 (PST) X-Received: by 2002:a05:6830:14d6:: with SMTP id t22mr17871926otq.146.1548747887817; Mon, 28 Jan 2019 23:44:47 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: From: Alexandre Courbot Date: Tue, 29 Jan 2019 16:44:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] [PATCH v2 1/2] media: v4l: Add definitions for the HEVC slice format and controls To: Paul Kocialkowski Cc: Ayaka , 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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 refer= ence > > > > 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 sugge= st to > > > > add three properties(with sps) for them. But I think we need a meth= od 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 rath= er > > > 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=E2=80=99t track the previous result, but I d= on=E2=80=99t > > 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=E2=80=99t stop a decoder bec= ome 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?