[{"id":37243,"web_url":"https://patchwork.libcamera.org/comment/37243/","msgid":"<85a4zq7ma8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-12-10T08:50:55","subject":"Re: [PATCH v4 17/20] libcamera: software_isp: lut: Make CCM\n\tavailable in debayer params","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> Provide the CCM calculated in LUT to the debayer params structure for\n> consumption in the debayer shaders.\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  include/libcamera/internal/software_isp/debayer_params.h | 7 +++++++\n>  src/ipa/simple/algorithms/lut.cpp                        | 1 +\n>  src/libcamera/software_isp/debayer.cpp                   | 5 +++++\n>  3 files changed, 13 insertions(+)\n>\n> diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\n> index 217cd5d92..4b203e211 100644\n> --- a/include/libcamera/internal/software_isp/debayer_params.h\n> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n> @@ -13,6 +13,8 @@\n>  #include <array>\n>  #include <stdint.h>\n>  \n> +#include \"libcamera/internal/matrix.h\"\n> +\n>  namespace libcamera {\n>  \n>  struct DebayerParams {\n> @@ -49,6 +51,11 @@ struct DebayerParams {\n>  \tCcmLookupTable greenCcm;\n>  \tCcmLookupTable blueCcm;\n>  \tLookupTable gammaLut;\n> +\n> +\t/*\n> +\t * Per frame corrections as calculated by the IPA\n> +\t */\n> +\tMatrix<float, 3, 3> ccm;\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index d4a79e101..49482d711 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -133,6 +133,7 @@ void Lut::prepare(IPAContext &context,\n>  \t\tauto &red = params->redCcm;\n>  \t\tauto &green = params->greenCcm;\n>  \t\tauto &blue = params->blueCcm;\n> +\t\tparams->ccm = ccm;\n>  \t\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n>  \t\t\tred[i].r = ccmValue(i, ccm[0][0]);\n>  \t\t\tred[i].g = ccmValue(i, ccm[1][0]);\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index 32a2c8378..0ee23f36c 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -100,6 +100,11 @@ namespace libcamera {\n>   * \\brief Gamma lookup table used with color correction matrix\n>   */\n>  \n> +/**\n> + * \\var DebayerParams::ccm\n> + * \\brief Per frame colour correction matrix for GPUISP\n> + */\n> +\n>  /**\n>   * \\class Debayer\n>   * \\brief Base debayering class","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B40C9BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 08:51:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CBB96145B;\n\tWed, 10 Dec 2025 09:51:02 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 98B796142F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 09:51:00 +0100 (CET)","from mail-wr1-f70.google.com (mail-wr1-f70.google.com\n\t[209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-625-9kTgl6bjNrSeBm3TKuztTA-1; Wed, 10 Dec 2025 03:50:58 -0500","by mail-wr1-f70.google.com with SMTP id\n\tffacd0b85a97d-42b2ad2a58cso2660263f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 00:50:58 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb ([213.175.37.14])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-42f9f5ab46csm8599708f8f.19.2025.12.10.00.50.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Dec 2025 00:50:56 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"YUOfuQAc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1765356659;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=2Z9LPu9IPM3N5+1e1uAgOqtZxc2OenH33fWpCMDM+mo=;\n\tb=YUOfuQAcZW9SUyapC9W2Jk87wF5vuJ9YNL+NKvCge8cFAlxccKAwmQ2Tda1AZfksihY/rF\n\tOvNcUtJFh6uWsDzgamlZozxtyuLI7SvRxyu5DSBwGea2VI/RS7o6Wfp3DZJ0jNQ1H2ZyHt\n\t7lsbX5IXaxAwHt2QU8rrpdquMj4L5yk=","X-MC-Unique":"9kTgl6bjNrSeBm3TKuztTA-1","X-Mimecast-MFC-AGG-ID":"9kTgl6bjNrSeBm3TKuztTA_1765356657","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765356657; x=1765961457;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=2Z9LPu9IPM3N5+1e1uAgOqtZxc2OenH33fWpCMDM+mo=;\n\tb=ugTQUDxvYf3XGnvU02T85j491hoD8A9UItmi0Krr/urULKYWdvK9MzXnjtjPuWxd2D\n\tqcMvpVeKCZwzBRzGHGPPTeT6MMaCJ8QL31KqPi2waaHdiRFmlJVBzQ3Fp9cQpV5PgHuA\n\ted4XzaAhr9n4sRfL1+CXbUbso9hB+f5ajUpm0WUxpgvnl88aEVBQBwW/bspJiGfxu+QA\n\tFDSjDqfew69R8KcMBaC2Np2VzN1MFKJhu3WBWiJp/Le3qRyNp05kosgmawRMyTRIBKk2\n\tiT6U3utCHc/IggT/EAMWyroxLPtPa6GrOCZqalOps23jRx4DUTnNpz5H8wBh1ivBlrzV\n\tuO1g==","X-Gm-Message-State":"AOJu0YzNQTYhZHPiQcBU7Zle3lJtRGwyz2n2J9Al1/jpTDx1YkNgOny8\n\tdj1bUwdJMH+TwnOci8Q77/iZZWHpXVecAPxLdv8opTuteCKHExuB6aReg+mSyEP9xKzl06BokQV\n\tYXmFGQ9OTMwnLiYfzmbbMZhIyhPcAfdlSePY5atumWyrpuGWaPqjnY9McA6nFLzv8Q654UQUEUX\n\tE=","X-Gm-Gg":"AY/fxX5sFiHYzOFquHdtf2TZOa/GMWkNgeUyEjIhvGkA7EH4rH5jxCigNtGIXHLWAMZ\n\tnTG/vtQZ9pnM45a5atleNi/0iemPdsZrgDup0YpD8snwFVx7kDvnnZI1/OMlU6qdbXqy8cusI5X\n\tn6LTtUC/OqwSHGrozKMNlZ/7sKw3kbt3tlETrQ+8lF0aHvkhrAAj2c22WzhM2CAoC6++TQlqemh\n\tR1eEG8ryPeBleG+pYGpR7DMMx6UF3uiJ5xCC9K6m2Hf7NSYsVqS+pQYbWz9qxzHUEGK+/3GEduH\n\tKCx5dkTPLxx1IQo29Xt/hHTuwCvA1HU6V08hYL+Cp8PM/XnDTVAUNLflSijIg0bCxBZIH0XRbVL\n\tGYA65VspBXJAkgfaqMBxds0rRng==","X-Received":["by 2002:a05:6000:184d:b0:42b:2e1c:6341 with SMTP id\n\tffacd0b85a97d-42fa39d9371mr1524435f8f.9.1765356657063; \n\tWed, 10 Dec 2025 00:50:57 -0800 (PST)","by 2002:a05:6000:184d:b0:42b:2e1c:6341 with SMTP id\n\tffacd0b85a97d-42fa39d9371mr1524409f8f.9.1765356656623; \n\tWed, 10 Dec 2025 00:50:56 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IGaUdB4QGTaNUb824qfyz7jSV72TXDbA5XhLctoRYyNcXldxRfySKNWtBRnbpAAvyDtDsfIog==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 17/20] libcamera: software_isp: lut: Make CCM\n\tavailable in debayer params","In-Reply-To":"<20251210003139.43606-18-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 10 Dec 2025 00:31:34 +0000\")","References":"<20251210003139.43606-1-bryan.odonoghue@linaro.org>\n\t<20251210003139.43606-18-bryan.odonoghue@linaro.org>","Date":"Wed, 10 Dec 2025 09:50:55 +0100","Message-ID":"<85a4zq7ma8.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"gFYQYNCPborXPEIcrNnKScN5BLG4nxxaBzF1-lA4jmU_1765356657","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]