<div dir="ltr"><div dir="ltr">Hi David,<div><br></div><div>Thank you for your patch.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 4 Feb 2022 at 09:25, David Plowman <<a href="mailto:david.plowman@raspberrypi.com">david.plowman@raspberrypi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We now handle disabling ("pausing") AWB in the same way as<br>
AEC/AGC. Instead of letting the pause flag be set so that the code<br>
never runs at all, we instead fix the manual settings to the current<br>
values (but continue to be called).<br>
<br>
The algorithm does not restart any calculations in this state, but<br>
continues to add AWB metadata to every frame. Therefore certain other<br>
algorithms that want to know it (CCM and ALSC, for example) can still<br>
find it.<br>
<br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br>
---<br>
 src/ipa/raspberrypi/controller/rpi/awb.cpp | 21 +++++++++++++++++++++<br>
 src/ipa/raspberrypi/controller/rpi/awb.hpp |  4 ++++<br>
 2 files changed, 25 insertions(+)<br>
<br>
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp<br>
index 5cfd33a3..1ad912c7 100644<br>
--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp<br>
+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp<br>
@@ -172,6 +172,27 @@ void Awb::Initialise()<br>
        async_results_ = sync_results_;<br>
 }<br>
<br>
+bool Awb::IsPaused() const<br>
+{<br>
+       return false;<br>
+}<br>
+<br>
+void Awb::Pause()<br>
+{<br>
+       // "Pause" by fixing everything to the most recent values.<br>
+       manual_r_ = sync_results_.gain_r = prev_sync_results_.gain_r;<br>
+       manual_b_ = sync_results_.gain_b = prev_sync_results_.gain_b;<br>
+       sync_results_.gain_g = prev_sync_results_.gain_g;<br>
+       sync_results_.gain_g = prev_sync_results_.gain_g;<br></blockquote><div><br></div><div>Duplicate line.  Apart from that:</div><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+       sync_results_.temperature_K = prev_sync_results_.temperature_K;<br>
+}<br>
+<br>
+void Awb::Resume()<br>
+{<br>
+       manual_r_ = 0.0;<br>
+       manual_b_ = 0.0;<br>
+}<br>
+<br>
 unsigned int Awb::GetConvergenceFrames() const<br>
 {<br>
        // If not in auto mode, there is no convergence<br>
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp<br>
index 8af1f27c..ac3dca6f 100644<br>
--- a/src/ipa/raspberrypi/controller/rpi/awb.hpp<br>
+++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp<br>
@@ -83,6 +83,10 @@ public:<br>
        char const *Name() const override;<br>
        void Initialise() override;<br>
        void Read(boost::property_tree::ptree const &params) override;<br>
+       // AWB handles "pausing" for itself.<br>
+       bool IsPaused() const override;<br>
+       void Pause() override;<br>
+       void Resume() override;<br>
        unsigned int GetConvergenceFrames() const override;<br>
        void SetMode(std::string const &name) override;<br>
        void SetManualGains(double manual_r, double manual_b) override;<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div></div>