From patchwork Thu Nov 27 02:22:51 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: 25233 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 725C3C3260 for ; Thu, 27 Nov 2025 02:23:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12FA760B36; Thu, 27 Nov 2025 03:23:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="NVoJeHjF"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 40F3360AB3 for ; Thu, 27 Nov 2025 03:23:45 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-47775fb6cb4so1770975e9.0 for ; Wed, 26 Nov 2025 18:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764210224; x=1764815024; 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=nQ95/jmePJyWEIfQTGXeTeGzLrO6Eq0ZC4qHC+vGgRQ=; b=NVoJeHjFaJFFXUwsPXxmNajZaV/SGpID7J93jjCgRJ84w8LFRg3GDYAc1BZHwQ9ZI6 dNFlGdsSnzAWDuX9vsNoLvINyJBR35g3tJwofUzaUDsNn8h6160X24JH6ZFUO456DHXu DBHMnxQZw2bt+COUAn8CJ7VXNkxAnLepDXldMeXc7pQqU8iRHTUce6OjRh3vJ2jxl07U EYrPaybsbbGkUjRXgDZEgo3+H04zDs+NoxYkvK7qRV5m02QXaY/AX0myOEoRsha81JUx waYru4Fg1kodhBV6sEEqldoa7+bq/szPII01FoNtq23xDR/qcvsXBss/hvNpzS3xNtvA YswQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764210224; x=1764815024; 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=nQ95/jmePJyWEIfQTGXeTeGzLrO6Eq0ZC4qHC+vGgRQ=; b=r/zhya2bV9UfeoeKDfN+yaGMEGIkLcnsYUKmPhnhzxCU4OEB6TfKFEErcpDAi4h+FF jIv8TyjEooR5U88/HizNOOGzWwKv8BmTME8QWB6S5qDleBaoTG7h/GFjVaLWo/k4x21r T9VY7d9iIN/0TvlzzcWVNhPeNqHyP0GPOYbC5Xswt7qVGVDzDtI1Sq1takNfzjTCo039 K7Es9Zj4Z6QRbIvb4WEzoLqGGAkHjjjv9rQYEIENPMaflGZzGPYXCXwI3ihaVgvyw1oC JptCQSWT6Ivffme1gz84VdUC347FAVbLe6tXgenenBGRC/RZNxUS86zKDhaIU9Zi4Xjh 8Qgw== X-Gm-Message-State: AOJu0YwSMjnn87DF2h1nzPSGFKEsmRrNd4mY0AXP2F20u/ZVjHViKlSR NqZBeUj60dIIP+21se2ETnVVlX4jw4EHiLiDtB/4mFgcN4FvhNmCkchiRNi8jWgTOx7a0BMQkbQ 6wKAHEtc= X-Gm-Gg: ASbGnct3YXES0WDTbG3I/On9nB/Mlh/S4onXqjHemFYIUQm6iMKrhegcFbvOrOZnRFC Mx6eJoDvTWz+bS/IYfrF/J6zKaa24wvuoN/vblnGoKlxqZ6zshSsz5bhMC3rG1nUwN4rAlTaCeP eoLjae5X0TjDbwelMweJreHMWmDT9Gf8pTCqe2KC1rlC4TVmnrRNgalR4RCE0Bes+zqHhzOHc5V etk7bYqTRWzqYoI4d4FUIQIYugAy0w2zYsJaecPywjnv73JI2MTxEIbksywPDf2/SDWBgD6yenX +/DQ5IBu4+rm9IxMxhsvoMq3MK0KMJ0D9aGRBYPZLWpyGG7IdcbyHJwdPR2flEizZhYDxlTBYIJ oMRz/2fiJaYgDnB1niziRqaY5oyA/no7f+JtcDj5LlHUhYEV+OIS9H4d3ql3YOL7EY5ZLQEE0eV TFTDvzcxpWkbyiF9g1LlXjrxNcW26X1/Uo4VscKjDz1N1SyHamyoTFKtZnQVBwcppWXjk= X-Google-Smtp-Source: AGHT+IFf2+wvGsKy4b0ndvv87M45heVdDxn3DjIqh4IVhxQbVQ2UvkwDQbVAtnbDhAPg8ZChYbvv2Q== X-Received: by 2002:a05:600c:198e:b0:46e:33b2:c8da with SMTP id 5b1f17b1804b1-477c1133927mr218326255e9.32.1764210224591; Wed, 26 Nov 2025 18:23:44 -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 5b1f17b1804b1-4790b0e21e8sm71549495e9.15.2025.11.26.18.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 18:23:43 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v2 19/22] libcamera: software_isp: lut: Make CCM available in debayer params Date: Thu, 27 Nov 2025 02:22:51 +0000 Message-ID: <20251127022256.178929-20-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251127022256.178929-1-bryan.odonoghue@linaro.org> References: <20251127022256.178929-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. Signed-off-by: Bryan O'Donoghue Reviewed-by: Kieran Bingham --- 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 1d135b278..4ec76dce6 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