Patch Detail
Show a patch.
GET /api/patches/19934/?format=api
{ "id": 19934, "url": "https://patchwork.libcamera.org/api/patches/19934/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19934/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20240423182000.1527425-6-mzamazal@redhat.com>", "date": "2024-04-23T18:20:00", "name": "[5/5] libcamera: software_isp: Remove DebayerParams::kGain10", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "03d36cef6503de72158f5f0149184433da86843f", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19934/mbox/", "series": [ { "id": 4268, "url": "https://patchwork.libcamera.org/api/series/4268/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4268", "date": "2024-04-23T18:19:55", "name": "Software ISP levels cleanup", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4268/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19934/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19934/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 382E8BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Apr 2024 18:20:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7A93633F3;\n\tTue, 23 Apr 2024 20:20:30 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 276F1633EC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 20:20:26 +0200 (CEST)", "from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-683-5yQPMmqpNH2ttyvioeNpzw-1;\n\tTue, 23 Apr 2024 14:20:23 -0400", "from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1])\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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id A526929AC012\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 18:20:23 +0000 (UTC)", "from nuthatch.redhat.com (unknown [10.45.225.63])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id E6C9649102;\n\tTue, 23 Apr 2024 18:20:22 +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=\"Rtn7u+fi\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1713896425;\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=7138dUVxFMU7AXzdbakfQfOpBfpMWwkz4oaLCF5Pk/U=;\n\tb=Rtn7u+fiBHmBI9ksH/IuNpf2j/TZLAWW9xXNLXTM5RLi1fcmyzshZrDh5K+LvZwQMyGLlJ\n\tyKQM6WbboVMhG7LLTklNmPUJbR3TpsTSMqdFiw1vaGMW+ofOPTEz25RvYKGJSGPXEt5viH\n\tbuDRcF/o7cIccNUI3k7f5biB2OzVQCo=", "X-MC-Unique": "5yQPMmqpNH2ttyvioeNpzw-1", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>", "Subject": "[PATCH 5/5] libcamera: software_isp: Remove DebayerParams::kGain10", "Date": "Tue, 23 Apr 2024 20:20:00 +0200", "Message-ID": "<20240423182000.1527425-6-mzamazal@redhat.com>", "In-Reply-To": "<20240423182000.1527425-1-mzamazal@redhat.com>", "References": "<20240423182000.1527425-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.1", "X-Mimecast-Spam-Score": "0", "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 constant is used in a single place internally and doesn't belong to\nDebayerParams anymore. Let's use 256 directly.\n\nCompletes software ISP TODO #4.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n .../internal/software_isp/debayer_params.h | 1 -\n src/ipa/simple/soft_simple.cpp | 3 +--\n src/libcamera/software_isp/TODO | 13 -------------\n src/libcamera/software_isp/debayer.cpp | 5 -----\n 4 files changed, 1 insertion(+), 21 deletions(-)", "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 09f4ff00..6aaa7d4c 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -16,7 +16,6 @@\n namespace libcamera {\n \n struct DebayerParams {\n-\tstatic constexpr unsigned int kGain10 = 256;\n \tstatic constexpr unsigned int kRGBLookupSize = 256;\n \n \tusing ColorLookupTable = std::array<uint8_t, kRGBLookupSize>;\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex b2f4d308..5298836c 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -300,8 +300,7 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n \n \tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n \t\tconstexpr unsigned int div =\n-\t\t\tDebayerParams::kRGBLookupSize * DebayerParams::kGain10 /\n-\t\t\tkGammaLookupSize;\n+\t\t\tDebayerParams::kRGBLookupSize * 256 / kGammaLookupSize;\n \t\tunsigned int idx;\n \n \t\t/* Apply gamma after gain! */\ndiff --git a/src/libcamera/software_isp/TODO b/src/libcamera/software_isp/TODO\nindex fcb02588..f8f00139 100644\n--- a/src/libcamera/software_isp/TODO\n+++ b/src/libcamera/software_isp/TODO\n@@ -72,19 +72,6 @@ stats in hardware, such as the i.MX7), but please keep it on your radar.\n \n ---\n \n-4. Hide internal representation of gains from callers\n-\n-> struct DebayerParams {\n-> \tstatic constexpr unsigned int kGain10 = 256;\n-\n-Forcing the caller to deal with the internal representation of gains\n-isn't nice, especially given that it precludes implementing gains of\n-different precisions in different backend. Wouldn't it be better to pass\n-the values as floating point numbers, and convert them to the internal\n-representation in the implementation of process() before using them ?\n-\n----\n-\n 5. Store ISP parameters in per-frame buffers\n \n > /**\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex ac438a33..548c2ccd 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -18,11 +18,6 @@ namespace libcamera {\n * \\brief Struct to hold the debayer parameters.\n */\n \n-/**\n- * \\var DebayerParams::kGain10\n- * \\brief const value for 1.0 gain\n- */\n-\n /**\n * \\var DebayerParams::kRGBLookupSize\n * \\brief Size of a color lookup table\n", "prefixes": [ "5/5" ] }