Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3200353imb; Tue, 5 Mar 2019 03:33:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxgQ787hVWYsXh34CO165Nqtp94P61sX3rsls29AcI7IOl+dazVPTZnc50sm1HZm/i0KOBw X-Received: by 2002:a63:6a88:: with SMTP id f130mr1014607pgc.114.1551785629952; Tue, 05 Mar 2019 03:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551785629; cv=none; d=google.com; s=arc-20160816; b=aW3XhQePhLCIAJ0Z1gaaHm8u+dGz57M7hJwkSyjwjvblB8Ah1ysLxK0Pjn0sOtEzvk xQlKxmmvEyJfloTK+nUeVHr7wnVf1og3rcDE4ybWph5Tf1ROGUtSMQYoFiQAAaBdZDL+ oEr0j/sqcKyrRZxvjzQPEU5E3o8GlRp+jGq6zJiGhYqA8E7sRyZeZG1feZZFLoqQ/pqn 76lTCPQJFXYVH+fOF+AQkDw43MV5TJm3PMD7p8un/WCo8EzGTmntTmWXGZhQdT+z5bXn Z//widDHogDhYLtFDTBEngfnz7s5zu+5I7TTjfxY9Ak9C+3jO0hRJd+bSi2lKKXD67rC HFgg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PcZoet2c9Dp4TCimR84e/UuVjWtKzeFY8AxKzE21d+Y=; b=Ev5oNckFsfZbraRMHwUcYbiv0ocPXhPmyx2sCQttJ3y2RyowP9kAl5ejkKsCakfXQI vIhEOXQJicS6WteEpSRMC6YkW6jZskkYwgrn/1cL1eWfsX0sd/x8jv4oJgQxQTodw9+X eUyAN6rW/6ueMgHcMzWJfzQdGZeQH6Ln4lcW0j+coZnFvNnFZ6bguqlShGVxTFCZk4k6 mw+kVhpku2WDV1iLa1w27CwhCZwuO/dji3aNC7aC7tDGsIJahzv14wBFMIQ4nAJ9yCJM cWpMJ6dNR0yC2FzdGBZUrBsa3OByahla+Bdf0TXLlP5zniTd1LO0Q/Qg5NTt6uqomhQY Bhrg== 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 r16si3301193pfd.266.2019.03.05.03.33.34; Tue, 05 Mar 2019 03:33:49 -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 S1727712AbfCELQc (ORCPT + 99 others); Tue, 5 Mar 2019 06:16:32 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:57133 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727424AbfCELQb (ORCPT ); Tue, 5 Mar 2019 06:16:31 -0500 X-Originating-IP: 90.88.147.150 Received: from localhost (aaubervilliers-681-1-27-150.w90-88.abo.wanadoo.fr [90.88.147.150]) (Authenticated sender: maxime.ripard@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id DEFFD4000E; Tue, 5 Mar 2019 11:16:25 +0000 (UTC) Date: Tue, 5 Mar 2019 12:16:25 +0100 From: Maxime Ripard To: Tomasz Figa Cc: Hans Verkuil , Alexandre Courbot , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Paul Kocialkowski , Chen-Yu Tsai , Linux Kernel Mailing List , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Media Mailing List , Nicolas Dufresne , jenskuske@gmail.com, Jernej Skrabec , Jonas Karlman , Ezequiel Garcia , linux-sunxi@googlegroups.com, Thomas Petazzoni , Guenter Roeck Subject: Re: [PATCH v4 1/2] media: uapi: Add H264 low-level decoder API compound controls. Message-ID: <20190305111625.or44y4k7or25v44s@flea> References: <9817c9875638ed2484d61e6e128e2551cf3bda4c.1550672228.git-series.maxime.ripard@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uuwvzyhdb64wixaa" Content-Disposition: inline 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 --uuwvzyhdb64wixaa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 22, 2019 at 04:46:17PM +0900, Tomasz Figa wrote: > Hi Maxime, >=20 > On Wed, Feb 20, 2019 at 11:17 PM Maxime Ripard > wrote: > > > > From: Pawel Osciak > > > > Stateless video codecs will require both the H264 metadata and slices in > > order to be able to decode frames. > > > > This introduces the definitions for a new pixel format for H264 slices = that > > have been parsed, as well as the structures used to pass the metadata f= rom > > the userspace to the kernel. > > > > Co-Developped-by: Maxime Ripard > > Signed-off-by: Pawel Osciak > > Signed-off-by: Guenter Roeck > > Signed-off-by: Maxime Ripard >=20 > Thanks for the patch. Some comments inline. >=20 > [snip] > > +``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS (struct)`` > > + Specifies the slice parameters (as extracted from the bitstream) > > + for the associated H264 slice data. This includes the necessary > > + parameters for configuring a stateless hardware decoding pipeline > > + for H264. The bitstream parameters are defined according to > > + :ref:`h264`. Unless there's a specific comment, refer to the > > + specification for the documentation of these fields, section 7.4.3 > > + "Slice Header Semantics". >=20 > Note that this is expected to be an array, with entries for all the > slices included in the bitstream buffer. >=20 > > + > > + .. note:: > > + > > + This compound control is not yet part of the public kernel API = and > > + it is expected to change. > > + > > +.. c:type:: v4l2_ctrl_h264_slice_param > > + > > +.. cssclass:: longtable > > + > > +.. flat-table:: struct v4l2_ctrl_h264_slice_param > > + :header-rows: 0 > > + :stub-columns: 0 > > + :widths: 1 1 2 > > + > > + * - __u32 > > + - ``size`` > > + - > > + * - __u32 > > + - ``header_bit_size`` > > + - > > + * - __u16 > > + - ``first_mb_in_slice`` > > + - > > + * - __u8 > > + - ``slice_type`` > > + - > > + * - __u8 > > + - ``pic_parameter_set_id`` > > + - > > + * - __u8 > > + - ``colour_plane_id`` > > + - > > + * - __u8 > > + - ``redundant_pic_cnt`` > > + - > > + * - __u16 > > + - ``frame_num`` > > + - > > + * - __u16 > > + - ``idr_pic_id`` > > + - > > + * - __u16 > > + - ``pic_order_cnt_lsb`` > > + - > > + * - __s32 > > + - ``delta_pic_order_cnt_bottom`` > > + - > > + * - __s32 > > + - ``delta_pic_order_cnt0`` > > + - > > + * - __s32 > > + - ``delta_pic_order_cnt1`` > > + - > > + * - struct :c:type:`v4l2_h264_pred_weight_table` > > + - ``pred_weight_table`` > > + - > > + * - __u32 > > + - ``dec_ref_pic_marking_bit_size`` > > + - > > + * - __u32 > > + - ``pic_order_cnt_bit_size`` > > + - > > + * - __u8 > > + - ``cabac_init_idc`` > > + - > > + * - __s8 > > + - ``slice_qp_delta`` > > + - > > + * - __s8 > > + - ``slice_qs_delta`` > > + - > > + * - __u8 > > + - ``disable_deblocking_filter_idc`` > > + - > > + * - __s8 > > + - ``slice_alpha_c0_offset_div2`` > > + - > > + * - __s8 > > + - ``slice_beta_offset_div2`` > > + - > > + * - __u8 > > + - ``num_ref_idx_l0_active_minus1`` > > + - > > + * - __u8 > > + - ``num_ref_idx_l1_active_minus1`` > > + - > > + * - __u32 > > + - ``slice_group_change_cycle`` > > + - > > + * - __u8 > > + - ``ref_pic_list0[32]`` > > + - > > + * - __u8 > > + - ``ref_pic_list1[32]`` > > + - >=20 > Should we explicitly document that these are the lists after applying > the per-slice modifications, as opposed to the original order from > v4l2_ctrl_h264_decode_param? >=20 > [snip] > > + * .. _V4L2-PIX-FMT-H264-SLICE: > > + > > + - ``V4L2_PIX_FMT_H264_SLICE`` > > + - 'S264' > > + - H264 parsed slice data, as extracted from the H264 bitstream. > > + This format is adapted for stateless video decoders that > > + implement an H264 pipeline (using the :ref:`codec` and > > + :ref:`media-request-api`). Metadata associated with the frame > > + to decode are required to be passed through the > > + ``V4L2_CID_MPEG_VIDEO_H264_SPS``, > > + ``V4L2_CID_MPEG_VIDEO_H264_PPS``, > > + ``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS`` and > > + ``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS`` controls and > > + scaling matrices can optionally be specified through the > > + ``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX`` control. See the > > + :ref:`associated Codec Control IDs `. > > + Exactly one output and one capture buffer must be provided for > > + use with this pixel format. The output buffer must contain the > > + appropriate number of macroblocks to decode a full > > + corresponding frame to the matching capture buffer. >=20 > What does it mean that a control can be optionally specified? A > control always has a value, so how do we decide that it was specified > or not? Should we have another control (or flag) that selects whether > to use the control? How is it better than just having the control > initialized with the default scaling matrix and always using it? Ok, I'll change it. > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videod= ev2.h > > index 9a920f071ff9..6443ae53597f 100644 > > --- a/include/uapi/linux/videodev2.h > > +++ b/include/uapi/linux/videodev2.h > > @@ -653,6 +653,7 @@ struct v4l2_pix_format { > > #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 = with start codes */ > > #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H26= 4 without start codes */ > > #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 = MVC */ > > +#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H26= 4 parsed slices */ >=20 > Are we okay with adding here already, without going through staging first? This is what we did for MPEG-2 already (the format is public but the controls are not), so I'm not sure this is causing any issue. Thanks! Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --uuwvzyhdb64wixaa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXH5aiQAKCRDj7w1vZxhR xQaDAPwIoVWR1TeT+e5bf+LEb/U2rgJXDTwx9jFMhcytq2st5AEAmizIpWf0N2Yg FG30mptGQpK4Z+e3nj9EK8Z5VcL3Qwg= =mZv8 -----END PGP SIGNATURE----- --uuwvzyhdb64wixaa--