Patch Detail
Show a patch.
GET /api/1.1/patches/25092/?format=api
{ "id": 25092, "url": "https://patchwork.libcamera.org/api/1.1/patches/25092/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25092/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20251120104548.80268-7-mzamazal@redhat.com>", "date": "2025-11-20T10:45:41", "name": "[RFC,v2,06/13] libcamera: ipa: simple: Initialise the general correction matrix", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "7bbe4065eda0c4883b642638c66d5555c658d3a1", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/1.1/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25092/mbox/", "series": [ { "id": 5597, "url": "https://patchwork.libcamera.org/api/1.1/series/5597/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5597", "date": "2025-11-20T10:45:35", "name": "Simple pipeline IPA cleanup", "version": 2, "mbox": "https://patchwork.libcamera.org/series/5597/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25092/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25092/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 E9675C3334\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Nov 2025 10:46:21 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A1E560A8A;\n\tThu, 20 Nov 2025 11:46:21 +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 27D5660AA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Nov 2025 11:46:19 +0100 (CET)", "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-178-6d_zshY2PmalJRJcHYcr_w-1;\n\tThu, 20 Nov 2025 05:46:15 -0500", "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.111])\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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 2F2D818002CA; Thu, 20 Nov 2025 10:46:14 +0000 (UTC)", "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.34.39])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id A1B8D1800451; Thu, 20 Nov 2025 10:46:12 +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=\"Jy+Uox/n\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1763635577;\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=y+wNNCi9XyNQtDmcHXH++PVnjmltzN0lcLIrkG+xR9g=;\n\tb=Jy+Uox/nJ8jDBtH8jZhZvMHvsXC1N8eQGBDN26oqU632YU1HpzyC7B3xVadR/C9yRb0YNp\n\tEKeFnkSaMij/nk2ki+tPNaa9jaKxidwyzz+iOVrt1vq6fxlMA17/eu/pZrKUtcmzyAqoqe\n\tUl7vM3WWSAix6uRkVemiZwh+byKw/JQ=", "X-MC-Unique": "6d_zshY2PmalJRJcHYcr_w-1", "X-Mimecast-MFC-AGG-ID": "6d_zshY2PmalJRJcHYcr_w_1763635574", "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>", "Subject": "[RFC PATCH v2 06/13] libcamera: ipa: simple: Initialise the general\n\tcorrection matrix", "Date": "Thu, 20 Nov 2025 11:45:41 +0100", "Message-ID": "<20251120104548.80268-7-mzamazal@redhat.com>", "In-Reply-To": "<20251120104548.80268-1-mzamazal@redhat.com>", "References": "<20251120104548.80268-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "G6IQS2tIG0wurzfLZKmd81xH2OvHz3xzu_A4UYrPPAs_1763635574", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "The combined matrix must be reset to the initial value before each frame\nis prepared. This must be done outside algorithms because any of the\nalgorithms may be disabled while the matrix must be always initialised.\n\nLet's initialise the combined matrix to the identity matrix (which keeps\nthe pixel values unchanged) in software ISP just before calling\n`prepare' on the algorithms.\n\nMatrix updates can no longer be skipped in ccm.cpp, otherwise the CCM\nwon't be applied if there is no temperature or saturation change.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/ipa/simple/algorithms/ccm.cpp | 28 +++++++++++++---------------\n src/ipa/simple/algorithms/ccm.h | 1 +\n src/ipa/simple/soft_simple.cpp | 2 ++\n 3 files changed, 16 insertions(+), 15 deletions(-)", "diff": "diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\nindex a3e8cd6c4..52dd11aaa 100644\n--- a/src/ipa/simple/algorithms/ccm.cpp\n+++ b/src/ipa/simple/algorithms/ccm.cpp\n@@ -91,24 +91,22 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,\n \tconst unsigned int ct = context.activeState.awb.temperatureK;\n \n \t/* Change CCM only on saturation or bigger temperature changes. */\n-\tif (frame > 0 &&\n-\t utils::abs_diff(ct, lastCt_) < kTemperatureThreshold &&\n-\t saturation == lastSaturation_) {\n-\t\tframeContext.ccm = context.activeState.ccm;\n-\t\treturn;\n+\tif (frame == 0 ||\n+\t utils::abs_diff(ct, lastCt_) >= kTemperatureThreshold ||\n+\t saturation != lastSaturation_) {\n+\t\tcurrentCcm_ = ccm_.getInterpolated(ct);\n+\t\tif (saturation)\n+\t\t\tapplySaturation(currentCcm_, saturation.value());\n+\t\tlastCt_ = ct;\n+\t\tlastSaturation_ = saturation;\n+\t\tcontext.activeState.matrixChanged = true;\n \t}\n \n-\tlastCt_ = ct;\n-\tlastSaturation_ = saturation;\n-\tMatrix<float, 3, 3> ccm = ccm_.getInterpolated(ct);\n-\tif (saturation)\n-\t\tapplySaturation(ccm, saturation.value());\n-\n-\tcontext.activeState.combinedMatrix = ccm;\n-\tcontext.activeState.ccm = ccm;\n+\tcontext.activeState.combinedMatrix =\n+\t\tcurrentCcm_ * context.activeState.combinedMatrix;\n+\tcontext.activeState.ccm = currentCcm_;\n \tframeContext.saturation = saturation;\n-\tcontext.activeState.matrixChanged = true;\n-\tframeContext.ccm = ccm;\n+\tframeContext.ccm = currentCcm_;\n }\n \n void Ccm::process([[maybe_unused]] IPAContext &context,\ndiff --git a/src/ipa/simple/algorithms/ccm.h b/src/ipa/simple/algorithms/ccm.h\nindex 8279a3d59..c29f394f0 100644\n--- a/src/ipa/simple/algorithms/ccm.h\n+++ b/src/ipa/simple/algorithms/ccm.h\n@@ -47,6 +47,7 @@ private:\n \tunsigned int lastCt_;\n \tstd::optional<float> lastSaturation_;\n \tInterpolator<Matrix<float, 3, 3>> ccm_;\n+\tMatrix<float, 3, 3> currentCcm_;\n };\n \n } /* namespace ipa::soft::algorithms */\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex b147aca2e..98582587c 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -296,6 +296,8 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n \n void IPASoftSimple::computeParams(const uint32_t frame)\n {\n+\tcontext_.activeState.combinedMatrix = Matrix<float, 3, 3>::identity();\n+\n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n \tfor (auto const &algo : algorithms())\n \t\talgo->prepare(context_, frame, frameContext, params_);\n", "prefixes": [ "RFC", "v2", "06/13" ] }