[{"id":37947,"web_url":"https://patchwork.libcamera.org/comment/37947/","msgid":"<833a6284-a6fd-40d3-b412-7be4472deb2e@collabora.com>","date":"2026-01-26T14:55:37","subject":"Re: [PATCH v4 04/15] libcamera: ipa: simple: Rename \"ccm\"\n\tidentifiers not specific to CCM","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Reviewed-by: Robert Mader<robert.mader@collabora.com>\n\nOn 22.01.26 17:19, Milan Zamazal wrote:\n> Let's rename the identifiers that are related to general colour\n> corrections applied by matrix operations, rather than directly to the\n> sensor colour correction matrix.\n>\n> Reviewed-by: Barnabás Pőcze<barnabas.pocze@ideasonboard.com>\n> Signed-off-by: Milan Zamazal<mzamazal@redhat.com>\n> ---\n>   src/ipa/simple/algorithms/lut.cpp | 32 +++++++++++++++----------------\n>   src/ipa/simple/algorithms/lut.h   |  2 +-\n>   2 files changed, 17 insertions(+), 17 deletions(-)\n>\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index c19b34482..5c4683fd8 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2024-2025, Red Hat Inc.\n> + * Copyright (C) 2024-2026, Red Hat Inc.\n>    *\n>    * Color lookup tables construction\n>    */\n> @@ -89,7 +89,7 @@ void Lut::updateGammaTable(IPAContext &context)\n>   \tcontext.activeState.gamma.contrastExp = contrastExp;\n>   }\n>   \n> -int16_t Lut::ccmValue(unsigned int i, float ccm) const\n> +int16_t Lut::matrixValue(unsigned int i, float ccm) const\n>   {\n>   \treturn std::round(i * ccm);\n>   }\n> @@ -128,25 +128,25 @@ void Lut::prepare(IPAContext &context,\n>   \t\t\tparams->blue[i] = gammaTable[static_cast<unsigned int>(lutGains.b())];\n>   \t\t}\n>   \t} else if (context.activeState.matrixChanged || gammaUpdateNeeded) {\n> -\t\tMatrix<float, 3, 3> gainCcm = { { 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 ccm = context.activeState.ccm * gainCcm;\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 &red = params->redCcm;\n>   \t\tauto &green = params->greenCcm;\n>   \t\tauto &blue = params->blueCcm;\n> -\t\tparams->ccm = ccm;\n> +\t\tparams->ccm = matrix;\n>   \t\tif (!context.gpuIspEnabled) {\n>   \t\t\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n> -\t\t\t\tred[i].r = ccmValue(i, ccm[0][0]);\n> -\t\t\t\tred[i].g = ccmValue(i, ccm[1][0]);\n> -\t\t\t\tred[i].b = ccmValue(i, ccm[2][0]);\n> -\t\t\t\tgreen[i].r = ccmValue(i, ccm[0][1]);\n> -\t\t\t\tgreen[i].g = ccmValue(i, ccm[1][1]);\n> -\t\t\t\tgreen[i].b = ccmValue(i, ccm[2][1]);\n> -\t\t\t\tblue[i].r = ccmValue(i, ccm[0][2]);\n> -\t\t\t\tblue[i].g = ccmValue(i, ccm[1][2]);\n> -\t\t\t\tblue[i].b = ccmValue(i, ccm[2][2]);\n> +\t\t\t\tred[i].r = matrixValue(i, matrix[0][0]);\n> +\t\t\t\tred[i].g = matrixValue(i, matrix[1][0]);\n> +\t\t\t\tred[i].b = matrixValue(i, matrix[2][0]);\n> +\t\t\t\tgreen[i].r = matrixValue(i, matrix[0][1]);\n> +\t\t\t\tgreen[i].g = matrixValue(i, matrix[1][1]);\n> +\t\t\t\tgreen[i].b = matrixValue(i, matrix[2][1]);\n> +\t\t\t\tblue[i].r = matrixValue(i, matrix[0][2]);\n> +\t\t\t\tblue[i].g = matrixValue(i, matrix[1][2]);\n> +\t\t\t\tblue[i].b = matrixValue(i, matrix[2][2]);\n>   \t\t\t\tparams->gammaLut[i] = gammaTable[i / div];\n>   \t\t\t}\n>   \t\t}\n> diff --git a/src/ipa/simple/algorithms/lut.h b/src/ipa/simple/algorithms/lut.h\n> index ba8b9021b..0eafd0695 100644\n> --- a/src/ipa/simple/algorithms/lut.h\n> +++ b/src/ipa/simple/algorithms/lut.h\n> @@ -38,7 +38,7 @@ public:\n>   \n>   private:\n>   \tvoid updateGammaTable(IPAContext &context);\n> -\tint16_t ccmValue(unsigned int i, float ccm) const;\n> +\tint16_t matrixValue(unsigned int i, float ccm) const;\n>   };\n>   \n>   } /* namespace ipa::soft::algorithms */","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 A86A7C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jan 2026 14:55:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8DFBC61FCE;\n\tMon, 26 Jan 2026 15:55:47 +0100 (CET)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n\t[136.143.188.12])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0CD4D61A35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jan 2026 15:55:44 +0100 (CET)","by mx.zohomail.com with SMTPS id 17694393400338.019364662627822;\n\tMon, 26 Jan 2026 06:55:40 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"attlAW6F\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1769439341; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=j8eHqcclg02TExddzgVz/suHIpcBNivD2WZNl0UU1Pscx4ybgHbXJZE+m+ntE5yPMmyBnW0jpVh2UFOzmuGx6r/GkBFUD4cBaOumFyr1uNDYGUNRBCh+GO1LY4omcXr5dika1yw5SVKxmjz0U7deig/xAKRPVlSL/JslH4Cek9Q=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1769439341;\n\th=Content-Type:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=IHiWMqMKGtCh5x1Lt3ogRug6SPzwLGJswhpKYxnKsqo=; \n\tb=b6tyMc9UgShWnVcetZzSDy5zBjkrioMOj8zLTSmYnGGxbJdD/TC8waMoxgF8TOWf4TYC7mJpQ6ibOLOhAJsqdL6tbBa/PVPYGVCA2yyK7szRjBTul0tZQl6GRvTqotF6QRj+xb0ySmPOPx+wqoqG/6b6K9jseJWo/8T9Sc1kvvE=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1769439341;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Content-Type:Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Message-Id:Reply-To:Cc;\n\tbh=IHiWMqMKGtCh5x1Lt3ogRug6SPzwLGJswhpKYxnKsqo=;\n\tb=attlAW6FUcfQjgKaWGVA7y76MRi7MHRdnn9Mggb7gClPCbizFjRLpCVelQK3AWFu\n\tEpg4Rsf9jr6Ie2j7gATOnUoFVVeyJ5b1MPEWHyDtQFFKI4Cj8ik4eKOKHglzi1+EIBl\n\tj4X4Osdhl2mMXqNbqVlT9O+QkHqw0o0/SbRDQ65M=","Content-Type":"multipart/alternative;\n\tboundary=\"------------vdJg0XafzqQB4d5XLd5zEsEF\"","Message-ID":"<833a6284-a6fd-40d3-b412-7be4472deb2e@collabora.com>","Date":"Mon, 26 Jan 2026 15:55:37 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 04/15] libcamera: ipa: simple: Rename \"ccm\"\n\tidentifiers not specific to CCM","To":"libcamera-devel@lists.libcamera.org","References":"<20260122161935.208562-1-mzamazal@redhat.com>\n\t<20260122161935.208562-5-mzamazal@redhat.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<20260122161935.208562-5-mzamazal@redhat.com>","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>"}}]