Patch Detail
Show a patch.
GET /api/1.1/patches/25936/?format=api
{ "id": 25936, "url": "https://patchwork.libcamera.org/api/1.1/patches/25936/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25936/", "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": "<20260122161935.208562-12-mzamazal@redhat.com>", "date": "2026-01-22T16:19:31", "name": "[v4,11/15] libcamera: ipa: simple: Use float type for adjustment controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "8b538a3c1252aad7104cb89cf5f7e86278c81c7d", "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/25936/mbox/", "series": [ { "id": 5733, "url": "https://patchwork.libcamera.org/api/1.1/series/5733/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5733", "date": "2026-01-22T16:19:20", "name": "Simple pipeline IPA cleanup", "version": 4, "mbox": "https://patchwork.libcamera.org/series/5733/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25936/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25936/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 D3298BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jan 2026 16:20:39 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8DE7061FD1;\n\tThu, 22 Jan 2026 17:20:39 +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 47AD761FC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Jan 2026 17:20:38 +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-376-nQx9i2Y2P1CuaQf8bZFOWQ-1;\n\tThu, 22 Jan 2026 11:20:34 -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 E246F180044D; Thu, 22 Jan 2026 16:20:32 +0000 (UTC)", "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.45.224.97])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 0F3DA1800577; Thu, 22 Jan 2026 16:20:30 +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=\"CJH00/Hi\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1769098837;\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=cl8ga13jeNy1VyVUMmG0mXproifV0Y4zXuXjfejjGLk=;\n\tb=CJH00/Hi8FfYlWF0Wnvn8WfNdBq4pmzU30+AqTsFd6lzn+gvvGzUFN91cLSo3sfP/HbJ0I\n\tEM1x7JdqkIssQU7h5mBBzcItbY+Giz46SpngBvjdAOra2q7QmceMvuBJNEdwEOsRGJVKqW\n\tHDGoTG2awXFlk3IfcFQmNqWNp6vnr/I=", "X-MC-Unique": "nQx9i2Y2P1CuaQf8bZFOWQ-1", "X-Mimecast-MFC-AGG-ID": "nQx9i2Y2P1CuaQf8bZFOWQ_1769098833", "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": "[PATCH v4 11/15] libcamera: ipa: simple: Use float type for\n\tadjustment controls", "Date": "Thu, 22 Jan 2026 17:19:31 +0100", "Message-ID": "<20260122161935.208562-12-mzamazal@redhat.com>", "In-Reply-To": "<20260122161935.208562-1-mzamazal@redhat.com>", "References": "<20260122161935.208562-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": "SAa2WTtr8kZwf61fN0NtwyDZQqM1N21lSdO93Lm5Ow8_1769098833", "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": "control_ids.h defines the contrast type as float, let's use the same in\nsimple IPA, instead of double. Saturation and gamma already use float,\nexcept for the knobs initializers, let's use float for the knobs too.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n include/libcamera/internal/software_isp/debayer_params.h | 2 +-\n src/ipa/simple/algorithms/adjust.cpp | 4 ++--\n src/ipa/simple/algorithms/lut.cpp | 2 +-\n src/ipa/simple/ipa_context.h | 8 ++++----\n 4 files changed, 8 insertions(+), 8 deletions(-)", "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 256c7d43d..2d69bd295 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -59,7 +59,7 @@ struct DebayerParams {\n \tMatrix<float, 3, 3> ccm;\n \tRGB<float> blackLevel;\n \tfloat gamma;\n-\tdouble contrastExp;\n+\tfloat contrastExp;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/simple/algorithms/adjust.cpp b/src/ipa/simple/algorithms/adjust.cpp\nindex a067f7b84..a8b7c5ab6 100644\n--- a/src/ipa/simple/algorithms/adjust.cpp\n+++ b/src/ipa/simple/algorithms/adjust.cpp\n@@ -34,8 +34,8 @@ int Adjust::configure(IPAContext &context,\n \t\t [[maybe_unused]] const IPAConfigInfo &configInfo)\n {\n \tcontext.activeState.knobs.gamma = kDefaultGamma;\n-\tcontext.activeState.knobs.contrast = std::optional<double>();\n-\tcontext.activeState.knobs.saturation = std::optional<double>();\n+\tcontext.activeState.knobs.contrast = std::optional<float>();\n+\tcontext.activeState.knobs.saturation = std::optional<float>();\n \n \treturn 0;\n }\ndiff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\nindex d8e92c613..fd442259a 100644\n--- a/src/ipa/simple/algorithms/lut.cpp\n+++ b/src/ipa/simple/algorithms/lut.cpp\n@@ -40,7 +40,7 @@ void Lut::updateGammaTable(IPAContext &context)\n \tconst auto gamma = 1.0 / context.activeState.knobs.gamma;\n \tconst auto contrast = context.activeState.knobs.contrast.value_or(1.0);\n \t/* Convert 0..2 to 0..infinity; avoid actual inifinity at tan(pi/2) */\n-\tdouble contrastExp = tan(std::clamp(contrast * M_PI_4, 0.0, M_PI_2 - 0.00001));\n+\tfloat contrastExp = tan(std::clamp(contrast * M_PI_4, 0.0, M_PI_2 - 0.00001));\n \n \tif (!context.gpuIspEnabled) {\n \t\tauto &gammaTable = context.activeState.gamma.gammaTable;\ndiff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\nindex eeade9d35..293e35b71 100644\n--- a/src/ipa/simple/ipa_context.h\n+++ b/src/ipa/simple/ipa_context.h\n@@ -58,8 +58,8 @@ struct IPAActiveState {\n \t\tstd::array<double, kGammaLookupSize> gammaTable;\n \t\tuint8_t blackLevel;\n \t\tfloat gamma;\n-\t\tdouble contrast;\n-\t\tdouble contrastExp;\n+\t\tfloat contrast;\n+\t\tfloat contrastExp;\n \t} gamma;\n \n \tMatrix<float, 3, 3> combinedMatrix;\n@@ -68,7 +68,7 @@ struct IPAActiveState {\n \tstruct {\n \t\tfloat gamma;\n \t\t/* 0..2 range, 1.0 = normal */\n-\t\tstd::optional<double> contrast;\n+\t\tstd::optional<float> contrast;\n \t\tstd::optional<float> saturation;\n \t} knobs;\n };\n@@ -87,7 +87,7 @@ struct IPAFrameContext : public FrameContext {\n \t} gains;\n \n \tfloat gamma;\n-\tstd::optional<double> contrast;\n+\tstd::optional<float> contrast;\n \tstd::optional<float> saturation;\n };\n \n", "prefixes": [ "v4", "11/15" ] }