From patchwork Fri Oct 25 03:31:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Hou X-Patchwork-Id: 21749 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id BBDDDC3213 for ; Fri, 25 Oct 2024 03:31:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0A0CA6538A; Fri, 25 Oct 2024 05:31:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="Onhaq9MP"; dkim-atps=neutral Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f403:2607::60e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E91860366 for ; Fri, 25 Oct 2024 05:31:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TqCSeg6w/6ypQ7s5pQklRipZj7vO7ZgaEiKMyqzxkJRrCh79NebZrjqU7rSxReGJi3ytJP+2O1Xmb5U2zRa+Uyp/l0n8k4DkKc1GSB3nXkx5DR7AV2K94fnDAggqD6M3lboF8FHX1dndIgOdkvKoQql46+D1yX2OwIbHbedLThFunPF6Uyab76O96CRQMjzXbIF9myOYMJ1Y7d9S10sHm2+UA84ezh8rQAUxs1CeIJWJ4yiKM+PCqN+8ezkDprtGHUiAQwegKOcKqe3eoElSU4c/uG/LfrUeFTLX/uiPlxconlDZ7UsM/eDjCm851k9aFy3gaLeVBS8lkjQaecaFJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Qb/sU/i9E6QWUUDqfpKitybQJmpEis7r2GcRpJL+RDs=; b=WteXf6nrOAavQHYItdZY3mr4L8UUnhbbWv75jlpbzHGS4RahENczzhWauitGf4ED03820uU8F6+Tt5kM5vpstV1cGs3z5alPDZPsd1W2iQv7L6svcI7q+jmndPMU7VUu4dnri7i0FuPKSYHLwcShB3/1lqat/jS5j9Q5BrTbeNDB5w4XmA4sdCs2CbF6kwQQkSRYbvH3wGLRHTdtRqwVLZU0d20MiVhcPbrlvmIC83yda6XRVRjOGiA+eoMmgS5U0wm+/+pZniSoRVlqpj3nP8/drIIv5Dk85JrQ/0YHuRHAiHmvNzkcnWz4phOLj0mtoX1BsYhrEHQ8ZNgKtjYYMA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qb/sU/i9E6QWUUDqfpKitybQJmpEis7r2GcRpJL+RDs=; b=Onhaq9MPTOpSk06uhcfXdzq1736wx04/WOp3KGuAhE06OUVhHXmu1K4PYiLi3nhOn9QIsYlEyOE/TH76Zzg4xpEbX9Dx2GqTyrfg3kvn6F/Ec/v0ObeI9Wy4Lk0LKykAdeUNhl9EDvIyTgTYkm1UtkZFK3zM7MWW8DBRrW2bzZypE1LDMi0tlZL3mhxzXHQ8xD+39m9Dh+hHi5EM0d+VoUMJXkjPtiZ2tyUSpWagwy8w9INJo2scqWVyp/RVoYB0FVsFKBDU5NJgx7C8KEKjwDco4bY2K5BNIHZ14CTTTTdimnB+ADYZUagjsc4u0RRYwcv15ilRLTtGUds7Ogw+3w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8285.eurprd04.prod.outlook.com (2603:10a6:102:1ca::15) by PA2PR04MB10346.eurprd04.prod.outlook.com (2603:10a6:102:423::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Fri, 25 Oct 2024 03:31:50 +0000 Received: from PAXPR04MB8285.eurprd04.prod.outlook.com ([fe80::e003:8fb:64ea:acfd]) by PAXPR04MB8285.eurprd04.prod.outlook.com ([fe80::e003:8fb:64ea:acfd%6]) with mapi id 15.20.8093.018; Fri, 25 Oct 2024 03:31:49 +0000 From: Hou Qi To: libcamera-devel@lists.libcamera.org Cc: jared.hu@nxp.com, qi.hou@nxp.com, julien.vuillaumier@nxp.com Subject: [PATCH] libcamera: formats: Change bytesPerGroup of RGB16 from 3 to 2 Date: Fri, 25 Oct 2024 12:31:25 +0900 Message-Id: <20241025033125.2275054-1-qi.hou@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2P153CA0019.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::6) To PAXPR04MB8285.eurprd04.prod.outlook.com (2603:10a6:102:1ca::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8285:EE_|PA2PR04MB10346:EE_ X-MS-Office365-Filtering-Correlation-Id: 4dd30d0f-06fc-4dd5-ff38-08dcf4a58f80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: a0EqJ0wCGLg5bW3D9eT8fJJj7Qr92212BKY+b3V6+G/zQCUiJUu1f40lCjUo426tI9pUHiliyGx7wDiHFGfGsA/FtNm4QYWznCUSwiyDFfcb1ZK3jU36qWcFArwKECh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7Yb3RN0Si4h9T4reWEjWDi/lM3aYqIdJmQAwazdcz2K17EzBqN3+BGKr83S12YlPIhjX16F7zmYWVvDbx2p0kDPaZUk/DpVE1qzKlCReXGBKN5dWSk+rQ12W5eUCg184QZqcK91iHDi02duec4GFIaD2PaeeYGIzYQuFJr+YeNETqUlmaJVr8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8285.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0AiCqff7otRj7WSLkpI05Cd9FqReoiLifccNzmMtfu6WoJ2Ysu23uSLhu9Mxnzjkea0UHq/CUadbl3l4jDhqQXSGJKufokWyHt+9aYdm9GS3QcMJPY5Sn/r/LaeUJ06/4MpjDc4NbpvEgZGarKT8Va8s13+nKxS522PeT9cnoWMv0u5HaKTet0j+qb1gNbs7LclMdcpSYaJAR1IzGnvtKGanoyTmW/IV7b9FdvPV+bJ/0sltPqaiQm95aY9foBFLvnk1y7iGbP034m/H4XIZ8v7TzUTAXCsk6fWhj1msv+AjJNZcF6DvK4ZlyFCc07PcE3JfpppbT+GggrPQlQUnNRnKjsPlpI7i8KZ6zfyTFlpFzawUPYV134Nu656gMDtaKfZGDdOT/xY0fU7k8+ZGD2mjvD6NuuUSw00rLIJDdZOyIRtKvPcDHRjjLJo570f3QbdtK2gshm7fqm0EFNAWWam4ZYVIGrAktdtcwqwkX8aB7KrY64J3Y3KKRu2lB0IvdPMNaivPKjlem/GXfiKw70wpD5oJEuwA63xYvvJ5JQw9F4HRjFMz+SBJI3JflaoaWSC/XXWFsX9NZl3aDUzK0Z45MXLgoyKJRGfXWJCQMqPd02UQB3Vv8gyIaOEBni553sILp3y4KbNW6F6dvZnkBy5PsgOX37Tdi8Ak72xES4Zjf/7s8pUngF1nMMxTrUvmP2nIUTZEqCUmYliL5EyfqzJzi35mWcXsj/VCOjaz1sov0G93xiIOcHZNa+qmvJW2CGSjmvFOi4YNU/b8JVTkAUBrEFBes2BGd2g+BQXIEzsSd3rRz172qiVtX6wTafVt5hMmwpVs4firPf7uwzAKHe1u9cLg9hbDRhBDvepjGDeFc8WP5OgBxEGlxZmIpaNZHcAXSBH/h0TkhNxViEctas284Rh+/6PHfMwFsyA8h5FqNXY/GYUcUxfsEBD/lXJuJVNkFD9fyA1doril2XostAtS9lZL2I5qaEHOQzR7haGp2G2H5aKJ5PEoYINEC1uMqh0p9lztCFQJUkU34rBb7/kkS6xCYL1tdryRpP2q5bj5VqpVbokNM9Ez0eh9/EWbX1WyH1qbGLJRzWHtr8HoPGua96HUUoV7jzIsdsVBx9+GifcjSeazbMt+BxoY04mmY2T9jwrTQlO0h4HN2DEiXvsj3JaMoRgqYXGbN0XW61YpmBmaig8Q/ZnFblk3ascD2r17wM+61xaYCdXPH9nb/qCt1ClzAJYpbLJq8BM/Ywd2KphW/n/CwCC2OkD4341DMFEPXpngTTe7x7taD0rbGRe8kkh25LGyTL1sn70D0OjNtKTr0WJwo7523gEBqmQOyhOne9dj0l7xC1MPkTCKT8ey09JalMuksiCRrXCyiNbnMjC3iVVhy1YUhKBHmyMkcc5FglDtvtVOiN8M4OHQFk9eznAQ0qEMVWX5mxs9GKZpOpTMOqv1az0XgSLNlV5Wk5OAEwXKiYx3CTbraQeVP1wLOFTMOPldyxC25iyw90P6CQTsHeTqXRd3e/gem/ceY7B0B+CKSK0mQJqf5QJVk6i1L9NdbDHMneAxROrqAB0= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4dd30d0f-06fc-4dd5-ff38-08dcf4a58f80 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8285.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2024 03:31:49.7108 (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: Kl+g+B+kjJW0+NEdqr5n6SLZPmGp6uwOHXVCvR7TSOqnf9jDFnWbqrJ6sz58SKzo X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10346 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Change the bytesPerGroup in plane[0] of RGB16 format from 3 to 2, otherwise calculated stride using below formula will be incorrect. /* ceil(width / pixelsPerGroup) * bytesPerGroup */ unsigned int stride = (width + pixelsPerGroup - 1) / pixelsPerGroup * planes[plane].bytesPerGroup; Reviewed-by: Jacopo Mondi --- src/libcamera/formats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index dbefb094..bfcdfc08 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -157,7 +157,7 @@ const std::map pixelFormatInfo{ .colourEncoding = PixelFormatInfo::ColourEncodingRGB, .packed = false, .pixelsPerGroup = 1, - .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }}, + .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }}, } }, { formats::RGB565_BE, { .name = "RGB565_BE", @@ -167,7 +167,7 @@ const std::map pixelFormatInfo{ .colourEncoding = PixelFormatInfo::ColourEncodingRGB, .packed = false, .pixelsPerGroup = 1, - .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }}, + .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }}, } }, { formats::BGR888, { .name = "BGR888",