ipa: libipa: algorithm: prepare(): Pass frame and frame Context

Pass the current frame number, and the current FrameContext for calls to
prepare.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Kieran Bingham 2022-07-21 13:13:06 +01:00 committed by Laurent Pinchart
parent ef447647b6
commit 87d36de543
30 changed files with 92 additions and 22 deletions

View file

@ -116,7 +116,10 @@ Af::Af()
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
void Af::prepare(IPAContext &context, ipu3_uapi_params *params)
void Af::prepare(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
ipu3_uapi_params *params)
{
const struct ipu3_uapi_grid_config &grid = context.configuration.af.afGrid;
params->acc_param.af.grid_cfg = grid;

View file

@ -30,8 +30,10 @@ public:
Af();
~Af() = default;
void prepare(IPAContext &context, ipu3_uapi_params *params) override;
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
void prepare(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
ipu3_uapi_params *params) override;
void process(IPAContext &context, IPAFrameContext &frameContext,
const ipu3_uapi_stats_3a *stats) override;

View file

@ -429,7 +429,10 @@ constexpr uint16_t Awb::gainValue(double gain)
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
void Awb::prepare(IPAContext &context, ipu3_uapi_params *params)
void Awb::prepare(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
ipu3_uapi_params *params)
{
/*
* Green saturation thresholds are reduced because we are using the

View file

@ -39,7 +39,9 @@ public:
~Awb();
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
void prepare(IPAContext &context, ipu3_uapi_params *params) override;
void prepare(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
ipu3_uapi_params *params) override;
void process(IPAContext &context, IPAFrameContext &frameContext,
const ipu3_uapi_stats_3a *stats) override;

View file

@ -39,13 +39,17 @@ BlackLevelCorrection::BlackLevelCorrection()
/**
* \brief Fill in the parameter structure, and enable black level correction
* \param[in] context The shared IPA context
* \param[in] frame The frame context sequence number
* \param[in] frameContext The FrameContext for this frame
* \param[out] params The IPU3 parameters
*
* Populate the IPU3 parameter structure with the correction values for each
* channel and enable the corresponding ImgU block processing.
*/
void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,
ipu3_uapi_params *params)
[[maybe_unused]] const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
ipu3_uapi_params *params)
{
/*
* The Optical Black Level correction values

View file

@ -18,7 +18,9 @@ class BlackLevelCorrection : public Algorithm
public:
BlackLevelCorrection();
void prepare(IPAContext &context, ipu3_uapi_params *params) override;
void prepare(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
ipu3_uapi_params *params) override;
};
} /* namespace ipa::ipu3::algorithms */

View file

@ -50,12 +50,16 @@ int ToneMapping::configure(IPAContext &context,
/**
* \brief Fill in the parameter structure, and enable gamma control
* \param[in] context The shared IPA context
* \param[in] frame The frame context sequence number
* \param[in] frameContext The FrameContext for this frame
* \param[out] params The IPU3 parameters
*
* Populate the IPU3 parameter structure with our tone mapping look up table and
* enable the gamma control module in the processing blocks.
*/
void ToneMapping::prepare([[maybe_unused]] IPAContext &context,
[[maybe_unused]] const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
ipu3_uapi_params *params)
{
/* Copy the calculated LUT into the parameters buffer. */

View file

@ -19,7 +19,8 @@ public:
ToneMapping();
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
void prepare(IPAContext &context, ipu3_uapi_params *params) override;
void prepare(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext, ipu3_uapi_params *params) override;
void process(IPAContext &context, IPAFrameContext &frameContext,
const ipu3_uapi_stats_3a *stats) override;