summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/awb.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-10-15 03:17:29 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-10-19 13:14:53 +0300
commit5ae92dae5882f5450c647b4af95ef37ba0fded72 (patch)
tree9466b1919dfe7302fa4b7998adae699a49fb79a6 /src/ipa/ipu3/algorithms/awb.cpp
parent12ecb75c4ff49f0c15b7a93bd82c1fad4f69f9f1 (diff)
ipa: ipu3: awb: Don't pass member variable to member function
The Awb::generateZones() member function fills the zones vector passed as an argument, which is actually a member variable. Use it directly in the function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/awb.cpp')
-rw-r--r--src/ipa/ipu3/algorithms/awb.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp
index e2b18336..809de66a 100644
--- a/src/ipa/ipu3/algorithms/awb.cpp
+++ b/src/ipa/ipu3/algorithms/awb.cpp
@@ -196,8 +196,10 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)
}
/* Generate an RGB vector with the average values for each zone */
-void Awb::generateZones(std::vector<RGB> &zones)
+void Awb::generateZones()
{
+ zones_.clear();
+
for (unsigned int i = 0; i < kAwbStatsSizeX * kAwbStatsSizeY; i++) {
RGB zone;
double counted = awbStats_[i].counted;
@@ -206,7 +208,7 @@ void Awb::generateZones(std::vector<RGB> &zones)
if (zone.G >= kMinGreenLevelInZone) {
zone.R = awbStats_[i].sum.red / counted;
zone.B = awbStats_[i].sum.blue / counted;
- zones.push_back(zone);
+ zones_.push_back(zone);
}
}
}
@@ -298,11 +300,13 @@ void Awb::awbGreyWorld()
void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)
{
ASSERT(stats->stats_3a_status.awb_en);
- zones_.clear();
+
clearAwbStats();
generateAwbStats(stats);
- generateZones(zones_);
+ generateZones();
+
LOG(IPU3Awb, Debug) << "Valid zones: " << zones_.size();
+
if (zones_.size() > 10) {
awbGreyWorld();
LOG(IPU3Awb, Debug) << "Gain found for red: " << asyncResults_.redGain