Patch Detail
Show a patch.
GET /api/patches/14615/?format=api
{ "id": 14615, "url": "https://patchwork.libcamera.org/api/patches/14615/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14615/", "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": "<20211116152443.56512-1-jeanmichel.hautbois@ideasonboard.com>", "date": "2021-11-16T15:24:44", "name": "[libcamera-devel,v2] ipa: ipu3: agc: Remove the threshold for the histogram calculation", "commit_ref": "d9a2a1f703273a28b001dee40fddd378bba7a1b6", "pull_url": null, "state": "accepted", "archived": false, "hash": "ac57ea0e13f4be0487e7fd7d1950097d0061860c", "submitter": { "id": 75, "url": "https://patchwork.libcamera.org/api/people/75/?format=api", "name": "Jean-Michel Hautbois", "email": "jeanmichel.hautbois@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14615/mbox/", "series": [ { "id": 2721, "url": "https://patchwork.libcamera.org/api/series/2721/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2721", "date": "2021-11-16T15:24:44", "name": "[libcamera-devel,v2] ipa: ipu3: agc: Remove the threshold for the histogram calculation", "version": 2, "mbox": "https://patchwork.libcamera.org/series/2721/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14615/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14615/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 00393BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Nov 2021 15:25:36 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3192F6038A;\n\tTue, 16 Nov 2021 16:25:36 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8A8760120\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Nov 2021 16:25:34 +0100 (CET)", "from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:c966:1d53:a935:70a0])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 76C30547;\n\tTue, 16 Nov 2021 16:25:34 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"tXXArIXx\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637076334;\n\tbh=lQrqCCxL7/it11RObVCPaA3ixkWPL/uFWzvHO6vk+iM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=tXXArIXxAICyk2V2Xaq7tiS711GOivBFSvei3xpobxQ0oYFCVQ4iNiUfthZGLHNly\n\tIHurw8qwQAuYPG3qm3SuCLZ84tY3klyvZ6RKIWdy2hG0KhajGd4+Zy3F+7dxgVI59X\n\tX7Nd9Vv38Id6S7OtDB74uqJnNQeRfSm21ZG4iZD4=", "From": "Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 16 Nov 2021 16:24:44 +0100", "Message-Id": "<20211116152443.56512-1-jeanmichel.hautbois@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2] ipa: ipu3: agc: Remove the threshold\n\tfor the histogram calculation", "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": "Until commit f8f07f9468c6 (ipa: ipu3: agc: Improve gain calculation)\nthe gain to apply on the exposure value was only using the histogram.\nNow that the global brightness of the frame is estimated too, we don't\nneed to remove part of the saturated pixels from the equation anymore.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\nv2: - remove the empty histogram test\n - don't take Kieran's R-B tag as it needs testing again\n\n---\n src/ipa/ipu3/algorithms/agc.cpp | 32 +++++++++-----------------------\n 1 file changed, 9 insertions(+), 23 deletions(-)", "diff": "diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex 4e424857..bd02c474 100644\n--- a/src/ipa/ipu3/algorithms/agc.cpp\n+++ b/src/ipa/ipu3/algorithms/agc.cpp\n@@ -58,12 +58,6 @@ static constexpr uint32_t knumHistogramBins = 256;\n /* Target value to reach for the top 2% of the histogram */\n static constexpr double kEvGainTarget = 0.5;\n \n-/*\n- * Maximum ratio of saturated pixels in a cell for the cell to be considered\n- * non-saturated and counted by the AGC algorithm.\n- */\n-static constexpr uint32_t kMinCellsPerZoneRatio = 255 * 20 / 100;\n-\n /* Number of frames to wait before calculating stats on minimum exposure */\n static constexpr uint32_t kNumStartupFrames = 10;\n \n@@ -133,27 +127,19 @@ void Agc::measureBrightness(const ipu3_uapi_stats_3a *stats,\n \t\t\t\t\t&stats->awb_raw_buffer.meta_data[cellPosition]\n \t\t\t\t);\n \n-\t\t\tif (cell->sat_ratio <= kMinCellsPerZoneRatio) {\n-\t\t\t\tuint8_t gr = cell->Gr_avg;\n-\t\t\t\tuint8_t gb = cell->Gb_avg;\n-\t\t\t\t/*\n-\t\t\t\t * Store the average green value to estimate the\n-\t\t\t\t * brightness. Even the overexposed pixels are\n-\t\t\t\t * taken into account.\n-\t\t\t\t */\n-\t\t\t\thist[(gr + gb) / 2]++;\n-\t\t\t}\n+\t\t\tuint8_t gr = cell->Gr_avg;\n+\t\t\tuint8_t gb = cell->Gb_avg;\n+\t\t\t/*\n+\t\t\t * Store the average green value to estimate the\n+\t\t\t * brightness. Even the overexposed pixels are\n+\t\t\t * taken into account.\n+\t\t\t */\n+\t\t\thist[(gr + gb) / 2]++;\n \t\t}\n \t}\n \n-\tHistogram cumulativeHist = Histogram(Span<uint32_t>(hist));\n \t/* Estimate the quantile mean of the top 2% of the histogram */\n-\tif (cumulativeHist.total() == 0) {\n-\t\t/* Force the value as histogram is empty */\n-\t\tiqMean_ = knumHistogramBins - 0.5;\n-\t} else {\n-\t\tiqMean_ = cumulativeHist.interQuantileMean(0.98, 1.0);\n-\t}\n+\tiqMean_ = Histogram(Span<uint32_t>(hist)).interQuantileMean(0.98, 1.0);\n }\n \n /**\n", "prefixes": [ "libcamera-devel", "v2" ] }