From patchwork Tue Dec 2 13:31:50 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: 25305 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 E4318C32F6 for ; Tue, 2 Dec 2025 13:32:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D6E860D2E; Tue, 2 Dec 2025 14:32:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SVTXga2A"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F94C60C8C for ; Tue, 2 Dec 2025 14:32:23 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4779adb38d3so40879445e9.2 for ; Tue, 02 Dec 2025 05:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764682343; x=1765287143; 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=gUmuV/z7G3dP1f3bLqB1UdRo5tMX4cRhpEPrzATFtaw=; b=SVTXga2AA4MzR1tVEDcKkia2d/XLqZ0BjCKycyf0JaYa+HMvvKi3wIW/46YbVtUL2U EZvU3tfCUf7Cf6y9HvjqN0m6wLJNr3SC6IwcDI+AhPbEQDdp7s1AI3wVNuFIZvUOK1Ny ddUxSArMq4tIsRSb+6RNO0NR3tPicv/hIFMfljUFBpw8Etst+EE0VBDTDU/+/ArowdnK JyUeoh8dGcOiSWoYEJ3ZWqg5CsEM7vzlBCAyDFK+Rbf873/v+NG5tP3cN8Fhl8ObxA5c ORtgd6MFT1SX1ueRZhenj9ghobhggpySmsvymvNBEuu0EoP5iH9u7kMSEhgWGnSc+r3Z wSWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764682343; x=1765287143; 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=gUmuV/z7G3dP1f3bLqB1UdRo5tMX4cRhpEPrzATFtaw=; b=hYY6sb/93GoqqZALNUEee2/I9kaj1clUZxwZyhx4KzbNImD/vPC/Y/xb1F+QxHK8Z8 D7dU/A4IezmhbH9X5BKjy2UCABdS1xS02Os2Ibk+IZKZO4iqse3LDz99+3Jrle2HpQ6J mGqApOYe62Fv+0GKKUZ+qCRfMhCrR+XXmKFaWslaKPn/HNiXEoWr6pWiLp5ehb2QXz1a /CGBqDjhwTHIaXqqNllf7Sz0MOn3R3PwrCrB14cbyF4h8hPPyuJUru6Rpp8QsQfSqtoG pvVnwbiVmx8LCAU9IspisOwITgRlpg5hP5HHgUvEAGZhBPTzxYSe9mIJEYtyyWauIywg hZDA== X-Gm-Message-State: AOJu0Yx9C7M+yo2e3jtHKh78KGJO6uSGip6PzUlRHEOLcSbTVMiajnz3 Q115a7/qJ3UA2PojZgBRPgz4iFdqPZpFvLQGK8Gi2SYPgZCuAJDdK4DLUVOmQb+Od6ECtbYbjXB P0Yoe X-Gm-Gg: ASbGncspYXmK1a/JWoWrHY2AG71zcoiXUUz+OyPuTnS8vEVXkvXeAY7FyTjCwGpBmoJ lTrFDzYiENBlBh1RqljWNVOH0UNLxn8LTAseNoblTQFydFYOleV6wYCqMP8m8In5kDWdw4xNG3s 0hqyaz1VnqtRaaKZLWqY10Jn9QS5LEtbg8WsL8e6kA9OIqM53lEji51PK/gcTxj8S/Gr0tpd52z MQYNvpQGl9cVl6jhYhorNnBvZaZPVH+Zntk7l0KPaXD3UgIqvPo8yBRe7ihpCrvJHExUtWt/PQ7 WEh+1y1u/ChjEyN1VY9dvfPMSvt3dK18zlILdBbp9tDK9DMUlIKiabxq5zlxwWJI9jhDGFOs7Bx lfh8kjyvjwq615tVHMWJr4GnkOp3WgPivuwjqXChAOdXNsi50rl0TN3nIo8wctXbtGOX01A0m6H vFRwYNcxzEZKx1aQAjkh+jEc9cLcteSaRl7AEVFw5kIT/xvLOFINZmt4QpYYxWfanXcZzU9LfcM jPqCQ== X-Google-Smtp-Source: AGHT+IHb7tLrpITkVqdYAQ7qoPKz9D2P6xJ9vZlNWYU6UOiV853XtpDbSbAvNA6vOaZj/D5/SbGUdQ== X-Received: by 2002:adf:b30a:0:b0:42b:3592:1b92 with SMTP id ffacd0b85a97d-42e0f34fdd3mr24491080f8f.47.1764682342564; Tue, 02 Dec 2025 05:32:22 -0800 (PST) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5c30c4sm33363322f8f.9.2025.12.02.05.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:32:22 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Kieran Bingham Subject: [PATCH v3 19/22] libcamera: software_isp: lut: Make CCM available in debayer params Date: Tue, 2 Dec 2025 13:31:50 +0000 Message-ID: <20251202133157.661407-20-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202133157.661407-1-bryan.odonoghue@linaro.org> References: <20251202133157.661407-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 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 dae1f12d9..f5c94bb8c 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