ipa: ipu3: Fill AGC and AWB metadata in algorithms

Fill the frame metadata in the AGC and AWB algorithm's prepare()
function. This removes the need to fill metadata manually in the IPA
module's processStatsBuffer() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2022-10-19 02:34:13 +03:00
parent 32d5f0d2a4
commit 11f5c3ad05
5 changed files with 30 additions and 13 deletions

View file

@ -11,6 +11,8 @@
#include <libcamera/base/log.h>
#include <libcamera/control_ids.h>
/**
* \file awb.h
*/
@ -403,6 +405,14 @@ void Awb::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
context.activeState.awb.gains.green = asyncResults_.greenGain;
context.activeState.awb.gains.red = asyncResults_.redGain;
context.activeState.awb.temperatureK = asyncResults_.temperatureK;
metadata.set(controls::AwbEnable, true);
metadata.set(controls::ColourGains, {
static_cast<float>(context.activeState.awb.gains.red),
static_cast<float>(context.activeState.awb.gains.blue)
});
metadata.set(controls::ColourTemperature,
context.activeState.awb.temperatureK);
}
constexpr uint16_t Awb::threshold(float value)