libcamera: ipa: simple: Generalize tracking matrix changes

IPAActiveState::ccm stores the colour correction matrix (CCM) and
whether it has been changed.  The change flag is later used when
recomputing or not the lookup tables.

But the CCM may include other corrections than just the sensor colour
correction, for example white balance and saturation adjustments.  These
things should be separated and IPAActiveState::ccm should represent just
the CCM itself.

As the first step towards that cleanup, let's separate the change flag
from the CCM.  And wrap the only remaining member of
IPAActiveState::ccm.

Also, let's reset the separated change flag in the lookup tables; it'll
be no longer tied to just CCM handling.

This patch doesn't change actual behaviour and it still reports the
combined matrix as CCM in metadata.  This is addressed in the followup
patches.

Reviewed-by: Bryan O'Donoghue <bod.linux@nxsw.ie>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Milan Zamazal
2026-01-28 12:43:50 +01:00
committed by Kieran Bingham
parent 3dbe06a15f
commit 77942a3bd0
3 changed files with 8 additions and 10 deletions
+3 -4
View File
@@ -94,8 +94,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,
if (frame > 0 &&
utils::abs_diff(ct, lastCt_) < kTemperatureThreshold &&
saturation == lastSaturation_) {
frameContext.ccm = context.activeState.ccm.ccm;
context.activeState.ccm.changed = false;
frameContext.ccm = context.activeState.ccm;
return;
}
@@ -105,9 +104,9 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,
if (saturation)
applySaturation(ccm, saturation.value());
context.activeState.ccm.ccm = ccm;
context.activeState.ccm = ccm;
frameContext.saturation = saturation;
context.activeState.ccm.changed = true;
context.activeState.matrixChanged = true;
frameContext.ccm = ccm;
}