{"id":14154,"url":"https://patchwork.libcamera.org/api/1.1/patches/14154/?format=json","web_url":"https://patchwork.libcamera.org/patch/14154/","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":"<20211015015804.11758-1-laurent.pinchart@ideasonboard.com>","date":"2021-10-15T01:58:03","name":"[libcamera-devel,1/2] ipa: ipu3: awb: Don't pass member variable to member function","commit_ref":"5ae92dae5882f5450c647b4af95ef37ba0fded72","pull_url":null,"state":"accepted","archived":false,"hash":"47d80b587f133fddeb604b0fb47d94703fe0aa71","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/14154/mbox/","series":[{"id":2630,"url":"https://patchwork.libcamera.org/api/1.1/series/2630/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2630","date":"2021-10-15T01:58:03","name":"[libcamera-devel,1/2] ipa: ipu3: awb: Don't pass member variable to member function","version":1,"mbox":"https://patchwork.libcamera.org/series/2630/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14154/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14154/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 D7976C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Oct 2021 01:58:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2CD3768F51;\n\tFri, 15 Oct 2021 03:58:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 801B260239\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Oct 2021 03:58:24 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E93BB2E3;\n\tFri, 15 Oct 2021 03:58:23 +0200 (CEST)"],"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=\"vPlr1sGm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634263104;\n\tbh=oS+gY3HueFaTt5SMq6wXV9jkYcj0dkJInj/JhMDChBY=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=vPlr1sGml8jylSlcpTOzV4C9Ktp7mDAOZbmbAVQJNTDFS9ISqjTepMuSaWi+29t++\n\tAeCft/MezXZlKRJZ/A0ORG9YS04NaEO+nWM75OnsOapSIrFsb/WqRypaR7+0bDUlCm\n\tYeAJ7okjcful4OGyc4u5YjQnMHmn3ca2neWWFkpM=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 15 Oct 2021 04:58:03 +0300","Message-Id":"<20211015015804.11758-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] ipa: ipu3: awb: Don't pass member\n\tvariable to member function","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 Awb::generateZones() member function fills the zones vector passed\nas an argument, which is actually a member variable. Use it directly in\nthe function.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/awb.cpp | 12 ++++++++----\n src/ipa/ipu3/algorithms/awb.h   |  2 +-\n 2 files changed, 9 insertions(+), 5 deletions(-)\n\n\nbase-commit: ccec150589a177654b9039d21163c36ccff85cff","diff":"diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\nindex e2b18336d582..809de66aa7fa 100644\n--- a/src/ipa/ipu3/algorithms/awb.cpp\n+++ b/src/ipa/ipu3/algorithms/awb.cpp\n@@ -196,8 +196,10 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)\n }\n \n /* Generate an RGB vector with the average values for each zone */\n-void Awb::generateZones(std::vector<RGB> &zones)\n+void Awb::generateZones()\n {\n+\tzones_.clear();\n+\n \tfor (unsigned int i = 0; i < kAwbStatsSizeX * kAwbStatsSizeY; i++) {\n \t\tRGB zone;\n \t\tdouble counted = awbStats_[i].counted;\n@@ -206,7 +208,7 @@ void Awb::generateZones(std::vector<RGB> &zones)\n \t\t\tif (zone.G >= kMinGreenLevelInZone) {\n \t\t\t\tzone.R = awbStats_[i].sum.red / counted;\n \t\t\t\tzone.B = awbStats_[i].sum.blue / counted;\n-\t\t\t\tzones.push_back(zone);\n+\t\t\t\tzones_.push_back(zone);\n \t\t\t}\n \t\t}\n \t}\n@@ -298,11 +300,13 @@ void Awb::awbGreyWorld()\n void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n {\n \tASSERT(stats->stats_3a_status.awb_en);\n-\tzones_.clear();\n+\n \tclearAwbStats();\n \tgenerateAwbStats(stats);\n-\tgenerateZones(zones_);\n+\tgenerateZones();\n+\n \tLOG(IPU3Awb, Debug) << \"Valid zones: \" << zones_.size();\n+\n \tif (zones_.size() > 10) {\n \t\tawbGreyWorld();\n \t\tLOG(IPU3Awb, Debug) << \"Gain found for red: \" << asyncResults_.redGain\ndiff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\nindex 677384eda54a..3b81f600aa02 100644\n--- a/src/ipa/ipu3/algorithms/awb.h\n+++ b/src/ipa/ipu3/algorithms/awb.h\n@@ -65,7 +65,7 @@ public:\n \n private:\n \tvoid calculateWBGains(const ipu3_uapi_stats_3a *stats);\n-\tvoid generateZones(std::vector<RGB> &zones);\n+\tvoid generateZones();\n \tvoid generateAwbStats(const ipu3_uapi_stats_3a *stats);\n \tvoid clearAwbStats();\n \tvoid awbGreyWorld();\n","prefixes":["libcamera-devel","1/2"]}