Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3078EC48BD6 for ; Wed, 26 Jun 2019 11:23:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 109A32080C for ; Wed, 26 Jun 2019 11:23:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbfFZLXU (ORCPT ); Wed, 26 Jun 2019 07:23:20 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:56837 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbfFZLXU (ORCPT ); Wed, 26 Jun 2019 07:23:20 -0400 X-Originating-IP: 86.250.200.211 Received: from aptenodytes (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 7B06920002; Wed, 26 Jun 2019 11:23:08 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 1/3] media: uapi: h264: Clarify our expectations regarding NAL header format From: Paul Kocialkowski To: Boris Brezillon , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Sakari Ailus , linux-media@vger.kernel.org Cc: Tomasz Figa , Nicolas Dufresne , kernel@collabora.com, Maxime Ripard , Ezequiel Garcia , Jonas Karlman , Jernej Skrabec , Alexandre Courbot , Thierry Reding Date: Wed, 26 Jun 2019 13:23:08 +0200 In-Reply-To: <20190610085250.3255-2-boris.brezillon@collabora.com> References: <20190610085250.3255-1-boris.brezillon@collabora.com> <20190610085250.3255-2-boris.brezillon@collabora.com> Organization: Bootlin Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi, On Mon, 2019-06-10 at 10:52 +0200, Boris Brezillon wrote: > Looks like some stateless decoders expect slices to be prefixed with > ANNEX B start codes (they most likely do some kind of bitstream parsing > and/or need that to delimit slices when doing per frame decoding). > Since skipping those start codes for dummy stateless decoders (those > expecting all params to be passed through controls) should be pretty > easy, let's mandate that all slices be prepended with ANNEX B start > codes. > > If we ever need to support AVC headers, we can add a new menu control > to select the type of NAL header to use. > > Signed-off-by: Boris Brezillon Looks good to me: Reviewed-by: Paul Kocialkowski Cheers, Paul > --- > Changes in v2: > * None > > Note: we might want to add a nal_header_size field to allow drivers to > quickly find where the actual payload start. That'd be particularly > useful here since ANNEX B start codes can be of arbitrary size > (2+(0x00 bytes) + 1(0x01 byte)). The other option would be to enforce > the number of leading 0x00 bytes (a minimum of 2 is required). > --- > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > index d6ea2ffd65c5..82547d5de250 100644 > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > @@ -1726,6 +1726,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > :ref:`h264`, section 7.4.3 "Slice Header Semantics". For further > documentation, refer to the above specification, unless there is > an explicit comment stating otherwise. > + All slices should be prepended with an ANNEX B start code. > > .. note:: > -- Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com