diff options
author | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-10-16 12:20:16 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-10-16 16:25:36 +0200 |
commit | 34a147315ca7929ca5c553ec8f61fead70e83f48 (patch) | |
tree | 80e49266ce52dce244281db9e9e1b7310cbd147a /src/ipa/rkisp1 | |
parent | 57385230c6eafdde613dbba90141ed805efc395c (diff) |
libipa: FCQueue: Initialize FrameContext with activeState
Pass to the FCQueue the algorithm's active state to use the most
recent state of IPA algorithms to initialize a FrameContext.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1')
-rw-r--r-- | src/ipa/rkisp1/ipa_context.cpp | 5 | ||||
-rw-r--r-- | src/ipa/rkisp1/ipa_context.h | 5 | ||||
-rw-r--r-- | src/ipa/rkisp1/rkisp1.cpp | 12 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 4e4fe5f4..2dad42b3 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -417,9 +417,10 @@ namespace libcamera::ipa::rkisp1 { * \brief Analogue gain multiplier */ -void IPAFrameContext::init(const uint32_t frameNum) +void IPAFrameContext::init(const uint32_t frameNum, + const ActiveState &activeState) { - FrameContext::init(frameNum); + FrameContext::init(frameNum, activeState); } /** diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 51e04bc3..f708b321 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -64,7 +64,7 @@ struct IPASessionConfiguration { uint32_t paramFormat; }; -struct IPAActiveState { +struct IPAActiveState : public ActiveState { struct { struct { uint32_t exposure; @@ -178,7 +178,8 @@ struct IPAFrameContext : public FrameContext { Matrix<float, 3, 3> ccm; } ccm; - void init(const uint32_t frame) override; + void init(const uint32_t frame, + const ActiveState &activeState) override; }; struct IPAContext { diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 005c17ca..00b219ff 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -325,7 +325,8 @@ void IPARkISP1::unmapBuffers(const std::vector<unsigned int> &ids) void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls) { - IPAFrameContext &frameContext = context_.frameContexts.alloc(frame); + IPAFrameContext &frameContext = context_.frameContexts.alloc(frame, + context_.activeState); for (auto const &a : algorithms()) { Algorithm *algo = static_cast<Algorithm *>(a.get()); @@ -337,7 +338,8 @@ void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls) void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId) { - IPAFrameContext &frameContext = context_.frameContexts.get(frame); + IPAFrameContext &frameContext = context_.frameContexts.get(frame, + context_.activeState); RkISP1Params params(context_.configuration.paramFormat, mappedBuffers_.at(bufferId).planes()[0]); @@ -351,7 +353,8 @@ void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId) void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId, const ControlList &sensorControls) { - IPAFrameContext &frameContext = context_.frameContexts.get(frame); + IPAFrameContext &frameContext = context_.frameContexts.get(frame, + context_.activeState); /* * In raw capture mode, the ISP is bypassed and no statistics buffer is @@ -447,7 +450,8 @@ void IPARkISP1::setControls(unsigned int frame) * internal sensor delays and other timing parameters into account. */ - IPAFrameContext &frameContext = context_.frameContexts.get(frame); + IPAFrameContext &frameContext = context_.frameContexts.get(frame, + context_.activeState); uint32_t exposure = frameContext.agc.exposure; uint32_t gain = context_.camHelper->gainCode(frameContext.agc.gain); |