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:
parent
ef447647b6
commit
87d36de543
30 changed files with 92 additions and 22 deletions
|
@ -323,7 +323,10 @@ void Agc::process(IPAContext &context,
|
|||
/**
|
||||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void Agc::prepare(IPAContext &context, rkisp1_params_cfg *params)
|
||||
void Agc::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
if (context.frameContext.frameCount > 0)
|
||||
return;
|
||||
|
|
|
@ -26,7 +26,9 @@ public:
|
|||
~Agc() = default;
|
||||
|
||||
int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
void process(IPAContext &context, IPAFrameContext &frameContext,
|
||||
const rkisp1_stat_buffer *stats) override;
|
||||
|
||||
|
|
|
@ -74,7 +74,10 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)
|
|||
/**
|
||||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)
|
||||
void Awb::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
params->others.awb_gain_config.gain_green_b = 256 * context.frameContext.awb.gains.green;
|
||||
params->others.awb_gain_config.gain_blue = 256 * context.frameContext.awb.gains.blue;
|
||||
|
|
|
@ -20,7 +20,9 @@ public:
|
|||
~Awb() = default;
|
||||
|
||||
int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
void queueRequest(IPAContext &context, const uint32_t frame,
|
||||
const ControlList &controls) override;
|
||||
void process(IPAContext &context, IPAFrameContext &frameCtx,
|
||||
|
|
|
@ -66,6 +66,8 @@ int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,
|
|||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void BlackLevelCorrection::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
if (context.frameContext.frameCount > 0)
|
||||
|
|
|
@ -20,7 +20,9 @@ public:
|
|||
~BlackLevelCorrection() = default;
|
||||
|
||||
int init(IPAContext &context, const YamlObject &tuningData) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
|
||||
private:
|
||||
bool tuningParameters_;
|
||||
|
|
|
@ -71,6 +71,8 @@ void ColorProcessing::queueRequest(IPAContext &context,
|
|||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void ColorProcessing::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
auto &cproc = context.frameContext.cproc;
|
||||
|
|
|
@ -23,7 +23,9 @@ public:
|
|||
|
||||
void queueRequest(IPAContext &context, const uint32_t frame,
|
||||
const ControlList &controls) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
};
|
||||
|
||||
} /* namespace ipa::rkisp1::algorithms */
|
||||
|
|
|
@ -232,6 +232,8 @@ int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,
|
|||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void DefectPixelClusterCorrection::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
if (context.frameContext.frameCount > 0)
|
||||
|
|
|
@ -20,7 +20,9 @@ public:
|
|||
~DefectPixelClusterCorrection() = default;
|
||||
|
||||
int init(IPAContext &context, const YamlObject &tuningData) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
|
|
|
@ -206,7 +206,9 @@ void Dpf::queueRequest(IPAContext &context,
|
|||
/**
|
||||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void Dpf::prepare(IPAContext &context, rkisp1_params_cfg *params)
|
||||
void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
if (!initialized_)
|
||||
return;
|
||||
|
|
|
@ -24,7 +24,9 @@ public:
|
|||
int init(IPAContext &context, const YamlObject &tuningData) override;
|
||||
void queueRequest(IPAContext &context, const uint32_t frame,
|
||||
const ControlList &controls) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
|
|
|
@ -85,7 +85,10 @@ void Filter::queueRequest(IPAContext &context,
|
|||
/**
|
||||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void Filter::prepare(IPAContext &context, rkisp1_params_cfg *params)
|
||||
void Filter::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
auto &filter = context.frameContext.filter;
|
||||
|
||||
|
|
|
@ -23,7 +23,9 @@ public:
|
|||
|
||||
void queueRequest(IPAContext &context, const uint32_t frame,
|
||||
const ControlList &controls) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
};
|
||||
|
||||
} /* namespace ipa::rkisp1::algorithms */
|
||||
|
|
|
@ -119,6 +119,8 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
|
|||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void GammaSensorLinearization::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
if (context.frameContext.frameCount > 0)
|
||||
|
|
|
@ -20,7 +20,9 @@ public:
|
|||
~GammaSensorLinearization() = default;
|
||||
|
||||
int init(IPAContext &context, const YamlObject &tuningData) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
|
|
|
@ -133,6 +133,8 @@ int LensShadingCorrection::configure(IPAContext &context,
|
|||
* \copydoc libcamera::ipa::Algorithm::prepare
|
||||
*/
|
||||
void LensShadingCorrection::prepare(IPAContext &context,
|
||||
[[maybe_unused]] const uint32_t frame,
|
||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params)
|
||||
{
|
||||
if (context.frameContext.frameCount > 0)
|
||||
|
|
|
@ -21,7 +21,9 @@ public:
|
|||
|
||||
int init(IPAContext &context, const YamlObject &tuningData) override;
|
||||
int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void prepare(IPAContext &context, const uint32_t frame,
|
||||
IPAFrameContext &frameContext,
|
||||
rkisp1_params_cfg *params) override;
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue