From cd940f7fd3a0636c79bfcb2ebb462e17f92cb987 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 15 Sep 2023 16:58:40 +0100 Subject: ipa: rpi: histogram: Add interBinMean() Add a new helper function Histogram::interBinMean() that essentially replaces the existing Histogram::interQuantileMean() logic but working on bins instead. Rework the interQuantileMean() to call into interBinMean() with the appropriate convertion from quatiles to bins. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi Signed-off-by: Jacopo Mondi --- src/ipa/rpi/controller/histogram.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ipa/rpi/controller/histogram.h') diff --git a/src/ipa/rpi/controller/histogram.h b/src/ipa/rpi/controller/histogram.h index 6b3e3a9e..e2c5509b 100644 --- a/src/ipa/rpi/controller/histogram.h +++ b/src/ipa/rpi/controller/histogram.h @@ -38,6 +38,8 @@ public: uint64_t total() const { return cumulative_[cumulative_.size() - 1]; } /* Cumulative frequency up to a (fractional) point in a bin. */ uint64_t cumulativeFreq(double bin) const; + /* Return the mean value between two (fractional) bins. */ + double interBinMean(double binLo, double binHi) const; /* * Return the (fractional) bin of the point q (0 <= q <= 1) through the * histogram. Optionally provide limits to help. -- cgit v1.2.1