[{"id":36782,"web_url":"https://patchwork.libcamera.org/comment/36782/","msgid":"<176294102379.567526.6875907557498146883@ping.linuxembedded.co.uk>","date":"2025-11-12T09:50:23","subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2025-11-12 08:27:13)\n> Let's introduce IPAActiveState::correctionMatrix that is separate from\n> IPAActiveState::ccm and represents the overall correction matrix, not\n> only the sensor colour correction matrix.\n> \n> IPAActiveState::ccm still includes everything; this is changed in the\n> followup patch.\n\nI think this is answering my previous questions :-)\n\nBikeshedding, I wonder if this is the 'globalMatrix' or\n'combinedMatrix', but correctionMatrix could be fine too.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/ipa/simple/algorithms/ccm.cpp | 1 +\n>  src/ipa/simple/algorithms/lut.cpp | 2 +-\n>  src/ipa/simple/ipa_context.h      | 1 +\n>  3 files changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n> index e05e5bc28..3e9528a91 100644\n> --- a/src/ipa/simple/algorithms/ccm.cpp\n> +++ b/src/ipa/simple/algorithms/ccm.cpp\n> @@ -104,6 +104,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,\n>         if (saturation)\n>                 applySaturation(ccm, saturation.value());\n>  \n> +       context.activeState.correctionMatrix = ccm;\n>         context.activeState.ccm = ccm;\n>         frameContext.saturation = saturation;\n>         context.activeState.matrixChanged = true;\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index b27491042..8751bb31c 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -123,7 +123,7 @@ void Lut::prepare(IPAContext &context,\n>                 Matrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0,\n>                                                      0, gains.g(), 0,\n>                                                      0, 0, gains.b() } };\n> -               auto matrix = context.activeState.ccm * gainMatrix;\n> +               auto matrix = context.activeState.correctionMatrix * gainMatrix;\n>                 auto &red = params->redCcm;\n>                 auto &green = params->greenCcm;\n>                 auto &blue = params->blueCcm;\n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index b6b3cbfed..14680c726 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -61,6 +61,7 @@ struct IPAActiveState {\n>         } gamma;\n>  \n>         Matrix<float, 3, 3> ccm;\n> +       Matrix<float, 3, 3> correctionMatrix;\n>         bool matrixChanged = false;\n>  \n>         struct {\n> -- \n> 2.51.1\n>","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 9A7D1C3263\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 12 Nov 2025 09:50:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF61960A80;\n\tWed, 12 Nov 2025 10:50:27 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2A2F606E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 Nov 2025 10:50:26 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6A5D682E;\n\tWed, 12 Nov 2025 10:48:27 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nuAl9VjD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1762940907;\n\tbh=/cwyYHzNtEwqq/79mCWSoLcr2YvlLgb3Fn64nLBXMa0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=nuAl9VjDW5SykSOHL4RUTC11YruEVeM+ccYU/bB+qWnQFNKrqc6cSUoQVGCSxQpPb\n\tSMXef7zmBH0asNvQJQ3ybHUQAdhJqyyKygSZj1cWwr2mxM1mqRGygZ+hSIaIwgjWjk\n\tpp10f46uON0mq5xKW1VV+x0zd0rzc9ey1XxQ9fpo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251112082715.17823-6-mzamazal@redhat.com>","References":"<20251112082715.17823-1-mzamazal@redhat.com>\n\t<20251112082715.17823-6-mzamazal@redhat.com>","Subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Wed, 12 Nov 2025 09:50:23 +0000","Message-ID":"<176294102379.567526.6875907557498146883@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":36798,"web_url":"https://patchwork.libcamera.org/comment/36798/","msgid":"<85wm3u10ne.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-11-13T14:13:09","subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Kieran,\n\nthank you for the reviews.\n\nKieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Quoting Milan Zamazal (2025-11-12 08:27:13)\n>> Let's introduce IPAActiveState::correctionMatrix that is separate from\n>> IPAActiveState::ccm and represents the overall correction matrix, not\n>\n>> only the sensor colour correction matrix.\n>> \n>> IPAActiveState::ccm still includes everything; this is changed in the\n>> followup patch.\n>\n> I think this is answering my previous questions :-)\n\nOK, I'll add a clarification note to the previous commit messages.\n\n> Bikeshedding, I wonder if this is the 'globalMatrix' or\n> 'combinedMatrix', but correctionMatrix could be fine too.\n\nI like combinedMatrix, this is more distinguishing, I'll rename it.\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n>\n>> \n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  src/ipa/simple/algorithms/ccm.cpp | 1 +\n>>  src/ipa/simple/algorithms/lut.cpp | 2 +-\n>>  src/ipa/simple/ipa_context.h      | 1 +\n>>  3 files changed, 3 insertions(+), 1 deletion(-)\n>> \n>> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n>> index e05e5bc28..3e9528a91 100644\n>> --- a/src/ipa/simple/algorithms/ccm.cpp\n>> +++ b/src/ipa/simple/algorithms/ccm.cpp\n>> @@ -104,6 +104,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,\n>>         if (saturation)\n>>                 applySaturation(ccm, saturation.value());\n>>  \n>> +       context.activeState.correctionMatrix = ccm;\n>>         context.activeState.ccm = ccm;\n>>         frameContext.saturation = saturation;\n>>         context.activeState.matrixChanged = true;\n>> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n>> index b27491042..8751bb31c 100644\n>> --- a/src/ipa/simple/algorithms/lut.cpp\n>> +++ b/src/ipa/simple/algorithms/lut.cpp\n>> @@ -123,7 +123,7 @@ void Lut::prepare(IPAContext &context,\n>>                 Matrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0,\n>>                                                      0, gains.g(), 0,\n>>                                                      0, 0, gains.b() } };\n>> -               auto matrix = context.activeState.ccm * gainMatrix;\n>> +               auto matrix = context.activeState.correctionMatrix * gainMatrix;\n>>                 auto &red = params->redCcm;\n>>                 auto &green = params->greenCcm;\n>>                 auto &blue = params->blueCcm;\n>> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n>> index b6b3cbfed..14680c726 100644\n>> --- a/src/ipa/simple/ipa_context.h\n>> +++ b/src/ipa/simple/ipa_context.h\n>> @@ -61,6 +61,7 @@ struct IPAActiveState {\n>>         } gamma;\n>>  \n>>         Matrix<float, 3, 3> ccm;\n>> +       Matrix<float, 3, 3> correctionMatrix;\n>>         bool matrixChanged = false;\n>>  \n>>         struct {\n>> -- \n>> 2.51.1\n>>","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 C145AC3263\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Nov 2025 14:13:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B35B060A80;\n\tThu, 13 Nov 2025 15:13:19 +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 3C9E060805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Nov 2025 15:13:18 +0100 (CET)","from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n\t[209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-221-KFrguK3YOh6E1M19Y3A9Lw-1; Thu, 13 Nov 2025 09:13:15 -0500","by mail-wr1-f69.google.com with SMTP id\n\tffacd0b85a97d-42b3c965ce5so659941f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Nov 2025 06:13:15 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-42b53f0b60csm4242639f8f.22.2025.11.13.06.13.10\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 13 Nov 2025 06:13:10 -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=\"IxY/CxQl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1763043197;\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=ns9ZO9rHvNnnwR7J/0jOjUgvjwkhwrliDM65d5tcYaU=;\n\tb=IxY/CxQlxvwi6szvhk/IiySmir576ou4yPbrWpfMZZV5W0nkejIwVzBjQkBNG2CpqHh6cj\n\tPZliz3XSB6XUxUaNYRbwon/Vrsqk9CGiFx+fjY2T2y/WTD57Acbpwc4YNrHj61Pdd4oUB0\n\tuGMJWP45A7w96VBWI8kMaHghzWNo6cU=","X-MC-Unique":"KFrguK3YOh6E1M19Y3A9Lw-1","X-Mimecast-MFC-AGG-ID":"KFrguK3YOh6E1M19Y3A9Lw_1763043192","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763043192; x=1763647992;\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=ns9ZO9rHvNnnwR7J/0jOjUgvjwkhwrliDM65d5tcYaU=;\n\tb=D8V1WUZ3KL6jXubmy6siEDVcal459CzNyDhouLL6ev5dYhxyNczfrUtyMZAz8qNUoj\n\t1HShST4dKWQsIsf1UWxQdjY6bOCCxiMgnwpvec/CSVuCoiu8JTMQs2kEmSmHisgV+Y2D\n\thjg8ASVtmCiQDbdg8uz8jtSQHiquJqb+e3vwcAYnl2xCKTzC2JUK+fMyH/ykuD34fD7g\n\t1qtXWJoV2cDW4tpVfiaIQW6ckuoLmmcoybWoDdlYVjCQebKmb/vu6zUS4deEHYZzvqi3\n\tU80q/ZVRWSFrzka4Lzg1bk1qBv4VoRJiRtMLcCjv2R0tuD0Rxzu8LG8O1yU0dMbsmQZf\n\tzf0Q==","X-Gm-Message-State":"AOJu0YzAiJKuGicsumtbe+HX6hVhgy8Y+65TOTtlG6sihHVUS+a1tza3\n\tw9p/h0DjqbXzvnzfLWOJgwJtAIpkZJgfSXvq991Zn7cDlwu/za/DCu0Ll/IrPW2R4wc3ysjCBeV\n\tT9Y2utLOi6tQAXMSJG/TWB8eeZY415GuPpPNUkNQztFZ3TVZYwhU0AJkNMFXF9s2liOgy06M5Nb\n\twb51TrUk5HOcq3uPRxPn40ghivNzBje8GIkzW5bW4lDrwu/bVysiQlp00HgHw=","X-Gm-Gg":"ASbGncuY0tWUrVRi/THWfA/KVIHBAJdDNx7MOZb6qpLU1JMhMKe32HnZjj6domJO3Gc\n\tJGhzoiboJpiB0BT9W60NUPLJUzot3bjfQkSjAwPBLQTxV3guhBonrWK3fcy1LF0nJmbMQenkcR/\n\ti1xWaX/smJByHYUXJmOCsc81eH+KgFPOI+p2pgWE/SqxxixgTFaR3ejRLbQPInXtmvYXIp4v8TA\n\t1Ny7ToHGvHjtRwehmeBi3S2hzb2LGDkChrjbpj7M09M1RKtPoY2MpePqvSBXzd5gKaVFkwWdk0E\n\tx/Q0G1iiEek8RjVFd/9g68xrgYTEQJ00K3qxiDfvOjstRz4SIZrnWpHjTyjZfm1wVCRhx1EmyCv\n\tfNksaXhVoKhFwclwI0RuSNMlUMAPKzQ9xclHoYIiW8eoIufXV85nC","X-Received":["by 2002:a05:6000:2f85:b0:429:92d8:3371 with SMTP id\n\tffacd0b85a97d-42b4bb8f24amr7188237f8f.11.1763043191934; \n\tThu, 13 Nov 2025 06:13:11 -0800 (PST)","by 2002:a05:6000:2f85:b0:429:92d8:3371 with SMTP id\n\tffacd0b85a97d-42b4bb8f24amr7188203f8f.11.1763043191423; \n\tThu, 13 Nov 2025 06:13:11 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHKW1WZx/PPjzP3s+VPP9uRJnJcH3Dx/PTVMAFwYE6tS0jZUkxBvL6ffqzM97oLrRndBuNrQg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","In-Reply-To":"<176294102379.567526.6875907557498146883@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Wed, 12 Nov 2025 09:50:23 +0000\")","References":"<20251112082715.17823-1-mzamazal@redhat.com>\n\t<20251112082715.17823-6-mzamazal@redhat.com>\n\t<176294102379.567526.6875907557498146883@ping.linuxembedded.co.uk>","Date":"Thu, 13 Nov 2025 15:13:09 +0100","Message-ID":"<85wm3u10ne.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":"PT_6S0A08Wku3uamSNZQOA-c08r6yfZ_6chgHgEKj5g_1763043192","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>"}},{"id":36852,"web_url":"https://patchwork.libcamera.org/comment/36852/","msgid":"<f7759c79-c05f-482c-a4ce-c661265d60b1@ideasonboard.com>","date":"2025-11-17T11:09:21","subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 11. 12. 9:27 keltezéssel, Milan Zamazal írta:\n> Let's introduce IPAActiveState::correctionMatrix that is separate from\n> IPAActiveState::ccm and represents the overall correction matrix, not\n> only the sensor colour correction matrix.\n> \n> IPAActiveState::ccm still includes everything; this is changed in the\n> followup patch.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/ipa/simple/algorithms/ccm.cpp | 1 +\n>   src/ipa/simple/algorithms/lut.cpp | 2 +-\n>   src/ipa/simple/ipa_context.h      | 1 +\n>   3 files changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n> index e05e5bc28..3e9528a91 100644\n> --- a/src/ipa/simple/algorithms/ccm.cpp\n> +++ b/src/ipa/simple/algorithms/ccm.cpp\n> @@ -104,6 +104,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,\n>   \tif (saturation)\n>   \t\tapplySaturation(ccm, saturation.value());\n>   \n> +\tcontext.activeState.correctionMatrix = ccm;\n>   \tcontext.activeState.ccm = ccm;\n>   \tframeContext.saturation = saturation;\n>   \tcontext.activeState.matrixChanged = true;\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index b27491042..8751bb31c 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -123,7 +123,7 @@ void Lut::prepare(IPAContext &context,\n>   \t\tMatrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0,\n>   \t\t\t\t\t\t     0, gains.g(), 0,\n>   \t\t\t\t\t\t     0, 0, gains.b() } };\n> -\t\tauto matrix = context.activeState.ccm * gainMatrix;\n> +\t\tauto matrix = context.activeState.correctionMatrix * gainMatrix;\n>   \t\tauto &red = params->redCcm;\n>   \t\tauto &green = params->greenCcm;\n>   \t\tauto &blue = params->blueCcm;\n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index b6b3cbfed..14680c726 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -61,6 +61,7 @@ struct IPAActiveState {\n>   \t} gamma;\n>   \n>   \tMatrix<float, 3, 3> ccm;\n> +\tMatrix<float, 3, 3> correctionMatrix;\n\nI have looked at the other changes. And it is not entirely clear to me what the goal is.\nIt doesn't seem to be used too much. And for example, here is `context.activeState.correctionMatrix = ccm`;\nI would've expected that it gets initialized to the identity matrix at the beginning of\neach frame(?), and then simply gets multiplied by each color transformation, and at the\nend it gets fed into the debayering parts.\n\nBut that doesn't quite appear to be what is implemented by the end of this series.\nAm I misunderstanding something here?\n\n\nRegards,\nBarnabás Pőcze\n\n\n\n>   \tbool matrixChanged = false;\n>   \n>   \tstruct {","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 6349EBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Nov 2025 11:09:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5B09260A80;\n\tMon, 17 Nov 2025 12:09:26 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 62C9160856\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Nov 2025 12:09:25 +0100 (CET)","from [192.168.33.31] (185.221.143.100.nat.pool.zt.hu\n\t[185.221.143.100])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3907EB5;\n\tMon, 17 Nov 2025 12:07:22 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GxTYKbjW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763377642;\n\tbh=flEsmEZ4zxXnZn/YwOKHebvzpf1MerejkVpcPadqkFU=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=GxTYKbjW7QSwwU5Mc2J3clnlJ3ggoy8yGOO6GZN0a2rcy5RWjfreqLBhhSabZo+lU\n\trD9b8MFMieQ3GDLpzv9WRi58SrWCL7z/3pHdDBtG5iqF7Ttmjc8W0ra+BcuyJxeZNw\n\tNovtoAC2TWFqgQQBpESObN8CnfqIoUa+uNePCJmA=","Message-ID":"<f7759c79-c05f-482c-a4ce-c661265d60b1@ideasonboard.com>","Date":"Mon, 17 Nov 2025 12:09:21 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","References":"<20251112082715.17823-1-mzamazal@redhat.com>\n\t<20251112082715.17823-6-mzamazal@redhat.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251112082715.17823-6-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":36866,"web_url":"https://patchwork.libcamera.org/comment/36866/","msgid":"<85zf8jk2qm.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-11-18T11:18:57","subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Barnabás,\n\nthank you for reviews.\n\nBarnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> Hi\n>\n> 2025. 11. 12. 9:27 keltezéssel, Milan Zamazal írta:\n>> Let's introduce IPAActiveState::correctionMatrix that is separate from\n>> IPAActiveState::ccm and represents the overall correction matrix, not\n>> only the sensor colour correction matrix.\n>> IPAActiveState::ccm still includes everything; this is changed in the\n>> followup patch.\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   src/ipa/simple/algorithms/ccm.cpp | 1 +\n>>   src/ipa/simple/algorithms/lut.cpp | 2 +-\n>>   src/ipa/simple/ipa_context.h      | 1 +\n>>   3 files changed, 3 insertions(+), 1 deletion(-)\n>> diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\n>> index e05e5bc28..3e9528a91 100644\n>> --- a/src/ipa/simple/algorithms/ccm.cpp\n>> +++ b/src/ipa/simple/algorithms/ccm.cpp\n>> @@ -104,6 +104,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,\n>>   \tif (saturation)\n>>   \t\tapplySaturation(ccm, saturation.value());\n>>   +\tcontext.activeState.correctionMatrix = ccm;\n>>   \tcontext.activeState.ccm = ccm;\n>>   \tframeContext.saturation = saturation;\n>>   \tcontext.activeState.matrixChanged = true;\n>> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n>> index b27491042..8751bb31c 100644\n>> --- a/src/ipa/simple/algorithms/lut.cpp\n>> +++ b/src/ipa/simple/algorithms/lut.cpp\n>> @@ -123,7 +123,7 @@ void Lut::prepare(IPAContext &context,\n>>   \t\tMatrix<float, 3, 3> gainMatrix = { { gains.r(), 0, 0,\n>>   \t\t\t\t\t\t     0, gains.g(), 0,\n>>   \t\t\t\t\t\t     0, 0, gains.b() } };\n>> -\t\tauto matrix = context.activeState.ccm * gainMatrix;\n>> +\t\tauto matrix = context.activeState.correctionMatrix * gainMatrix;\n>>   \t\tauto &red = params->redCcm;\n>>   \t\tauto &green = params->greenCcm;\n>>   \t\tauto &blue = params->blueCcm;\n>> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n>> index b6b3cbfed..14680c726 100644\n>> --- a/src/ipa/simple/ipa_context.h\n>> +++ b/src/ipa/simple/ipa_context.h\n>> @@ -61,6 +61,7 @@ struct IPAActiveState {\n>>   \t} gamma;\n>>     \tMatrix<float, 3, 3> ccm;\n>> +\tMatrix<float, 3, 3> correctionMatrix;\n>\n> I have looked at the other changes. And it is not entirely clear to me what the goal is.\n> It doesn't seem to be used too much. And for example, here is `context.activeState.correctionMatrix = ccm`;\n> I would've expected that it gets initialized to the identity matrix at the beginning of\n> each frame(?), and then simply gets multiplied by each color transformation, and at the\n> end it gets fed into the debayering parts.\n>\n> But that doesn't quite appear to be what is implemented by the end of this series.\n> Am I misunderstanding something here?\n\nIt should be as you say.  I'll try to do something about it in v2.\n\n> Regards,\n> Barnabás Pőcze\n>\n>\n>\n>>   \tbool matrixChanged = false;\n>>     \tstruct {","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 3E8CCC3241\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 Nov 2025 11:19:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0DAA860A80;\n\tTue, 18 Nov 2025 12:19:05 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 62BCD606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Nov 2025 12:19:03 +0100 (CET)","from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n\t[209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-436-HF7uXr6yOgq9C0s5W9lMSQ-1; Tue, 18 Nov 2025 06:19:00 -0500","by mail-wr1-f69.google.com with SMTP id\n\tffacd0b85a97d-42b2fb13b79so2556805f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Nov 2025 03:19:00 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb ([85.93.96.130])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-42b53e7ae88sm31003112f8f.6.2025.11.18.03.18.58\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 18 Nov 2025 03:18:58 -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=\"ZhHkDZfK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1763464742;\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\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=VFvKjz+69O1v73f0dM2DrQG+mj/lHr1BWtVNpJWsRZs=;\n\tb=ZhHkDZfKk8xGIZO4BK/MAFfKpGmqHyORZE5mKJATb6RVPpvEp6mMxrJuv8Hm0EFtK1gXRB\n\tQXB7ghGQsUPn3EVNJ9rA1Bbl5xnTe0wf2sgSSTk/lhGEEaQdM6kbSxjqT8RnLPf+KQ3sCh\n\tTXz/7xLRlOFW+pqvlLVKEo8NVQX2SvA=","X-MC-Unique":"HF7uXr6yOgq9C0s5W9lMSQ-1","X-Mimecast-MFC-AGG-ID":"HF7uXr6yOgq9C0s5W9lMSQ_1763464740","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763464739; x=1764069539;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-gg\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=tZ+A23uQq6mOt5lWZkF3Ja4ZamVuPgE6Td9KWHvkjVU=;\n\tb=Mbw/Ed9VIXT30EDf6imR2p14PLhZZOh4+0uw9h6hLX7CCoLbCyApl7O2qszbMYT+j2\n\t9WOEpIRCt21Q6l+xSwUrV56emRh9b5+SmwRIIc7cYqWvRgu+tm4RngetVSIY1m7e1oSQ\n\tnW6UmkmcKIAxYBqqoo6qpaEVOPQOL5rubYA11KPblkgBzoxEEHxtzVN6fs6Pd/hOYlAP\n\t7JFu76C+0hRN/nXMU7PTMk6qGwwas+5ofzGftt0XNguHavNm9hufFZusKVq+6uEyE3hW\n\twymPmPEmfTGfXLXtcigM8vboXYpdjWnqEfmXV9rLaONgWbw0yKLp6uAfMQ3bnVbRxkzR\n\tnjnQ==","X-Gm-Message-State":"AOJu0Yw0rkdeBFULJ3aGfXk3wHqXlCncARW1qTdyeJ1kDmEwlUPeYaoO\n\t40v6epnIUSmVYE+3UKAQrzVXviBSgXZX6xu+vk89j4qTNqoCNVi9NCORLER1E6tKDFJfATJXrrY\n\tEsmfE66w9vDhm/tjdoFhlyz25FVqTnHL2VI/2SsEC1g0TNuLrRzZ0xdNWHM6o31Zp9GIsT478aX\n\tvLJdfqOcO6t4nECBNTpk5rZFYl9f7dfQIxkgmEwTP5xGQhCLi6WXpKvwFZjTw=","X-Gm-Gg":"ASbGncvHsF1cAP6490LD3Af9IhkninXIjkyLGrPx8ATfbRMLbEcbNhgJXgHH8Rm05kH\n\tATtyfgHjlBENFAEh8ocvNxOWrqwWgQzoKh4FZW9uv+arJuL3tWYqT5NuNEZOL6i4jJe4RJA3IYI\n\tiKx4GMAhdgSAIQvir78VcnsI2m17O3QM03oQegiya+DNPMQjCGrGWUE5jAk5KEP+8/VlNOnrTIe\n\t3VbT9sHgxFaf7DPH/2dxwofNK7CGQfc7KIpDIY87tzVofjBNn0rYsAaEOGQRfutm2gkoREla9h4\n\tzXEVGSq9ikEkiEFJKjS9ZWygj8wOS+OEx2bvlgp4/ytZVM7w46V4q2vKcACZM5bjvOfjf2jpJZe\n\tXaejILNos1V3/xwCrxyRN/F1n","X-Received":["by 2002:a05:6000:220b:b0:42b:397f:8dd4 with SMTP id\n\tffacd0b85a97d-42b59373641mr13585001f8f.49.1763464739294; \n\tTue, 18 Nov 2025 03:18:59 -0800 (PST)","by 2002:a05:6000:220b:b0:42b:397f:8dd4 with SMTP id\n\tffacd0b85a97d-42b59373641mr13584974f8f.49.1763464738885; \n\tTue, 18 Nov 2025 03:18:58 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IFrbS3WG0Xv6t1NaX4diWnNebwy8Jk8xNJDJXEUZ74ZDDtqD/BDikuqeyC6bXPNwSmv8/xS8A==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH 5/7] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","In-Reply-To":"<f7759c79-c05f-482c-a4ce-c661265d60b1@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Mon,\n\t17 Nov 2025  12:09:21 +0100\")","References":"<20251112082715.17823-1-mzamazal@redhat.com>\n\t<20251112082715.17823-6-mzamazal@redhat.com>\n\t<f7759c79-c05f-482c-a4ce-c661265d60b1@ideasonboard.com>","Date":"Tue, 18 Nov 2025 12:18:57 +0100","Message-ID":"<85zf8jk2qm.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":"V5uD3gCvatEvArFaIj5pmWRG_e2wBT8oMPOUERyAeQE_1763464740","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}}]