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>
This commit is contained in:
Stefan Klug 2024-07-12 16:32:06 +02:00 committed by Kieran Bingham
parent c7d7e7ec4a
commit 01132257b9
2 changed files with 8 additions and 1 deletions

View file

@ -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);

View file

@ -97,6 +97,10 @@ struct IPAActiveState {
bool autoEnabled;
} awb;
struct {
Matrix<float, 3, 3> ccm;
} ccm;
struct {
int8_t brightness;
uint8_t contrast;