[libcamera-devel,0/5] Multi-channel AGC
mbox series

Message ID 20230731094641.73646-1-david.plowman@raspberrypi.com
Headers show
Series
  • Multi-channel AGC
Related show

Message

David Plowman July 31, 2023, 9:46 a.m. UTC
Hi everyone

This set of patches implements multi-channel AGC for the Raspberry
Pi. This allows an application to run independent instances of AGC on
successive frames with independent settings, and switching between the
exposures gets handled for the application. It's a building block for
HDR type of applications (though not limited to that).

We have 5 patches:

1. I seem to have built on top of some future work that Naush has been
doing, so I've included a small histogram patch of his that is
required.

2. This moves essentially all of the Agc class into an AgcChannel
class, and adds a new Agc class that is a thin wrapper around multiple
AgcChannels. The wrapper is sufficient only to make the AGC work as
before, and does not yet add anything new.

3. Now we add real multi-channel functionality to the Agc class. For
now there are no libcamera controls to drive it, but a future commit
will add an HDR algorithm that will use it.

4. Adds an AgcChannelConstraint class. Now that we have multiple
channels, we might want to constrain the exposures of one channel to
lie within certain limits of another. Here we add only the class; the
next commit will make use of them.

5. Make use of the AgcChannelConstraints.

As implied above, this work is all preparatory to some HDR features in
a future commit. The Pi, of course, has no facility to combine images
automatically, so "HDR" on the Pi will be all about driving the
multi-channel AGC and letting the application handle the images
itself.

Thanks!
David

David Plowman (4):
  ipa: rpi: agc: Reorganise code for multi-channel AGC
  ipa: rpi: agc: Implementation of multi-channel AGC
  ipa: rpi: agc: Add AgcChannelConstraint class
  ipa: rpi: agc: Use channel constraints in the AGC algorithm

Naushir Patuck (1):
  ipa: rpi: histogram: Add interBinMean()

 src/ipa/rpi/common/ipa_base.cpp            |   14 +-
 src/ipa/rpi/controller/agc_algorithm.h     |   19 +-
 src/ipa/rpi/controller/agc_status.h        |    1 +
 src/ipa/rpi/controller/histogram.cpp       |   22 +-
 src/ipa/rpi/controller/histogram.h         |    2 +
 src/ipa/rpi/controller/meson.build         |    1 +
 src/ipa/rpi/controller/rpi/agc.cpp         |  969 ++++---------------
 src/ipa/rpi/controller/rpi/agc.h           |  124 +--
 src/ipa/rpi/controller/rpi/agc_channel.cpp | 1018 ++++++++++++++++++++
 src/ipa/rpi/controller/rpi/agc_channel.h   |  149 +++
 src/ipa/rpi/vc4/data/imx477.json           |    3 +-
 11 files changed, 1424 insertions(+), 898 deletions(-)
 create mode 100644 src/ipa/rpi/controller/rpi/agc_channel.cpp
 create mode 100644 src/ipa/rpi/controller/rpi/agc_channel.h