{"id":22835,"url":"https://patchwork.libcamera.org/api/1.1/patches/22835/?format=json","web_url":"https://patchwork.libcamera.org/patch/22835/","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":"<20250223230403.1226-14-laurent.pinchart@ideasonboard.com>","date":"2025-02-23T23:04:01","name":"[13/15] ipa: rkisp1: awb: Don't calculate RGB means if stats are missing","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a29f98909f4b345a96995d4d6c35cfc325dc56d7","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22835/mbox/","series":[{"id":5012,"url":"https://patchwork.libcamera.org/api/1.1/series/5012/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5012","date":"2025-02-23T23:03:48","name":"libipa: awb: Drive-by fixes","version":1,"mbox":"https://patchwork.libcamera.org/series/5012/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22835/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22835/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 ABC9BBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 23 Feb 2025 23:04:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 58A52686EF;\n\tMon, 24 Feb 2025 00:04:57 +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 EF2FA686D9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Feb 2025 00:04:38 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EE2B482A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Feb 2025 00:03:12 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Fw/Lk/JN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740351793;\n\tbh=G4gewnWK8OyfuhD2zFrCm4NqwzDTbAcZCjL60GYX7OA=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=Fw/Lk/JNcEWOMI0VTfqtZ2dRxJBOebfJYyGEThfNgK5Oq+iWdKjMz5nSpoNCAUwKR\n\trP9Lo+Jz/7F2DHMq5dNlw8+SCIFjr+X7I72BbEw8ZNz0WdsqtY80JtI0qWfeWmH3cy\n\thM0GcvwLN6EJ1tXju8yJqwjz7a7RS9HqMbjs9QPw=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH 13/15] ipa: rkisp1: awb: Don't calculate RGB means if stats\n\tare missing","Date":"Mon, 24 Feb 2025 01:04:01 +0200","Message-ID":"<20250223230403.1226-14-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.45.3","In-Reply-To":"<20250223230403.1226-1-laurent.pinchart@ideasonboard.com>","References":"<20250223230403.1226-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","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":"When statistics are missing we can't meaningfully calculate the RGB\nmeans. Move their calculation after checking if stats are available.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/awb.cpp | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\nindex af34b81beb96..7f333ef86518 100644\n--- a/src/ipa/rkisp1/algorithms/awb.cpp\n+++ b/src/ipa/rkisp1/algorithms/awb.cpp\n@@ -282,7 +282,6 @@ void Awb::process(IPAContext &context,\n \tconst rkisp1_cif_isp_stat *params = &stats->params;\n \tconst rkisp1_cif_isp_awb_stat *awb = &params->awb;\n \tIPAActiveState &activeState = context.activeState;\n-\tRGB<double> rgbMeans = calculateRgbMeans(frameContext, awb);\n \n \tmetadata.set(controls::AwbEnable, frameContext.awb.autoEnabled);\n \tmetadata.set(controls::ColourGains, {\n@@ -296,6 +295,8 @@ void Awb::process(IPAContext &context,\n \t\treturn;\n \t}\n \n+\tRGB<double> rgbMeans = calculateRgbMeans(frameContext, awb);\n+\n \t/*\n \t * If the means are too small we don't have enough information to\n \t * meaningfully calculate gains. Freeze the algorithm in that case.\n","prefixes":["13/15"]}