Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4526809imm; Tue, 9 Oct 2018 00:37:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV63lZTI80xYEORZF7VCo0YCh7qbqB/P6XVpMLWAmdfUGh9h1+c1uLyDKjHjR7PI2ickIQYAg X-Received: by 2002:a63:6645:: with SMTP id a66-v6mr24139730pgc.5.1539070654445; Tue, 09 Oct 2018 00:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539070654; cv=none; d=google.com; s=arc-20160816; b=WwIV0kx2Qq1oLfKNJNOngQ/Z/cForZBJp2adZ4anFfYoEGEhdIk7BJdE5qFYDqPhVs E63Bpwh4y4nw2/6PYirhFFoXI1310NeoMYpXZN+FU/3MyfLvEvyqDWoVxAzXLU5QISkx 9d3LC8rciN3v2T8inHM0nPRfMFhxJUSEfcyEqCLv9w31fm1zg8K2w+c6Ef5rpC/KAXgy SHV8WLLBCn07CAsRI73T8OJBaoF2ezoE6kcy/zozFpE3LtejXsHmLWPxUPl0bdEPwHzl d1DMtpI/bM1puCQLeQ6JYzaKFV0AhAJm8zTBYzpEJTnjdlJuGZu45hYB4hoVRTV0beOS e+nA== 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=cW1dQ7JX/79viH31cfUp8J5qXmRot9g3E4BlrCvw0no=; b=S/hl6RBR/bD7K2apjquv8ObCESCuAthKaWFXpRsDfVz1ggPF7hPWyuOesACDxR7O87 0x/0u85TzlRRN2uW2h7Apf4slbpfBN0IClaRy+zvVdwcUkAmifydzDCzHAvaIZYFPbBC sMBZ0jQTwEVxr7j8akUQvdEYPXJntYwfNLSbX+YItPHFl1XqHKfUWTu6Ov8ySrVm3bKJ B/InuwJ0FZoai3s+bassOB3ZARFtOhoyf6afwDDNFUUkQhxJYFyLh65Izy8lPpJ3IF3V cWQhc9fohbpx6um9K7SSSnB+jjUX/4omsoIWtTVK5Eu8AABycGPbKx7B53yasRbCb5MA Oo+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aC0Gy5Sd; 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 c6-v6si19675485plr.91.2018.10.09.00.37.20; Tue, 09 Oct 2018 00:37:34 -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; dkim=pass header.i=@chromium.org header.s=google header.b=aC0Gy5Sd; 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 S1726761AbeJIOvx (ORCPT + 99 others); Tue, 9 Oct 2018 10:51:53 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:32899 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbeJIOvx (ORCPT ); Tue, 9 Oct 2018 10:51:53 -0400 Received: by mail-yw1-f68.google.com with SMTP id m127-v6so255448ywb.0 for ; Tue, 09 Oct 2018 00:36:17 -0700 (PDT) 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=cW1dQ7JX/79viH31cfUp8J5qXmRot9g3E4BlrCvw0no=; b=aC0Gy5SdWX7P9DFwUvEFezQQ3ns5gO2FCEmObzffcf4mhyf/EVIdlP0uPgVAj9XztH o3DTjReMO9z+npRdL+J0K8AKFBSCmTDUPFrh/+beuYCeASlSy9J2T7m2L+HEjJJdjvss 41ZUO0M0VAOLgGMmTq56MLeZM2jpq8OpjdXJs= 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=cW1dQ7JX/79viH31cfUp8J5qXmRot9g3E4BlrCvw0no=; b=IM3t8rDg8a2kDLD+UfI9Z/HtoIBBBwGzvDzLYk49BBEqUPigiBjYLndOPbuVCdv1nM CLG5p1s3iI67eJldzEuWctvrE7pcw53u3pvyeC/69NSTGiKTMgvPk7thNT5zaoqKpDaw N1idRL1fDTWQNOcd4cC3+UL4+l/bNszncIXV1dLxFQYYAy9ntQ08CRWE9RUYqOHzOTA4 OwJ1kv8++/uRQKJ4TK+DYVb0rJYZ5yKec/OPC5vVYT1qgGYdKGthUoNVwSD+0obQuwWh 4pYHWfbfhLczZuVbbGPih74s4sFLAL7jeGKFAJW9rovTMICPSVziBigbtNNPvSAxaLjq Ms0A== X-Gm-Message-State: ABuFfohg5r+WtEE7f6nRTixrj0bjlvhkNg2/qhnRiYwW3EMieDxRtIRo 8uBsdILkU/xz6quuN0Ju7uRkTfhUvzakYg== X-Received: by 2002:a0d:fa42:: with SMTP id k63-v6mr12541259ywf.41.1539070577151; Tue, 09 Oct 2018 00:36:17 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id u143-v6sm11489228ywc.28.2018.10.09.00.36.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 00:36:15 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id 5-v6so246777ybf.3 for ; Tue, 09 Oct 2018 00:36:15 -0700 (PDT) X-Received: by 2002:a25:bd0c:: with SMTP id f12-v6mr15184090ybk.293.1539070575175; Tue, 09 Oct 2018 00:36:15 -0700 (PDT) MIME-Version: 1.0 References: <20181004081119.102575-1-acourbot@chromium.org> <5085f73bc44424b20f1bd0dc1332d9baabecb090.camel@ndufresne.ca> In-Reply-To: From: Tomasz Figa Date: Tue, 9 Oct 2018 16:36:03 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2] media: docs-rst: Document m2m stateless video decoder interface To: contact@paulk.fr Cc: nicolas@ndufresne.ca, Alexandre Courbot , Mauro Carvalho Chehab , Hans Verkuil , Pawel Osciak , Maxime Ripard , Linux Media Mailing List , Linux Kernel Mailing List 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 Sat, Oct 6, 2018 at 2:09 AM Paul Kocialkowski wrote: > > Hi, > > Le jeudi 04 octobre 2018 =C3=A0 14:10 -0400, Nicolas Dufresne a =C3=A9cri= t : > > Le jeudi 04 octobre 2018 =C3=A0 14:47 +0200, Paul Kocialkowski a =C3=A9= crit : > > > > + Instance of struct v4l2_ctrl_h264_scaling_matrix, containing t= he scaling > > > > + matrix to use when decoding the next queued frame. Applicable = to the H.264 > > > > + stateless decoder. > > > > + > > > > +``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAM`` > > > > > > Ditto with "H264_SLICE_PARAMS". > > > > > > > + Array of struct v4l2_ctrl_h264_slice_param, containing at leas= t as many > > > > + entries as there are slices in the corresponding ``OUTPUT`` bu= ffer. > > > > + Applicable to the H.264 stateless decoder. > > > > + > > > > +``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAM`` > > > > + Instance of struct v4l2_ctrl_h264_decode_param, containing the= high-level > > > > + decoding parameters for a H.264 frame. Applicable to the H.264= stateless > > > > + decoder. > > > > > > Since we require all the macroblocks to decode one frame to be held i= n > > > the same OUTPUT buffer, it probably doesn't make sense to keep > > > DECODE_PARAM and SLICE_PARAM distinct. > > > > > > I would suggest merging both in "SLICE_PARAMS", similarly to what I > > > have proposed for H.265: https://patchwork.kernel.org/patch/10578023/ > > > > > > What do you think? > > > > I don't understand why we add this arbitrary restriction of "all the > > macroblocks to decode one frame". The bitstream may contain multiple > > NALs per frame (e.g. slices), and stateless API shall pass each NAL > > separately imho. The driver can then decide to combine them if needed, > > or to keep them seperate. I would expect most decoder to decode each > > slice independently from each other, even though they write into the > > same frame. > > Well, we sort of always assumed that there is a 1:1 correspondency > between request and output frame when implemeting the software for > cedrus, which simplified both userspace and the driver. The approach we > have taken is to use one of the slice parameters for the whole series > of slices and just append the slice data. > > Now that you bring it up, I realize this is an unfortunate decision. > This may have been the cause of bugs and limitations with our driver > because the slice parameters may very well be distinct for each slice. I might be misunderstanding something, but, at least for the H.264 API, there is no relation between the number of buffers/requests and number of slice parameters. The V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAM is an array, with each element describing each slice in the OUTPUT buffer. So actually, it could be up to the userspace if it want to have 1 OUTPUT buffer per slice or all slices in 1 OUTPUT buffer - the former would have v4l2_ctrl_h264_decode_param::num_slices =3D 1 and only one valid element in V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS. > Moreover, I suppose that just appending the slices data implies that > they are coded in the same order as the picture, which is probably > often the case but certainly not anything guaranteed. Again, at least in the H.264 API being proposed here, the order of slices is not specified by the order of slice data in the buffer. Each entry of the V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS array points to the specific offset within the buffer. Best regards, Tomasz