diff options
-rw-r--r-- | src/ipa/libipa/fc_queue.cpp | 10 | ||||
-rw-r--r-- | src/ipa/libipa/fc_queue.h | 18 | ||||
-rw-r--r-- | src/ipa/rkisp1/ipa_context.cpp | 5 | ||||
-rw-r--r-- | src/ipa/rkisp1/ipa_context.h | 2 |
4 files changed, 26 insertions, 9 deletions
diff --git a/src/ipa/libipa/fc_queue.cpp b/src/ipa/libipa/fc_queue.cpp index 0365e919..41c563dd 100644 --- a/src/ipa/libipa/fc_queue.cpp +++ b/src/ipa/libipa/fc_queue.cpp @@ -39,6 +39,16 @@ namespace ipa { */ /** + * \fn FrameContext::init() + * \param[in] frameNum The frame number to assign to this FrameContext + * \brief Initialize a frame context + * + * This function initializes a frame context by assigning it a frame number. + * The single IPA modules are expected to override this function to initialize + * their derived FrameContext implementation to their desired default values. + */ + +/** * \class FCQueue * \brief A support class for managing FrameContext instances in IPA modules * \tparam FrameContext The IPA module-specific FrameContext derived class type diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h index 24d9e82b..573ef1e0 100644 --- a/src/ipa/libipa/fc_queue.h +++ b/src/ipa/libipa/fc_queue.h @@ -22,6 +22,12 @@ template<typename FrameContext> class FCQueue; struct FrameContext { +protected: + virtual void init(const uint32_t frameNum) + { + frame = frameNum; + } + private: template<typename T> friend class FCQueue; uint32_t frame; @@ -61,7 +67,7 @@ public: LOG(FCQueue, Warning) << "Frame " << frame << " already initialised"; else - init(frameContext, frame); + frameContext.init(frame); return frameContext; } @@ -98,18 +104,12 @@ public: LOG(FCQueue, Warning) << "Obtained an uninitialised FrameContext for " << frame; - init(frameContext, frame); + frameContext.init(frame); return frameContext; } -private: - void init(FrameContext &frameContext, const uint32_t frame) - { - frameContext = {}; - frameContext.frame = frame; - } - +protected: std::vector<FrameContext> contexts_; }; diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 14d0c02a..4e4fe5f4 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -417,6 +417,11 @@ namespace libcamera::ipa::rkisp1 { * \brief Analogue gain multiplier */ +void IPAFrameContext::init(const uint32_t frameNum) +{ + FrameContext::init(frameNum); +} + /** * \struct IPAContext * \brief Global IPA context data shared between all algorithms diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index e274d9b0..51e04bc3 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -177,6 +177,8 @@ struct IPAFrameContext : public FrameContext { struct { Matrix<float, 3, 3> ccm; } ccm; + + void init(const uint32_t frame) override; }; struct IPAContext { |