Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp929624imm; Thu, 4 Oct 2018 05:47:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60evZJrxdPOfE+jGXy8dwifPo7khKMFiOtyZuZN1TQjuV0nj/Px4E+AGk4x7udqiilHuUxK X-Received: by 2002:a63:7506:: with SMTP id q6-v6mr5578734pgc.137.1538657263489; Thu, 04 Oct 2018 05:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538657263; cv=none; d=google.com; s=arc-20160816; b=ccEhTmbl1GzOFDgOY5sm24C2+ml7zl+7+HadN3N/H779o2W3e7TCUXxh05bOmglr/r cn66ewBpTRSAHvNhi5gGXWo8WOqsvOQVjKbadS5B8hc/qembz7W5rerNnZRq/9iBxmE5 cWbubcI42UEdIDWZY7Hh0vjbLRa86MAn1uB2Xnt/sIycJNovPOtzvMPPXNDE783ly4O0 lQILrlay/ADYBLNOQHHLkeXYXGoUezx0ROT4hEcnzXHGD5aRrITTb5lzhoECpbxQR8oJ mzXkKHgADp3Z5lh6SvUbNpH+HkBWCluxhv8Z6fpTFf0KOU5PbaP1021vIw55QzwtYoNB Pe1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=k8ZXFR4Ir6fTs9PwsTIklnSK4ae4hZMctBevCWuotxQ=; b=iee47Vl+uAVxnztKj4pmmf5ZyVKmpmrHwFMcU2lCgwaaHQoAxGgs++jfOcpy5YiQeD 0DDWUuYKG4ZcQHHfwKZvw/w95WzyZlpz7DRsyVkYGNvQYHrSOn5aK1soq5udXRGuN1uu Pp96vPjKehf6cSt7+UcVfkksA010V9CFTMBRURdOlua2nNSgD9MBFhiT7GqgsJ4pNvtE 6QEI1L3KiY3k3320AnhCwn+fHbQCbEKX8Jkpd7P4NEwhPs129VfqhFlDzFz/Su1i9kWT YRGUaZ/+b2EbXVfhHEi1varlP4PZuTqLlbf/uNNDFQq0GQHC15wIogBfx/IaMUWdKztX yeAQ== 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 r15-v6si4948088pgh.88.2018.10.04.05.47.27; Thu, 04 Oct 2018 05:47:43 -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; 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 S1727486AbeJDTkB (ORCPT + 99 others); Thu, 4 Oct 2018 15:40:01 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:32902 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeJDTkB (ORCPT ); Thu, 4 Oct 2018 15:40:01 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 01E53BFDF8; Thu, 4 Oct 2018 14:46:51 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 6E7EEC0FE9; Thu, 4 Oct 2018 14:46:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.1 Received: from collins (unknown [192.168.1.1]) by gagarine.paulk.fr (Postfix) with ESMTPSA id 58D06C0C7A; Thu, 4 Oct 2018 14:46:48 +0200 (CEST) Message-ID: Subject: Re: [RFC PATCH v2] media: docs-rst: Document m2m stateless video decoder interface From: Paul Kocialkowski To: Alexandre Courbot , Tomasz Figa , Mauro Carvalho Chehab , Hans Verkuil , Pawel Osciak , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Date: Thu, 04 Oct 2018 14:47:15 +0200 In-Reply-To: <20181004081119.102575-1-acourbot@chromium.org> References: <20181004081119.102575-1-acourbot@chromium.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-l7yD+FRf9c6VTMlKiqgB" User-Agent: Evolution 3.30.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-l7yD+FRf9c6VTMlKiqgB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Here are a few minor suggestion about H.264 controls. Le jeudi 04 octobre 2018 =C3=A0 17:11 +0900, Alexandre Courbot a =C3=A9crit= : > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documen= tation/media/uapi/v4l/extended-controls.rst > index a9252225b63e..9d06d853d4ff 100644 > --- a/Documentation/media/uapi/v4l/extended-controls.rst > +++ b/Documentation/media/uapi/v4l/extended-controls.rst > @@ -810,6 +810,31 @@ enum v4l2_mpeg_video_bitrate_mode - > otherwise the decoder expects a single frame in per buffer. > Applicable to the decoder, all codecs. > =20 > +.. _v4l2-mpeg-h264: > + > +``V4L2_CID_MPEG_VIDEO_H264_SPS`` > + Instance of struct v4l2_ctrl_h264_sps, containing the SPS of to use = with > + the next queued frame. Applicable to the H.264 stateless decoder. > + > +``V4L2_CID_MPEG_VIDEO_H264_PPS`` > + Instance of struct v4l2_ctrl_h264_pps, containing the PPS of to use = with > + the next queued frame. Applicable to the H.264 stateless decoder. > + > +``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX`` For consistency with MPEG-2 and upcoming JPEG, I think we should call this "H264_QUANTIZATION". > + Instance of struct v4l2_ctrl_h264_scaling_matrix, containing the sca= ling > + 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 least as m= any > + entries as there are slices in the corresponding ``OUTPUT`` buffer. > + 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 state= less > + decoder. Since we require all the macroblocks to decode one frame to be held in 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? Cheers, Paul > ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)`` > Enable writing sample aspect ratio in the Video Usability > Information. Applicable to the H264 encoder. > diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst b/Documen= tation/media/uapi/v4l/pixfmt-compressed.rst > index a86b59f770dd..a03637fda8f9 100644 > --- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst > +++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst > @@ -35,6 +35,42 @@ Compressed Formats > - ``V4L2_PIX_FMT_H264`` > - 'H264' > - H264 video elementary stream with start codes. > + * .. _V4L2-PIX-FMT-H264-SLICE: > + > + - ``V4L2_PIX_FMT_H264_SLICE`` > + - 'H264' > + - H264 parsed slice data, as extracted from the H264 bitstream. > + This format is adapted for stateless video decoders using the M2= M and > + Request APIs. > + > + ``OUTPUT`` buffers must contain all the macroblock slices of a g= iven > + frame, i.e. if a frame requires several macroblock slices to be = entirely > + decoded, then all these slices must be provided. In addition, th= e > + following metadata controls must be set on the request for each = frame: > + > + V4L2_CID_MPEG_VIDEO_H264_SPS > + Instance of struct v4l2_ctrl_h264_sps, containing the SPS of = to use > + with the frame. > + > + V4L2_CID_MPEG_VIDEO_H264_PPS > + Instance of struct v4l2_ctrl_h264_pps, containing the PPS of = to use > + with the frame. > + > + V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX > + Instance of struct v4l2_ctrl_h264_scaling_matrix, containing = the > + scaling matrix to use when decoding the frame. > + > + V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAM > + Array of struct v4l2_ctrl_h264_slice_param, containing at lea= st as > + many entries as there are slices in the corresponding ``OUTPU= T`` > + buffer. > + > + V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAM > + Instance of struct v4l2_ctrl_h264_decode_param, containing th= e > + high-level decoding parameters for a H.264 frame. > + > + See the :ref:`associated Codec Control IDs ` for= the > + format of these controls. > * .. _V4L2-PIX-FMT-H264-NO-SC: > =20 > - ``V4L2_PIX_FMT_H264_NO_SC`` > @@ -67,10 +103,20 @@ Compressed Formats > - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream= . > This format is adapted for stateless video decoders that implement a > MPEG-2 pipeline (using the Memory to Memory and Media Request APIs). > - Metadata associated with the frame to decode is required to be passed > - through the ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS`` control and > - quantization matrices can optionally be specified through the > - ``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION`` control. > + > + ``OUTPUT`` buffers must contain all the macroblock slices of a g= iven > + frame, i.e. if a frame requires several macroblock slices to be = entirely > + decoded, then all these slices must be provided. In addition, th= e > + following metadata controls must be set on the request for each = frame: > + > + V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS > + Slice parameters (one per slice) for the current frame. > + > + Optional controls: > + > + V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION > + Quantization matrices for the current frame. > + > See the :ref:`associated Codec Control IDs `. > Buffers associated with this pixel format must contain the appropriate > number of macroblocks to decode a full corresponding frame. --=20 Developer of free digital technology and hardware support. Website: https://www.paulk.fr/ Coding blog: https://code.paulk.fr/ Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/ --=-l7yD+FRf9c6VTMlKiqgB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEAbcMXZQMtj1fphLChP3B6o/ulQwFAlu2C9MACgkQhP3B6o/u lQyF8g/7BcJzpArDhXm3SdS567/6MloaMKK6coAlzMCGLKNJ5K4ncI8FxHhuPVHa UKRgxVFC1tHSleBRBCx35g8Nzf2TA9DTmlz/9gOP6/3jnQtznIB2kcrlGeZlKgxx L+gtjy3HNJwhiofw+i22e/GDRp41udey9zlZgbk95tgufovhMRy9VwUQH9mLICh2 x/jw4tVpkinvlaksCZsKKFNIdRhSS//UTn8tvUxQ9AUAgVndTCDumzpwxAkY8YyU jZ1f3cqOZd998huACwzGsd4FBXmulhTAr0kHh29mQ4Nq93BvvAvebaIf1VI6jaol WyoihZa+MdsGZKWSIK1BYzmURqGjCcfsvG8idndwf0jhGD61FnEi8PwSmw5Ntabf rnojKCJFNogGrd4gBiwoOtLNUccpqFFpGB//fJxQtTz/FZDxHhUkO5LnbbwdGTlK b2lZQU3v4cv5Sxipkc9g/UhpU4AMujF+61H7fXAITHrfRycJCXuF9wHSenIeMDqt S0UbY6apLod3E7UVaK8wH9qHwI3D5qJ4KKgWeK4PyBg8j0/k/kDvkQ3497h0S0X9 Ltpn616vZepxdlwqxp8KsTFmsBkqJMyvQ8KObUihf99FipAr9P41hZb1AqkYTgBG 853GfpTPOIkP7v+c3atdGbJXdgL1kHrXpCvunSDuA+uN4v/qSDU= =1x/v -----END PGP SIGNATURE----- --=-l7yD+FRf9c6VTMlKiqgB--