From patchwork Wed Dec 10 00:31:34 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: 25413 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 DFBADBD1F1 for ; Wed, 10 Dec 2025 00:32:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9CDEF61471; Wed, 10 Dec 2025 01:32:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tcJfGFsp"; dkim-atps=neutral Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 40D3360C8A for ; Wed, 10 Dec 2025 01:32:41 +0100 (CET) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-3438231df5fso7847703a91.2 for ; Tue, 09 Dec 2025 16:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765326760; x=1765931560; 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=tX8SQUKwoSIuWZvIfVWFvgmrgrfM2uE6n18+JCpQbRw=; b=tcJfGFsp8Os5D2HaxxC4ss8TLcZLu0aCTYE8vZc2HyBux9ZrlStfZp0AGTqeC4He4W jUiVn3zMa7i0rT8MBs9TpiBa/yZgaeeVunJpEOSoqs04a0eyT8oceZxLFMDr/Dcn1Zx1 zAHpzVt0lWcJ51V9OVykVNqHZiQBmHZmWqaZihjggYdhIrYNH1Fq4xiXk6+l+G9lD9Bb XVu/++eL7AB28G+YPFpLyepMq44Q/8igb5jP42Du3Lllx085xFwLbjgvwIs7wMfBI23h Ls/JMtKFaWfE6Q0WdnQ6LrO4ksokRyC+rsCcmCZqZQ6s0J5AvksJu5hTb0sRreelnUYt O9zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765326760; x=1765931560; 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=tX8SQUKwoSIuWZvIfVWFvgmrgrfM2uE6n18+JCpQbRw=; b=cPiVkBgiuDVLZyEIf0CquRQ8g6ABB33EpUIe5oV6DUvB14+PKkBj//SDBo0BiF7VsV ri47AdTzIFPojWMP/0deRGlT/Co0G9LGcL9jRGK2xa4OaWL33186TozONxgJaTo0bGUg YM5J1p2ESrqhntJJ0a0C8JhhUDdKnv8loTk4ABAguosB2kTzQN0LH6osgSGvA4hxEj4i KSqieZ4n/O61wfV23TYFXeFlnucergq4BXurYw05XGz2XGlqdWz2/kITf10cqdmg8Q1s n8WLsCGiOuRfVG9RnjLGVqG9RRbacblxGmvNjYDTFHU9nPmnawIJZEDTFPCOf5+Q/N5q pJmg== X-Gm-Message-State: AOJu0YyKGdK++dVaYze+bQcQecIUf/XqR6UWpRSGv148AqeBUR4Tzxdr pbecOvA+ry7ct5UH6vxTiYeCp1RUrDxzoTZYVxgxQl08RBgWusjyHljtUCtiYciWfgkY14bvzkU wwk0L X-Gm-Gg: AY/fxX7p3MYMj9elLs1qq3cSFq0L4uG7NcgTQPqHQ/Xo6WKjhX4vrP0JOhq3+MoPTwD S041m4gjMsJVs1LV+DpCFZLNPoUAU8/nj5gvMZLL6F2XOnscpCV+zyjcyXghQauRyeIlo7bQIiY JZqvS4v2kXJXvlcyLNGX5hF5MYAhEiilGuxNoIbfByuEf41ZP7aceRJx6jBJUKp0eepBdEsYgrx TPevS9R7ahrxZPVixD/zuP5xDn+6gYa5g77Hq44zi830zIL3GlAyrLpDY5kQOqpUTu8CIAt2d34 PQojm0RKewqBfEW1DF5EuYjlTVRrq8fuctqUMSYIqgQ8qFkp4YFM6J08gHKpGDUTtbQWX5tJ2Wf OQzR6Ln6bkT0xSYQOBQlZLweyQMk2WpLLWyxILrVCV7X4YyHGYSuW4+IXyZWrM+OwuxwPhbec7w WARpN+s6NnnegEhM6JygR/vnWqPkD3fX3CLPAIo4WbTG7aNTwX9dQVDW7+g3yzW34d X-Google-Smtp-Source: AGHT+IGXrRgjpH6gEJvCo0otHHWRX6LXwao91E6dI4V5Q3WICcV8krrwXBPtldhZ6Np9kizCRkzTzg== X-Received: by 2002:a17:90b:2f84:b0:341:d326:7354 with SMTP id 98e67ed59e1d1-34a7288c11fmr574054a91.37.1765326759570; Tue, 09 Dec 2025 16:32:39 -0800 (PST) Received: from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp. [150.147.107.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34a70427ea6sm566580a91.3.2025.12.09.16.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 16:32:39 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Kieran Bingham Subject: [PATCH v4 17/20] libcamera: software_isp: lut: Make CCM available in debayer params Date: Wed, 10 Dec 2025 00:31:34 +0000 Message-ID: <20251210003139.43606-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251210003139.43606-1-bryan.odonoghue@linaro.org> References: <20251210003139.43606-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 32a2c8378..0ee23f36c 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