diff options
author | Stefan Klug <stefan.klug@ideasonboard.com> | 2024-07-12 16:32:06 +0200 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2024-07-24 15:37:04 +0100 |
commit | 01132257b9e70e6408e98e7df684c6db3aefe8e8 (patch) | |
tree | 1f60637672d030fd1035400655b3cb553dc5f450 /src/ipa/rkisp1/algorithms | |
parent | c7d7e7ec4aab8f25fa7ea5d8cc722701e6ae5be2 (diff) |
ipa: rkisp1: ccm: Ensure metadata contains valid ccm
When the colour temperature does not change between frames, the ccm
inside the frame context is not updated and the metadata contains
invalid data. Fix that by caching the ccm inside the active state.
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
[Kieran: Remove spurious [[maybe_unused]] addition]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms')
-rw-r--r-- | src/ipa/rkisp1/algorithms/ccm.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp index 4c4e3f50..fe7246f8 100644 --- a/src/ipa/rkisp1/algorithms/ccm.cpp +++ b/src/ipa/rkisp1/algorithms/ccm.cpp @@ -111,13 +111,16 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame, * \todo The colour temperature will likely be noisy, add filtering to * avoid updating the CCM matrix all the time. */ - if (frame > 0 && ct == ct_) + if (frame > 0 && ct == ct_) { + frameContext.ccm.ccm = context.activeState.ccm.ccm; return; + } ct_ = ct; Matrix<float, 3, 3> ccm = ccm_.get(ct); Matrix<int16_t, 3, 1> offsets = offsets_.get(ct); + context.activeState.ccm.ccm = ccm; frameContext.ccm.ccm = ccm; setParameters(params, ccm, offsets); |