{"id":14450,"url":"https://patchwork.libcamera.org/api/1.1/patches/14450/?format=json","web_url":"https://patchwork.libcamera.org/patch/14450/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20211103130445.64458-1-jeanmichel.hautbois@ideasonboard.com>","date":"2021-11-03T13:04:45","name":"[libcamera-devel] ipa: ipu3: agc: Remove the saturation ratio test","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"e064b2620add89f692269c1393e59843594333c6","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14450/mbox/","series":[{"id":2687,"url":"https://patchwork.libcamera.org/api/1.1/series/2687/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2687","date":"2021-11-03T13:04:45","name":"[libcamera-devel] ipa: ipu3: agc: Remove the saturation ratio test","version":1,"mbox":"https://patchwork.libcamera.org/series/2687/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14450/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14450/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 4E434BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Nov 2021 13:04:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6DC616033A;\n\tWed,  3 Nov 2021 14:04:50 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B181B600B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Nov 2021 14:04:49 +0100 (CET)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:de1a:262d:3a68:a7f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 51A4E143C;\n\tWed,  3 Nov 2021 14:04:49 +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=\"J4Q1Q/iS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635944689;\n\tbh=oEcIV/Oa2BqGDLMRkcJ4UHNT40zGqFFMHkuPiM44Bvk=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=J4Q1Q/iS2xuDtFeRdamj32j3d9+OhTSo/cErqQwMJ96VRyUeXMwYGcrB+rbUcHhyo\n\tzJ+ycC/XfUGoTM6aOz6DPIsWzQK3bQsRP3NzegBq2xHjxFmTr8izXsNqaPNJdnx7Xv\n\tOQueUG4LLAKDPTmLtNBilhUZ1NnF6pHb4psihGjQ=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  3 Nov 2021 14:04:45 +0100","Message-Id":"<20211103130445.64458-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] ipa: ipu3: agc: Remove the saturation\n\tratio test","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":"When the histogram is calculated, we check if a cell is saturated or not\nbefore cumulating its green value. This is wrong, and it can lead to an\nempty histogram in case of a fully saturated frame.\n\nThis case is reported in bug #84.\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/agc.cpp | 18 ++++++++----------\n 1 file changed, 8 insertions(+), 10 deletions(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex b5d736c1..7ac8dfb2 100644\n--- a/src/ipa/ipu3/algorithms/agc.cpp\n+++ b/src/ipa/ipu3/algorithms/agc.cpp\n@@ -124,16 +124,14 @@ 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 == 0) {\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","prefixes":["libcamera-devel"]}