Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp371128pxa; Fri, 14 Aug 2020 06:41:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPONCDbfHDILKcB35GKoetv3sKSp5fy8mNiXgMZhFpZYYV6Xd5lR3iNexx6l9RFMJm8p2b X-Received: by 2002:a17:906:ce37:: with SMTP id sd23mr2590761ejb.272.1597412491419; Fri, 14 Aug 2020 06:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597412491; cv=none; d=google.com; s=arc-20160816; b=N+NNydDl9jBlLGsqNkf0vwsa95arSEPDMDNCCPhHTck/xzbgtQBPzTKhqienF24LZj EMcS5ieSPZwrnKBHkOqyMkPS+1IKWSJ5YjM9IfrYWx7Jf7LMYDhlMlF2EeRp180/ap+r Jgnz7SyLXPmA/mLstlZUAp+Jx4YArT3RzfHbaVulIgdVo0E4U4UXGebwRVeTY0801O8V shBmuqKdntCG1INScY+G5uz7BGj/zzVOC5Re4nMWs2NestLMw4CwRGB2IMjVFenakCdq 1mYKnleJIiKerX0+xYYyWSFDwJLFc0+91ncgNqzLdtwLv6K4r1pWP1+4o6yC8dzyKYvt RRzw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LylNwi9eFn2Taf1od0ZHBR9HAKuReWDP1NOT9F9C3vo=; b=NT3hY9473PoALWsXaKkJ9ms/KWMCcck6zLKRgvMlKPkvJjsj+N79Dro793hYL6I6oZ ES6HoGENisJW9fA7iQqMaFiCrNg4L+JzXed61pu9jSrcswFXwJwi+9l8qRPPAaMY1FpP 1JXT7/CxcbkDdMLqPTXgkcFcMG7hCsIgr+Ejw8iYPExTUxXdT5olt1I03X7Ho6JnoR0X /s3FH26xaDZFhWgG/4Lj9kOOlXmlfeY+gV+g5x04PmluhF/KZ4A9f015ap4GMDv1NSUV 0kM3KdtXBl+tDImJ/L4/XBm2FL3ON6XoIP+kAdhW00FR963tK8ir88Rcp9BX98ZioAHd OIDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si5259296eds.470.2020.08.14.06.41.08; Fri, 14 Aug 2020 06:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728755AbgHNNhJ (ORCPT + 99 others); Fri, 14 Aug 2020 09:37:09 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43234 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728723AbgHNNhI (ORCPT ); Fri, 14 Aug 2020 09:37:08 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id D906C29A823 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tomasz Figa , kernel@collabora.com, Jonas Karlman , Hans Verkuil , Alexandre Courbot , Jeffrey Kardatzke , Nicolas Dufresne , Philipp Zabel , Maxime Ripard , Paul Kocialkowski , Jernej Skrabec , Ezequiel Garcia Subject: [PATCH v3 05/19] media: uapi: h264: Increase size of 'first_mb_in_slice' field Date: Fri, 14 Aug 2020 10:36:20 -0300 Message-Id: <20200814133634.95665-6-ezequiel@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200814133634.95665-1-ezequiel@collabora.com> References: <20200814133634.95665-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Slice header syntax element 'first_mb_in_slice' can point to the last macroblock, currently the field can only reference 65536 macroblocks which is insufficient for 8K videos. Although unlikely, a 8192x4320 video (where macroblocks are 16x16), would contain 138240 macroblocks on a frame. As per the H264 specification, 'first_mb_in_slice' can be up to PicSizeInMbs - 1, so increase the size of the field to 32-bits. Note that v4l2_ctrl_h264_slice_params struct will be modified in a follow-up commit, and so we defer its 64-bit padding. Signed-off-by: Ezequiel Garcia --- Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 2 +- include/media/h264-ctrls.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 32f3cebf16e5..714a8d9ae6a0 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -1774,7 +1774,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - * - __u32 - ``header_bit_size`` - - * - __u16 + * - __u32 - ``first_mb_in_slice`` - * - __u8 diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h index d995614be159..9ff085fdc9ab 100644 --- a/include/media/h264-ctrls.h +++ b/include/media/h264-ctrls.h @@ -174,7 +174,8 @@ struct v4l2_ctrl_h264_slice_params { /* Offset in bits to slice_data() from the beginning of this slice. */ __u32 header_bit_size; - __u16 first_mb_in_slice; + __u32 first_mb_in_slice; + __u8 slice_type; __u8 pic_parameter_set_id; __u8 colour_plane_id; -- 2.27.0