From patchwork Fri Apr 14 01:55:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 13210833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B011C77B61 for ; Fri, 14 Apr 2023 02:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=As398VmLQx6bZ1NOnps79VzWn46XwnHhjAOUFtV07XI=; b=o/H+EfBHs/OsfR f6auY8/t/DGuiswr32+RuJTtq29+vkKJdINwZ/orQA7WxB+Uf69KteYqV9koJb2XWBoaXmqbjUeQE eZdO8JS7bOLHndAR5tkj2JEbQ0NDocl5ZrFja072vVFD3lwXk+ce22/Hk0vY5NQBv7DkQJUn9Ekm4 ZKDmDjgXRA5vSLIJtK6/YT1vbnkUa3TQUhyPg6C29cL/ciBN1bu2mIqj79ipDzc9H/qLDlep97RMg 5N0TEI7l0oeMv8GyGkUoUsiIaBKPHqH89EYnve6xztCwHsimmCSQAMbuyXzaXKBSSYxvAUitOCLyq xSVYhfL5ACQ+zsByfYXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pn8v5-0085Ut-34; Fri, 14 Apr 2023 02:12:11 +0000 Received: from mail-db8eur05on2062f.outbound.protection.outlook.com ([2a01:111:f400:7e1a::62f] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pn8v3-0085To-1N for linux-arm-kernel@lists.infradead.org; Fri, 14 Apr 2023 02:12:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fi6yQXb0nTcbj+PBbLn21UJbLYQX0AlP+plWNQ6+lm1AllmDsdlx3mT5P5w+K+TIrEWurUTRC02e7h6CpI2qEO0tWbGSaFyQcD8lsqI9yiRg1nJSGaK4xwMS5+df6YlFWb98mamtY9tJkbBw3y0dAe8j8HbaUthS1zN0xKgTtFVf+35azSf0UYp2FqNUUXLIc4C9jLXfAsQTHAr8fcJns2OgItIhHdm/obzcp0eHV8w4pT6KpybexIClcoPcWJ1n95Fsxrlm0C+a+sZImJY3J1HyfNT2NfR5Hu8d923HWGxqayKLM2z3z6MwRD+nGtVLKyg8UIWU6fYI79sh5bdm1A== 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=lnsh4KseqxEHcfXw3FZN7Kh1AFr9UB2RR/wdGTQrsuE=; b=mKeRUYpyE5tuNs+/ASlwyTYnce49CE2H+l4wTookBLVK/VFiRzvfaDiuMc2seU34tKQtB5LYBMPhzzx3KmZPzU6d3Gpl50LQiG9aDt0hsT3tvOP785oQa6JLihZ0T70qfyQxPxKucF2J6YK+6FzSyvY52ff7i9JyfLCFWB5X0cYDpbpwwY91eXIcoEmCuLQRNlAdKXFqe8BP1KPLK8YXSKAbxR/uKgE5I7iMFptH8dVgmQPKX3XBfNfS8JEd7DMRG4pqV/GolqVWpoFu9YndV0eRMMQle/h3wsbDyaoGfqZQm8TkXmY/f9P0E8Wv+ohpLNtOv1R7PriMX+ELiDTQOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lnsh4KseqxEHcfXw3FZN7Kh1AFr9UB2RR/wdGTQrsuE=; b=WvnWTpSmXTVCGXApYn9yLuWsn1aXzGjpWEh9/ceiKSq48ba1gi6malyO0122bhxjlKSNZD2JDLk/wWhBctAlcW+R+GBH73xjuHmhAjgBLimww8agxnrqn6AH/E2SPJ4rq6UN/r73aBmxMnGPyy9w23omFSkxaKOw/HKTqS4T1gw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6346.eurprd04.prod.outlook.com (2603:10a6:10:10c::14) by PA4PR04MB9342.eurprd04.prod.outlook.com (2603:10a6:102:2a6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Fri, 14 Apr 2023 01:56:12 +0000 Received: from DB8PR04MB6346.eurprd04.prod.outlook.com ([fe80::632b:b1a2:25a1:d364]) by DB8PR04MB6346.eurprd04.prod.outlook.com ([fe80::632b:b1a2:25a1:d364%3]) with mapi id 15.20.6298.030; Fri, 14 Apr 2023 01:56:12 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] media: amphion: drop repeated codec data for vc1g format Date: Fri, 14 Apr 2023 09:55:43 +0800 Message-Id: <20230414015543.6580-2-ming.qian@nxp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230414015543.6580-1-ming.qian@nxp.com> References: <20230414015543.6580-1-ming.qian@nxp.com> X-ClientProxiedBy: SI2P153CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::10) To DB8PR04MB6346.eurprd04.prod.outlook.com (2603:10a6:10:10c::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8PR04MB6346:EE_|PA4PR04MB9342:EE_ X-MS-Office365-Filtering-Correlation-Id: 983b9f94-7382-4d6e-6d8c-08db3c8b6c68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MRH+Fb6BaPyIEcQ551Y6xzTzWu7GVA6c1+S11wHnGf54yDMQwWa1L2CKYe8sccYjPYuh7SQEidlJ8520XQR4Umcv1k9KYJp7f3hk7qCeq5EiIFksCXixiYtbRIzugI21L6MeA02+y7u/6Xp233quxcexsUFCMyrbVNsYif/CKPnWWhU9w0DO3Ab+586FmOlp+xfzRKHY9OAgBPMXtI1NauT8Fq3NehRI2kDV6AUnJwg0ZaqxnTfpPWx/rdwXxqIQOnDPNgApifg0VozvyZIR6azeUwWTA7scirlvq6xBI8ovwlLGlTuoJxXmwBZm+yftm9jW71z+xy5DKLNqg0mUB8jWisSbbgvkHcilzYuf0YW3s8r4PcIQI88OEB4wTbTapt3UmH6gMPdpgAjTy3Rlm6BVbbF3E0QToxbxtiqXIu629gV5xT0iyo4zW27VaG4fARQHv6asl6vlnb7U5EzGhID7xwMKrpRGUNkcDyGXFuv+rhwxGwcs53fItdFY4Drkf+Kiounf4jXKNkSN9v3KUEpLXbLBnr3IRpQnRfGlfckV495YBvJAB/hO5PB7X67se4WIb38Ct2mim6Y9pc5DNNhbP3pmQGCD6fPojYSYrz7q0dKguvskyB3o3iJAXtYjruMNMNzIPYKXgUnFR3hcjXxnmSVnauJikO8OPIia238= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR04MB6346.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(396003)(136003)(376002)(39860400002)(451199021)(478600001)(6512007)(52116002)(186003)(26005)(5660300002)(44832011)(6506007)(1076003)(2906002)(316002)(6666004)(4326008)(6486002)(66476007)(66946007)(66556008)(8676002)(8936002)(41300700001)(7416002)(83380400001)(38350700002)(36756003)(2616005)(38100700002)(86362001)(32563001)(357404004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6Zp/Wn5Rj33p/LePTPrh0yDX/wpLZw5G3bbGOxp9hBx9RHtSVVTfRrE3Cw0smeF9kt1kUGl2PyRbTjCsyurAy+1pruQMIhNZp5JbbrdYjaddC5AhjVbXj3OtebD4mmAIxnyL9XLq4u1pd5YZIGsLexw7/ijkdQOpX+VsYY4zq4gxwae7BVoXmXzXi2tt2jbDzOPx3YESpToqAmxJhgP4xQk1M27Fias88F/sYn0Y5p9wb2+Bg30rZ7pcSRCysbtniioR8iv6HnTyg9QW33aIKHpQpvkQF0nqdq4BIpMKUeyotZltGD8glyYfuPHDK0pgUMjyQMFS0bHg25HpDbGxrq+ZyO6biyFMU8u+ksBtdNILP416oVnFX7ysR7utqMoJadLzS5a4GIAnVI7iJ3H7jy60SkfkzpuhO9K1DdxZBqIigqb3i56daHMbvCj79+hEnU4hY0FrWaJOCeO3j/WP9MiLzCdNOx8Cs83SJlgLm2EfFDhJG7eCzoBs6QC0INHsVRQz5ehfngJZHLcNX68mNI739GBFsq/vLG+lz+iL4pSZbxcu1yzc53h3PQ85PiAaEQ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e-6d8c-08db3c8b6c68 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6346.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2023 01:56:12.6196 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RBTVlkROdYGhpezfNs6E+w8vcbkk9Wmk0QBfCE9alte9qcJkkl4KIqslNeln7fZy7dpkhmTaUSk8XRGlfYzkiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9342 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_191209_465409_EE08F7B3 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For format V4L2_PIX_FMT_VC1_ANNEX_G, the separate codec data is required only once. The repeated codec data may introduce some decoding error. so drop the repeated codec data. It's amphion vpu's limitation Fixes: e670f5d672ef ("media: amphion: only insert the first sequence startcode for vc1l format") Signed-off-by: Ming Qian Tested-by: xiahong.bao --- drivers/media/platform/amphion/vpu_malone.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c index e96994437429..c1d6606ad7e5 100644 --- a/drivers/media/platform/amphion/vpu_malone.c +++ b/drivers/media/platform/amphion/vpu_malone.c @@ -1313,6 +1313,15 @@ static int vpu_malone_insert_scode_pic(struct malone_scode_t *scode, u32 codec_i return sizeof(hdr); } +static int vpu_malone_insert_scode_vc1_g_seq(struct malone_scode_t *scode) +{ + if (!scode->inst->total_input_count) + return 0; + if (vpu_vb_is_codecconfig(to_vb2_v4l2_buffer(scode->vb))) + scode->need_data = 0; + return 0; +} + static int vpu_malone_insert_scode_vc1_g_pic(struct malone_scode_t *scode) { struct vb2_v4l2_buffer *vbuf; @@ -1460,6 +1469,7 @@ static const struct malone_scode_handler scode_handlers[] = { }, { .pixelformat = V4L2_PIX_FMT_VC1_ANNEX_G, + .insert_scode_seq = vpu_malone_insert_scode_vc1_g_seq, .insert_scode_pic = vpu_malone_insert_scode_vc1_g_pic, }, {