Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1941727rdb; Tue, 5 Sep 2023 09:22:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdiDQWxewmrOrOxALmoeyF5c9XSb8f7pRe2yI4AFMasScZQFA1+gUGk5/fluPQ3SEBO3oW X-Received: by 2002:a17:906:c144:b0:9a5:83f0:9bc5 with SMTP id dp4-20020a170906c14400b009a583f09bc5mr332203ejc.18.1693930971207; Tue, 05 Sep 2023 09:22:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1693930971; cv=pass; d=google.com; s=arc-20160816; b=QFtCZyeThVXH2vk4+d4hoHgpEfsZieWqgrPpBG9TvQm8Smkrn56v0OpmDjQ9KiiRDO cN8jxtfpDlM8eLyHE49BAXbrHhPABqcjHm8A95fm6zTWNVcv0pPAOGabXI4ZV/+d+Rc+ OT1P0oLEat5Frjuk1NKbwKCDc+JxK4Qff8OgzOi5t2t8B6Y+Z3aZiUxJREX55XyNQe94 SKix0UzjxvZL+8PwSvou+Fz20dQ7xn2QPN8BqIZImatcuSkL91twt53j9i7djwj8w/J2 OKIyWDJbbWtYMs6vmt4sz+My0tVc9Subobt2RE0Vmf9z5471N8XAN1WG28c8ubDA1fPz Qm+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=HKWJMduiRC4y2ewoK46urdz0v0zInnKUEHxNINOAY1U=; fh=G9iTejtOxMpy8CY5YTXcUJ6aLfk8DVZkTizBN54puGo=; b=f7mBx7vAUhRdzTSxgqMRg8pukAtKsTuxQE4qjmtUJm+hkYAjz27P04SAOcOQxT2mTe LUq1jXei7MeCudQHjy8z9bFhvCxzDXfCzaOgRMsCuNy31nBXVjNJsxd6I5fVzaihU+F4 +VtjXfqEFXtMASAcScNrEeiR2pTlnG9bRD0VRDIrNXNidTDqx7/AqF1w9RBGX6r7jcGk k3Uu0I8ubzk3wEbttgp/x8TmGaDUK9jWyQlc+OEMuIuVnYp+HrXN/ZLIJj+XoPiG7+Yq VmKjAqHo2aIasAZWi1Svrq2bUHno9XkHWvWunQaDpGt2pebtHs3yaIi/QcAwQ9amXJrA n5DA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@synaptics.com header.s=selector1 header.b=Dqii9H0t; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ci13-20020a170906c34d00b0099ba3438550si7628612ejb.10.2023.09.05.09.22.46; Tue, 05 Sep 2023 09:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@synaptics.com header.s=selector1 header.b=Dqii9H0t; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245188AbjHaJcp (ORCPT + 8 others); Thu, 31 Aug 2023 05:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbjHaJco (ORCPT ); Thu, 31 Aug 2023 05:32:44 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2088.outbound.protection.outlook.com [40.107.95.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 116E8194; Thu, 31 Aug 2023 02:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wq1kMJHs5Nox3F/1qM4X5QO12DznxztbdG0JIlwlFkDEkaXHlGdz/WDRSdngqk0je3pZONlFtWlEjksL0zB2s1zZT+7htIe7YD/uQCsN1ktFDTmjjjZ7SPzhIomLNFf9elbrLa7w/E7SO32/qgUYjQqQb+Zj/PNI28eZFIojfRF0aq2kBOaqdFKd1aUv73KYyn/zZTOiPKARpnc4ZaxXKjzFi3YsOZY5EK+AUIbDaYx6lclqTINi2tGR76eooJZm/3t/+EwT5LorzFWf8WkYXRmQOG7ol5Q8K69rTNdw6n0Iy6S2jEq5tlv4X+daGA8YmEB/HbdbHTw8UkjMV3+YYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HKWJMduiRC4y2ewoK46urdz0v0zInnKUEHxNINOAY1U=; b=BCRDIi21IFC68trTCuzi8XFnM8mNf/JKkh8sElyVb/dOEtP5HWZd3xEK76rx36Dc5tnX5Q/Oxi6gq4tJi4zYi4wQ//kovqW+oIAZVXKNf4zm7Nh1RAXpFcHJdduvfCGVrpxXTYV7tVzBGfh0Vefe0MOE93tcnkOM9T8cdTdAUezQjL6KCePAc0RGq4/da0ywkhtK4Yp7f9cvYmVQzVwWXxWZ0gebaYCpQkFGc8KmCBAj8zb8UaRVS5/HmUs9XoAVLkmyk6P+BcuIr2TBWu/pQqihGFO+nAIqL/E6jTtQ7H9GL0+nlaOiva96vXz8oD0CsqoYKdyQSK2GENWzME/OWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synaptics.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HKWJMduiRC4y2ewoK46urdz0v0zInnKUEHxNINOAY1U=; b=Dqii9H0tzq/3PpUAPp21R31EAXHWNl1cBijOK/xtZ8Eyy77bJZ/VRHX6TXju7X4Qr9ftRql6TLYdjGDuMyNeay44E+Ip1YI1t5baPQXiPexVLrEX5J1Bs7zPR4/sRKSQLUn05W9hbmcvXklatUYQ7g8jSK2q+tHDehLuMq6q+O8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=synaptics.com; Received: from DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) by SN7PR03MB7231.namprd03.prod.outlook.com (2603:10b6:806:2e7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Thu, 31 Aug 2023 09:32:39 +0000 Received: from DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::411c:e486:3837:cc25]) by DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::411c:e486:3837:cc25%3]) with mapi id 15.20.6745.021; Thu, 31 Aug 2023 09:32:38 +0000 Message-ID: <250358e5-d6bb-1941-8d93-023531626145@synaptics.com> Date: Thu, 31 Aug 2023 17:32:28 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Stateless Encoding uAPI Discussion and Proposal Content-Language: en-GB To: Nicolas Dufresne Cc: Paul Kocialkowski , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Hans Verkuil , Sakari Ailus , Andrzej Pietrasiewicz , Michael Tretter , =?UTF-8?Q?Jernej_=c5=a0krabec?= , Chen-Yu Tsai , Samuel Holland , Thomas Petazzoni , ayaka References: <720c476189552596cbd61dd74d6fa12818718036.camel@collabora.com> <39270c5e-24ab-8ff6-d925-7718b1fef3c4@synaptics.com> <52e9b710-5011-656b-aebf-8d57e6496ddd@synaptics.com> From: Hsia-Jun Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PH8PR22CA0004.namprd22.prod.outlook.com (2603:10b6:510:2d1::19) To DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR03MB5196:EE_|SN7PR03MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 27bedecc-1489-49d7-2907-08dbaa05375b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fx+2tA3OADwyQEFYwRhWGFVALrepfk1Gu9kvoAZb65MQORedXfLHLXnm/09wWxE2xO99p4EyEpFI+56bnfAgSsA1ZhYKb//pw26kCDhnfDrhoyXqBwpdlPfZZVr57NHcIBtu+lE5KIO5kNafUmaAUyIZOWaoluYovIIf6WfYVjvLdUViP8QiAclQfLx8oKZp69GRMMqjROAKRX6mxR5fNFGnOiipdOtu/ziqYReiQqtxXkgEsiJ7fV4lsvBacm+3lCOO22a9ss71ZlBTzEF/XZx+wh7atE22IEMJ0021dE2fbtzTPbS/fIuditFLmq3C25dYBAVbldv+5z34BgVppDQ2wedeQrWTrj2ngmNxF2j2u9ISNtDukrClFCXKt7UzWQXqrWYGM851hjzsudPyqnzcs0OWsX9rSuNVvCiIO/8hxyWznzPxFC84lRYt2DkpU0u8f8eAKAS/Xs64ljJjC7BTUJbHq+7E/AsvZwfzGavrFH0Ytp/6FVW3z3fp9kva3nPM/1zxGq3r77lBgZltizrSUqvvtV7SJFBDAxlC5PN6rhOReCg+FopAYFA2Q9qJrjF+kpC1pxewMzAebAkuZ+Yx+u9Nt6NRlAS76+bEpvrbv2o+bab9O6DlJ1bQ/V95+SkEd+Y6YB54CRsHu1UHYPGCdBH1qAv6UYGfQ3npxUBo7l+XHx3ki+W2/hVKb9rj X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR03MB5196.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(376002)(346002)(396003)(136003)(366004)(186009)(1800799009)(451199024)(66574015)(41300700001)(8936002)(66556008)(8676002)(4326008)(66476007)(478600001)(6666004)(66946007)(6916009)(316002)(6512007)(2616005)(6486002)(6506007)(53546011)(54906003)(52116002)(26005)(2906002)(38350700002)(38100700002)(5660300002)(31696002)(7416002)(36756003)(86362001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OXFKU09iL1FnaFJ6VldmN1Jqa2N4NmN5ekg1aXZYQWpQT3c0ZC9pZDhWWFRy?= =?utf-8?B?TzlqdVFFR2tIdHEyd0FNb2JOQlMrVzEzeWJiZExWZlhVZHVGWUVvNkMwYzk2?= =?utf-8?B?R3pNRXhuSlI5L2Y1N2RQUnVZQ0VDbHhlMm4vd3BZUmh6WS90cE16a0REc1pS?= =?utf-8?B?aW5OdDR3RkJqSXdWTWJ6Uk04SjYwS0ZhT2UrdUtYSDFQMVJ6YjkrZmZhU21Z?= =?utf-8?B?akZrTm9xbWVLVVBFWERqLzdWMUpjamtEQ1NoeVhLZVlkeTRXbnFvcTB0a1ZE?= =?utf-8?B?Mll5cCtSbndscGN2aXdrYjdpNzlZRk9YZlBnZkVqTi9iNHdFSmJIUVBTK1Jk?= =?utf-8?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.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27bedecc-1489-49d7-2907-08dbaa05375b X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB5196.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2023 09:32:38.7005 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JIqm29bbaVb5oFV7LDlJUDWvqjxM6/q2zyM9bHVfad7zK3nf4SVgXnYDAHmuDo8Y+MEaLuVhK1Ekn46UciArgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7231 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/23 23:18, Nicolas Dufresne wrote: > CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe. > > > Le mercredi 23 août 2023 à 11:04 +0800, Hsia-Jun Li a écrit : >>> It was suggested so far to leave h264 slice headers writing to the driver. This >>> is motivated by H264 slice header not being byte aligned in size, so the >> H.264, H.265 has the byte_alignment() in nalu. You don't need skip bits >> feature which could be found in H1. > > As you said so, I rechecked the H.264 grammar. > > ... > slice_header( ) > slice_data( ) > ... > > There is lot of variable size items in the slice_header() syntax and no padding > bits. And no padding at the start of any of the slice_data types. So no, the > slice_header() syntax in H.264 is not byte aligned like you are claiming here. > Its important to be super accurate about these things, as it will cause errors > to be made. Please always double check. To make a summary of the IRC. H.264 and VP8 have no such alignment to byte padding bits. While H.265 has that in 7.3.6.1 General slice segment header syntax. Also, from 6.1 Frame syntax of AV1, I think frame_header_obu contains all the thing that software should prepare for a stateless encoder. VP9 also has the trailing_bits() after uncompressed_header() (6.1 Frame syntax) would meet the byte alignment. We may suggest we could use the hardware write-back or write offset bit functions which could be widely existed due the non-alignment bitstream syntax of the H.264 and VP8. With such a hardware capability, we could save a cache operation than doing that in the kernel. > > Nicolas -- Hsia-Jun(Randy) Li