[libcamera-devel,v2,0/6] Raspberry Pi AGC: initial frame drop count
mbox series

Message ID 20201207180121.6374-1-david.plowman@raspberrypi.com
Headers show
Series
  • Raspberry Pi AGC: initial frame drop count
Related show

Message

David Plowman Dec. 7, 2020, 6:01 p.m. UTC
Hi everyone

Thanks for the reviews, comments and suggestions. Here's a version 2
that takes account of the feedback. There are now 6 commits:

1. This actually squashes together the previous first two patches, but
is otherwise unchanged.

2. The new method for Agc is called GetConvergenceFrames, but this is
otherwise unchanged.

3. The same as the previous patch, but for Awb rather than Agc.

(There's actually an issue here - the AWB really only takes one frame
to converge, except the calculation runs in another thread so you
can't be certain. So for that reason I've left the value at 3. I don't
really feel inclined to complicate everything on account of
this... but it is something to keep in mind.)

4. A helper function for the Pwl (piecewise linear function) class
that I found useful in the following patch.

5. Here we extend the AWB to estimate a colour temperature given fixed
colour gains. We pass this out in the metadata where the ALSC picks it
up in its SwitchMode. I only do this the very first time everything
starts - I'm not convinced about doing it on other occasions, though
we could review that based on the usage it gets.

(Note: looking through awb.cpp I am reminded it needs a bit of a tidy
like we have done elsewhere, such as in ALSC and AGC. I left myself a
little reminder at the top to get back to this once we've got our apps
out of the door!)

6. This patch is essentially the final two patches of the v1 set. I
squashed them together because I think the ov5647 change makes more
sense incorporated. Beyond that the only real difference is that I
query both the AGC and AWB for their convergence numbers, and handle
them in the way proposed in some of the discussions.

You may notice that I haven't given ALSC a GetConvergenceFrames
method. In fact it just tags along with the AWB, reading the colour
temperature that it produced. If AWB is happy, so is ALSC. If AWB
needs frames to converge, so does ALSC. It has no "independance" in
this regard, so it felt tidier to leave it alone.

Hope that makes sense!

Thanks and best regards
David

David Plowman (6):
  src: raspberrypi: Pass the drop frame count in start, not configure
  src: ipa: raspberrypi: agc: Add GetConvergenceFrames method to AGC
    base class
  src: ipa: raspberrypi: agc: Add GetConvergenceFrames method to AWB
    base class
  src: ipa: raspberrypi: Compute inverse of piecewise linear function
  src: ipa: raspberrypi: Estimate the colour temerature if starting with
    fixed colour gains
  src: ipa: raspberrypi: Move initial frame drop decision to AGC/AWB

 src/ipa/raspberrypi/cam_helper.cpp            |  6 +-
 src/ipa/raspberrypi/cam_helper_ov5647.cpp     | 10 +++
 .../raspberrypi/controller/agc_algorithm.hpp  |  1 +
 .../raspberrypi/controller/awb_algorithm.hpp  |  1 +
 src/ipa/raspberrypi/controller/pwl.cpp        | 27 ++++++++
 src/ipa/raspberrypi/controller/pwl.hpp        |  3 +
 src/ipa/raspberrypi/controller/rpi/agc.cpp    | 13 ++++
 src/ipa/raspberrypi/controller/rpi/agc.hpp    |  2 +
 src/ipa/raspberrypi/controller/rpi/alsc.cpp   |  6 +-
 src/ipa/raspberrypi/controller/rpi/awb.cpp    | 27 ++++++++
 src/ipa/raspberrypi/controller/rpi/awb.hpp    |  3 +
 src/ipa/raspberrypi/raspberrypi.cpp           | 61 +++++++++++++------
 .../pipeline/raspberrypi/raspberrypi.cpp      | 25 ++++----
 13 files changed, 149 insertions(+), 36 deletions(-)