ipa: simple: Report exposure in metadata
Report exposure and gain in metadata. This is more complicated than it could be expected because the exposure value should be in microseconds but it's handled using V4L2_CID_EXPOSURE control, which doesn't specify the unit, see https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/control.html. So the unit conversion is done in the way rkisp1 IPA uses. This requires getting and passing IPACameraSensorInfo around. To avoid naming confusion and to improve consistency with rkisp1 IPA, sensorCtrlInfoMap parameter is renamed to sensorControls. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
1375b07ede
commit
485a807dcb
5 changed files with 43 additions and 14 deletions
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include <libcamera/base/log.h>
|
||||
|
||||
#include "control_ids.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
LOG_DEFINE_CATEGORY(IPASoftExposure)
|
||||
|
@ -97,10 +99,15 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou
|
|||
|
||||
void Agc::process(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
IPAFrameContext &frameContext,
|
||||
const SwIspStats *stats,
|
||||
[[maybe_unused]] ControlList &metadata)
|
||||
ControlList &metadata)
|
||||
{
|
||||
utils::Duration exposureTime =
|
||||
context.configuration.agc.lineDuration * frameContext.sensor.exposure;
|
||||
metadata.set(controls::ExposureTime, exposureTime.get<std::micro>());
|
||||
metadata.set(controls::AnalogueGain, frameContext.sensor.gain);
|
||||
|
||||
/*
|
||||
* Calculate Mean Sample Value (MSV) according to formula from:
|
||||
* https://www.araa.asn.au/acra/acra2007/papers/paper84final.pdf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue