From patchwork Thu Dec 11 23:22:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 25511 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 0459FC3257 for ; Thu, 11 Dec 2025 23:24:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B17236166F; Fri, 12 Dec 2025 00:24:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="evehav43"; dkim-atps=neutral Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C3E8661623 for ; Fri, 12 Dec 2025 00:24:08 +0100 (CET) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7e1651ae0d5so553792b3a.1 for ; Thu, 11 Dec 2025 15:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765495447; x=1766100247; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rnjAQII4Af7HGPERJUrMBWaxv6dQNSLGtLqN0TNNsL4=; b=evehav43uNg4e7xUo/EmZhYH2SudISZJU++6o5sHQLUD/776UUhzO0ZFZmohdMMf25 coYi7OFsNZ8zFqvLmly8tdSAymbMDReMzUW1tw0x8ZREnH/d1V1rAVfSRIzGEDZE2zbZ t2LGgFtYzAV3Ge8MT5qSyjZggrNOHh5tWY3uprtLphoOeAB96JvWT/oAL3BWEM9owAuf ugPcR8WeC+n26WJGO7OJtutVGaKh+/YtALKdrd8YfudgX1shFTFN3ZUACtQ0KVQ9w8G2 MWR6E2MYX7SUJ/TbamjYL7vZW1MnuNVrO+x3ueA+u9nmSqxDBDyiGwynXJu2dLM7pdjY K6Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765495447; x=1766100247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rnjAQII4Af7HGPERJUrMBWaxv6dQNSLGtLqN0TNNsL4=; b=xUKXqUx3rQWyrZ3ViGTT8OSAjqmMMPex1Y/T1ZHbuWiFa+la1e5GHxfWXVYGnL1qNI drBZTgeJa/XaAL6+tRcsaEjD3vr+Osp5gDaMg3NVXSB2rpJjFtJHE2T68jZCKFcEZZ04 b4hFS+YnIg/DrJwWQbRMuJFf/HdLJzLOdue657/Ci3JaP6SfnzoiS2yZp3lMhVu6lKY9 ra9Ye1jIdYwOMhX3ljjY2Rhm7OCKKIClz4qnm/fowJvlfKb+C/VevT8ysd2O1bHIvdW0 B7O0DSSE9DNs9T4uun53cruy/okgGeFUOaiQ6IRDflXiwlM+dmVETgQGJy8W9vGQWlbq 0IzQ== X-Gm-Message-State: AOJu0Yy/+2q+T6vYsGBJuF/M/rQbagEltIQ48hj2h7Fty89tEFaKssa4 +qSB0fhVDqAe82u+Otph3SPnae7QEr7bfH/9CQJMCal7l43yDuikgl8Jvf7x9IhmYBiUF4KmtcK whWxd X-Gm-Gg: AY/fxX7c/00JTwSF8Tq8ikTZIljKGBFnlCRW98+hMMFuPA9BCv8GIj9ehuVX3b+3ySW D6wC7RhUEDP0vOs9jiEMzOxxxmaoe40mVMDGpNICp+czwEF907k7ln1deTnmsLp4anzWb8GsWgu 6ZIL74Ze6B+OpHXsgbmvVrvtzEyTZI4ci1amMNyAwCMMhOknnRyECuFuknF2QCEOFIB/xEsp12M p27UoPG62aD5mL7Y9uZM6gVBidBvdG6BuDM004EAYhLXAPA1RkLTFMptfJSg2s1y5VVDnanAast W4T80eanMVUfdT1e8vrZR7phg7xr9aP6UqHWk3S3T4f9cJ4i116SxwKiKxzRlJJMKe+r4xOgkg4 BEfAV1DsJy2g1783TMQGKBuFflfJaflDx7Qi6hKl6fNszZqroGjfLeRBb9j00s/sZN+MP1srqMi MJdauweTVWtTUWZzNoCpz0V6ctLgmNXL+in6wzRoaBjdl2EigXiUPBrZJShTOs3A== X-Google-Smtp-Source: AGHT+IGrSnpSrZTBc63v9u7rHJgnOzg38QSplE3h/Z3NeDVzGQvLwTKOn6j6XBAFFOEZCshVqXP0aA== X-Received: by 2002:a05:6a00:4192:b0:7e8:4587:e8d0 with SMTP id d2e1a72fcca58-7f66a06b248mr183467b3a.67.1765495447176; Thu, 11 Dec 2025 15:24:07 -0800 (PST) Received: from inspiron14p-linux (M106185144161.v4.enabler.ne.jp. [106.185.144.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7f4c4ab52aasm3399933b3a.38.2025.12.11.15.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 15:24:06 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Kieran Bingham , Milan Zamazal Subject: [PATCH v5 17/20] libcamera: software_isp: lut: Make CCM available in debayer params Date: Thu, 11 Dec 2025 23:22:42 +0000 Message-ID: <20251211232246.31330-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251211232246.31330-1-bryan.odonoghue@linaro.org> References: <20251211232246.31330-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 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" Provide the CCM calculated in LUT to the debayer params structure for consumption in the debayer shaders. Reviewed-by: Kieran Bingham Reviewed-by: Milan Zamazal Signed-off-by: Bryan O'Donoghue --- include/libcamera/internal/software_isp/debayer_params.h | 7 +++++++ src/ipa/simple/algorithms/lut.cpp | 1 + src/libcamera/software_isp/debayer.cpp | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h index 217cd5d92..4b203e211 100644 --- a/include/libcamera/internal/software_isp/debayer_params.h +++ b/include/libcamera/internal/software_isp/debayer_params.h @@ -13,6 +13,8 @@ #include #include +#include "libcamera/internal/matrix.h" + namespace libcamera { struct DebayerParams { @@ -49,6 +51,11 @@ struct DebayerParams { CcmLookupTable greenCcm; CcmLookupTable blueCcm; LookupTable gammaLut; + + /* + * Per frame corrections as calculated by the IPA + */ + Matrix ccm; }; } /* namespace libcamera */ diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp index d4a79e101..49482d711 100644 --- a/src/ipa/simple/algorithms/lut.cpp +++ b/src/ipa/simple/algorithms/lut.cpp @@ -133,6 +133,7 @@ void Lut::prepare(IPAContext &context, auto &red = params->redCcm; auto &green = params->greenCcm; auto &blue = params->blueCcm; + params->ccm = ccm; for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) { red[i].r = ccmValue(i, ccm[0][0]); red[i].g = ccmValue(i, ccm[1][0]); diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index 8b4b6cd74..4464bffb4 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -100,6 +100,11 @@ namespace libcamera { * \brief Gamma lookup table used with color correction matrix */ +/** + * \var DebayerParams::ccm + * \brief Per frame colour correction matrix for GPUISP + */ + /** * \class Debayer * \brief Base debayering class