Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1183954yba; Thu, 4 Apr 2019 06:02:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB53Yewt7mI0ULiUVdNwjcRnmLi/SOrRUQyUR9t1UHuxEzsDdjeVAfyVxdsfCqa7WHCgp0 X-Received: by 2002:a63:df43:: with SMTP id h3mr5861628pgj.294.1554382922105; Thu, 04 Apr 2019 06:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554382922; cv=none; d=google.com; s=arc-20160816; b=kDOI0q72gBwKePe8pqmBiUra+MFGqJmOLvBMjmEbAg8m/dZyzL2atxXGC2BR/ayIq/ yEWCB3RHrCqSDcmd4CbSjxsWe29vWxJYb3deDgiIZ6EDzxEhfhbyQggGuhyioaT4D4H+ wDzuBJsnBIn4Fs3l3recVTNwqwc2x2tLYRCjGI1Mhh8+sokgN1M3gRG5zvyWWUW1TY1g 5mdzgLl+SG5SytJ9PmgWS7H7pZ0eCrA1EFX9dM1PHR8iGkeC9+/LTHKoOFkzsh8mbjOV ATyaYaPTITueLM7cmGmRE/n3wlcwe6p3AMK1rz8nFAJhBMZnLgpEpa4DvUH+Et5S3jns 1h9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NnoQXOk98mUw/zU+LHAe8k8yy8pprlhhfEKmVQVVBjo=; b=ltmubJrlsysrARkCDf/WK5YA4EH22Q/wBq8UrxwFPVSaIpV/0MWMwwbDw7TegS26gH o/OFI8GpltYemGRdYW5YR54k6HPxOz/fgguwm2fnalgBS66igEz3mKvlly0aVmO+nKUa I47WzNR91n4dXCS2vYnA6E+Qn3Yy7kvBMDfgHjDN/hAaBdCrpxP01Yqj/PLp3HKlkA5d YPlMkmTFrrbMJvfg9W1JEqlWZIXHWzCWTrjGbMj+LTeViz6+A4OraxYtNLoUhq3uxlGC mAgkDuzYIRYBvAXqq0MEgRkSrYsAh6KusE1shv1jzqYMm5delS/3QMntfPcRRU00cOwx 0M1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FPK+hTHm; 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 h13si17236222pgr.133.2019.04.04.06.01.44; Thu, 04 Apr 2019 06:02:02 -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=FPK+hTHm; 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 S1728879AbfDDNBF (ORCPT + 99 others); Thu, 4 Apr 2019 09:01:05 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:40845 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbfDDNBF (ORCPT ); Thu, 4 Apr 2019 09:01:05 -0400 Received: by mail-ot1-f67.google.com with SMTP id t8so2219834otp.7 for ; Thu, 04 Apr 2019 06:01:04 -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; bh=NnoQXOk98mUw/zU+LHAe8k8yy8pprlhhfEKmVQVVBjo=; b=FPK+hTHmgyZYalgoT9WI9CBxCJQY5Ja9ggM8B/WRJVVqJBb8BdFZJxJLCLsZsFuxrU D7gkiuLpVMaaA7fVjG2Z2WWQMITm+x4L93ICOFO5aukSiV5sUmxerlfOc4c7usbbSXDs Ae3tGTf9qaaZsk2xRupqXuXb9pKcJIkQBey7Q= 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; bh=NnoQXOk98mUw/zU+LHAe8k8yy8pprlhhfEKmVQVVBjo=; b=diKbsC4osn1dNelHUZISkOrhWbd6LV8GXo+AwMYapNAm8kdgLdl6uDKSdWtREBCOTT jv0oa2Wst7T/pETKWMAcBck9wPiobIiwZiDPnDh/ZRQ1T0u48LGGYvUEfMpkFD4Uflzo qjvIDysG2Jm9TWS9kGzqTAz3hsoTwV9ATYBaHn8YalZ6WprfkJI3YzBrAaKkTANyjg54 tEmNLhLGsBfGxolqRvuWj6j4bSScPC34aj/36QHRTsFl3lhNlqztR58LfJQFA7RDgcJB mbZpU2HV7aPQAUA0+q98UyJfClH3hEoA4Ecy57x8oCuZL07dmqRYdA9oZu/qfzbBO8PZ H0MA== X-Gm-Message-State: APjAAAVxpOlNZ4/FdZy2mpm0TZt1Uvi/X8lktKLVWxsMWBNJmX3a5guR iVTJfL+a3AYOh6GI2nN/A0Uk+uNamhY= X-Received: by 2002:a9d:5d0b:: with SMTP id b11mr4144739oti.80.1554382864125; Thu, 04 Apr 2019 06:01:04 -0700 (PDT) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com. [209.85.210.43]) by smtp.gmail.com with ESMTPSA id a198sm7913763oib.19.2019.04.04.06.01.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 06:01:03 -0700 (PDT) Received: by mail-ot1-f43.google.com with SMTP id t8so2219779otp.7 for ; Thu, 04 Apr 2019 06:01:03 -0700 (PDT) X-Received: by 2002:a9d:7749:: with SMTP id t9mr3886832otl.229.1554382482715; Thu, 04 Apr 2019 05:54:42 -0700 (PDT) MIME-Version: 1.0 References: <7cd913545cfc80fa9999839c62c4bf7b354a7904.1554380738.git-series.maxime.ripard@bootlin.com> In-Reply-To: <7cd913545cfc80fa9999839c62c4bf7b354a7904.1554380738.git-series.maxime.ripard@bootlin.com> From: Tomasz Figa Date: Thu, 4 Apr 2019 21:54:30 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND v7 1/2] media: uapi: Add H264 low-level decoder API compound controls. To: Maxime Ripard , Hans Verkuil , Alexandre Courbot Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Apr 4, 2019 at 9:26 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 from > the userspace to the kernel. > > Reviewed-by: Tomasz Figa > Signed-off-by: Pawel Osciak > Signed-off-by: Guenter Roeck > Co-developed-by: Maxime Ripard > Signed-off-by: Maxime Ripard > --- > Documentation/media/uapi/v4l/biblio.rst | 9 +- > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 569 ++++++++++++++- > Documentation/media/uapi/v4l/pixfmt-compressed.rst | 19 +- > Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 30 +- > Documentation/media/videodev2.h.rst.exceptions | 5 +- > drivers/media/v4l2-core/v4l2-ctrls.c | 42 +- > drivers/media/v4l2-core/v4l2-ioctl.c | 1 +- > include/media/h264-ctrls.h | 192 +++++- > include/media/v4l2-ctrls.h | 13 +- > include/uapi/linux/videodev2.h | 1 +- > 10 files changed, 880 insertions(+), 1 deletion(-) > create mode 100644 include/media/h264-ctrls.h > > diff --git a/Documentation/media/uapi/v4l/biblio.rst b/Documentation/media/uapi/v4l/biblio.rst > index ec33768c055e..8f4eb8823d82 100644 > --- a/Documentation/media/uapi/v4l/biblio.rst > +++ b/Documentation/media/uapi/v4l/biblio.rst > @@ -122,6 +122,15 @@ ITU BT.1119 > > :author: International Telecommunication Union (http://www.itu.ch) > > +.. _h264: > + > +ITU-T Rec. H.264 Specification (04/2017 Edition) > +================================================ > + > +:title: ITU-T Recommendation H.264 "Advanced Video Coding for Generic Audiovisual Services" > + > +:author: International Telecommunication Union (http://www.itu.ch) > + > .. _jfif: > > JFIF > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > index 67a122339c0e..1285bfec7d3d 100644 > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > @@ -1371,6 +1371,575 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > - Layer number > > > +.. _v4l2-mpeg-h264: > + > +``V4L2_CID_MPEG_VIDEO_H264_SPS (struct)`` > + Specifies the sequence parameter set (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`, section 7.4.2.1.1 "Sequence Parameter Set Data > + Semantics". For further documentation, refer to the above > + specification, unless there is an explicit comment stating > + otherwise. > + > + .. note:: > + > + This compound control is not yet part of the public kernel API and > + it is expected to change. > + > +.. c:type:: v4l2_ctrl_h264_sps > + > +.. cssclass:: longtable > + > +.. flat-table:: struct v4l2_ctrl_h264_sps > + :header-rows: 0 > + :stub-columns: 0 > + :widths: 1 1 2 > + > + * - __u8 > + - ``profile_idc`` > + - > + * - __u8 > + - ``constraint_set_flags`` > + - See :ref:`Sequence Parameter Set Constraints Set Flags ` > + * - __u8 > + - ``level_idc`` > + - > + * - __u8 > + - ``seq_parameter_set_id`` > + - > + * - __u8 > + - ``chroma_format_idc`` > + - > + * - __u8 > + - ``bit_depth_luma_minus8`` > + - > + * - __u8 > + - ``bit_depth_chroma_minus8`` > + - > + * - __u8 > + - ``log2_max_frame_num_minus4`` > + - > + * - __u8 > + - ``pic_order_cnt_type`` > + - > + * - __u8 > + - ``log2_max_pic_order_cnt_lsb_minus4`` > + - > + * - __u8 > + - ``max_num_ref_frames`` > + - > + * - __u8 > + - ``num_ref_frames_in_pic_order_cnt_cycle`` > + - > + * - __s32 > + - ``offset_for_ref_frame[255]`` > + - > + * - __s32 > + - ``offset_for_non_ref_pic`` > + - > + * - __s32 > + - ``offset_for_top_to_bottom_field`` > + - > + * - __u16 > + - ``pic_width_in_mbs_minus1`` > + - > + * - __u16 > + - ``pic_height_in_map_units_minus1`` > + - We recently had some reflection with Alex that this is redundant with the width and height in the OUTPUT format. It may also apply to some other fields in these structs. I feel like they should be removed and passed via corresponding generic V4L2 properties - format, selection, etc. The same problem is also present in the MPEG2 controls. In fact, there was a patch already which used some fields from the controls to calculate the destination buffer strides, rather than bytesperline in the format. Since we're in staging, it could be done with a follow-up patch, though. Best regards, Tomasz