summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/ipu3_agc.h
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2021-06-08 13:12:23 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2021-06-08 16:26:06 +0530
commit384a53d3cdf7f01915547f5c7cb88072adad0572 (patch)
treef0c270b4e84bddc8c011bd5d86f04abf99d9a834 /src/ipa/ipu3/ipu3_agc.h
parent1e5cee701781276fb03f18e704a5a6ea8f24eff8 (diff)
ipa: ipu3: Calculate line duration from IPACameraSensorInfo
Squash \todo by calculating line duration from IPACameraSensorInfo, now passed in, to IPU3Agc::initialise(). Since line duration is now calculated from real values, store it as a private member in IPU3Agc class. As a further step, replace the associated global constant, kMaxExposureTime, with a private IPU3Agc class member as well, and assign its value correspondingly in IPU3Agc::initialise(), similar to previous precedence. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/ipu3_agc.h')
-rw-r--r--src/ipa/ipu3/ipu3_agc.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h
index bfdf45d1..99a582a9 100644
--- a/src/ipa/ipu3/ipu3_agc.h
+++ b/src/ipa/ipu3/ipu3_agc.h
@@ -18,6 +18,8 @@
namespace libcamera {
+class IPACameraSensorInfo;
+
namespace ipa::ipu3 {
class IPU3Agc : public Algorithm
@@ -26,7 +28,7 @@ public:
IPU3Agc();
~IPU3Agc() = default;
- void initialise(struct ipu3_uapi_grid_config &bdsGrid);
+ void initialise(struct ipu3_uapi_grid_config &bdsGrid, const IPACameraSensorInfo &sensorInfo);
void process(const ipu3_uapi_stats_3a *stats, uint32_t &exposure, uint32_t &gain);
bool converged() { return converged_; }
bool updateControls() { return updateControls_; }
@@ -49,6 +51,9 @@ private:
double iqMean_;
double gamma_;
+ double lineDuration_;
+ double maxExposureTime_;
+
double prevExposure_;
double prevExposureNoDg_;
double currentExposure_;