{"id":25997,"url":"https://patchwork.libcamera.org/api/patches/25997/?format=json","web_url":"https://patchwork.libcamera.org/patch/25997/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260128114402.31570-5-mzamazal@redhat.com>","date":"2026-01-28T11:43:51","name":"[v5,04/15] libcamera: ipa: simple: Rename \"ccm\" identifiers not specific to CCM","commit_ref":"a7a0852662f8c7154c68fe29085c04e89db39f3c","pull_url":null,"state":"accepted","archived":false,"hash":"f124f9e89e5682cee71c7956f309d36ad378cdc1","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25997/mbox/","series":[{"id":5748,"url":"https://patchwork.libcamera.org/api/series/5748/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5748","date":"2026-01-28T11:43:47","name":"Simple pipeline IPA cleanup","version":5,"mbox":"https://patchwork.libcamera.org/series/5748/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25997/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25997/checks/","tags":{},"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 74BEDC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Jan 2026 11:44:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 00D2061FDA;\n\tWed, 28 Jan 2026 12:44:26 +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 EE21661FC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jan 2026 12:44:23 +0100 (CET)","from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-474-BMkY8sHQMrKIOGk71hoWsw-1;\n\tWed, 28 Jan 2026 06:44:19 -0500","from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.12])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 978341955D88; Wed, 28 Jan 2026 11:44:18 +0000 (UTC)","from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.34.236])\n\tby mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 3817B19560B2; Wed, 28 Jan 2026 11:44:15 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"h3hDNIz2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1769600663;\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=ZVyUWhDya57rwrjPpLGWVabMQ8b1lvVJBYg49JSMlIk=;\n\tb=h3hDNIz2oXUSIALn87/jLDgmyBz0ajJ28ULUxq+W72O4f8Nprl95KBoX9jCrABuTAQmISR\n\tDQiinit5uUUcStBgAjHqtAQQ7zFA/30rBgM32RSBke/QNHLX3mMTxOiPLVAngWuJAE0GCQ\n\truKsV1vIlWofrvm/0LwuZy581+3Ivb8=","X-MC-Unique":"BMkY8sHQMrKIOGk71hoWsw-1","X-Mimecast-MFC-AGG-ID":"BMkY8sHQMrKIOGk71hoWsw_1769600658","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Robert Mader\n\t<robert.mader@collabora.com>","Subject":"[PATCH v5 04/15] libcamera: ipa: simple: Rename \"ccm\" identifiers\n\tnot specific to CCM","Date":"Wed, 28 Jan 2026 12:43:51 +0100","Message-ID":"<20260128114402.31570-5-mzamazal@redhat.com>","In-Reply-To":"<20260128114402.31570-1-mzamazal@redhat.com>","References":"<20260128114402.31570-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.12","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"-hvxTAOQjw54f_OX0Hrq1F0f_sigZWvmExS0u6UE_eg_1769600658","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=UTF-8","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>"},"content":"Let's rename the identifiers that are related to general colour\ncorrections applied by matrix operations, rather than directly to the\nsensor colour correction matrix.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nReviewed-by: Robert Mader<robert.mader@collabora.com>\nSigned-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(-)","diff":"diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\nindex 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}\ndiff --git a/src/ipa/simple/algorithms/lut.h b/src/ipa/simple/algorithms/lut.h\nindex 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 */\n","prefixes":["v5","04/15"]}