[{"id":37809,"web_url":"https://patchwork.libcamera.org/comment/37809/","msgid":"<570db511-350d-4f06-a34a-075bd2fe49f5@ideasonboard.com>","date":"2026-01-21T16:15:02","subject":"Re: [PATCH v3 05/14] 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":"2026. 01. 14. 12:30 keltezéssel, Milan Zamazal írta:\n> Let's introduce IPAActiveState::combinedMatrix 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> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n\nSeems fine to me.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\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..a3e8cd6c4 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.combinedMatrix = 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 5c4683fd8..141ea17fa 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -131,7 +131,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.combinedMatrix * 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 ea1852cd4..58dcad290 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -63,6 +63,7 @@ struct IPAActiveState {\n>   \t} gamma;\n>   \n>   \tMatrix<float, 3, 3> ccm;\n> +\tMatrix<float, 3, 3> combinedMatrix;\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 9E128BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Jan 2026 16:15:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F156661FCC;\n\tWed, 21 Jan 2026 17:15:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2044B61FBB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Jan 2026 17:15:06 +0100 (CET)","from [192.168.33.24] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2021A1C6;\n\tWed, 21 Jan 2026 17:14:34 +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=\"tBWqo4lV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769012074;\n\tbh=9NMMV4jTKRqb6H6fNjI4D/uOlunYyjfTE8QWoiXZhYI=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=tBWqo4lVl/yUxioAM6p11csZaQIBBhQKXrnuM4seI3Dx4c+yGkbAsD+PbUZFvZP6U\n\tR+KmpstN4Ms1G3DtHT1cTUmUDKuutWVRmUs0asIWCXrLyhtP7JbNfUb2KgSXOg7JZa\n\tfjx2fndluGgCGkTmATzM1nSCk4VEmgRr/WJON2p0=","Message-ID":"<570db511-350d-4f06-a34a-075bd2fe49f5@ideasonboard.com>","Date":"Wed, 21 Jan 2026 17:15:02 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 05/14] libcamera: ipa: simple: Introduce a general\n\tcorrection matrix","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","References":"<20260114113016.25162-1-mzamazal@redhat.com>\n\t<20260114113016.25162-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":"<20260114113016.25162-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>"}}]