Message ID | 20220208100436.2348-1-david.plowman@raspberrypi.com |
---|---|
State | Accepted |
Commit | 110c26b317c783a48c97badd93c006f6c2ae834b |
Headers | show |
Series |
|
Related | show |
Hi David, Thank you for the patch. On Tue, Feb 08, 2022 at 10:04:36AM +0000, David Plowman wrote: > We now handle disabling ("pausing") AWB in the same way as > AEC/AGC. Instead of letting the pause flag be set so that the code > never runs at all, we instead fix the manual settings to the current > values (but continue to be called). > > The algorithm does not restart any calculations in this state, but > continues to add AWB metadata to every frame. Therefore certain other > algorithms that want to know it (CCM and ALSC, for example) can still > find it. > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com> > Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/ipa/raspberrypi/controller/rpi/awb.cpp | 20 ++++++++++++++++++++ > src/ipa/raspberrypi/controller/rpi/awb.hpp | 4 ++++ > 2 files changed, 24 insertions(+) > > diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp > index 5cfd33a3..d4c93447 100644 > --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp > +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp > @@ -172,6 +172,26 @@ void Awb::Initialise() > async_results_ = sync_results_; > } > > +bool Awb::IsPaused() const > +{ > + return false; > +} > + > +void Awb::Pause() > +{ > + // "Pause" by fixing everything to the most recent values. > + manual_r_ = sync_results_.gain_r = prev_sync_results_.gain_r; > + manual_b_ = sync_results_.gain_b = prev_sync_results_.gain_b; > + sync_results_.gain_g = prev_sync_results_.gain_g; > + sync_results_.temperature_K = prev_sync_results_.temperature_K; > +} > + > +void Awb::Resume() > +{ > + manual_r_ = 0.0; > + manual_b_ = 0.0; > +} > + > unsigned int Awb::GetConvergenceFrames() const > { > // If not in auto mode, there is no convergence > diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp > index 8af1f27c..ac3dca6f 100644 > --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp > +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp > @@ -83,6 +83,10 @@ public: > char const *Name() const override; > void Initialise() override; > void Read(boost::property_tree::ptree const ¶ms) override; > + // AWB handles "pausing" for itself. > + bool IsPaused() const override; > + void Pause() override; > + void Resume() override; > unsigned int GetConvergenceFrames() const override; > void SetMode(std::string const &name) override; > void SetManualGains(double manual_r, double manual_b) override;
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 5cfd33a3..d4c93447 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -172,6 +172,26 @@ void Awb::Initialise() async_results_ = sync_results_; } +bool Awb::IsPaused() const +{ + return false; +} + +void Awb::Pause() +{ + // "Pause" by fixing everything to the most recent values. + manual_r_ = sync_results_.gain_r = prev_sync_results_.gain_r; + manual_b_ = sync_results_.gain_b = prev_sync_results_.gain_b; + sync_results_.gain_g = prev_sync_results_.gain_g; + sync_results_.temperature_K = prev_sync_results_.temperature_K; +} + +void Awb::Resume() +{ + manual_r_ = 0.0; + manual_b_ = 0.0; +} + unsigned int Awb::GetConvergenceFrames() const { // If not in auto mode, there is no convergence diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp index 8af1f27c..ac3dca6f 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp @@ -83,6 +83,10 @@ public: char const *Name() const override; void Initialise() override; void Read(boost::property_tree::ptree const ¶ms) override; + // AWB handles "pausing" for itself. + bool IsPaused() const override; + void Pause() override; + void Resume() override; unsigned int GetConvergenceFrames() const override; void SetMode(std::string const &name) override; void SetManualGains(double manual_r, double manual_b) override;