| Message ID | 20251112082715.17823-3-mzamazal@redhat.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Milan Zamazal (2025-11-12 08:27:10) > The struct has only one member and there is no immediate need to add > more. Let's use the member directly, to make things a bit simpler. > Ack, Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Milan Zamazal <mzamazal@redhat.com> > --- > src/ipa/simple/algorithms/ccm.cpp | 6 +++--- > src/ipa/simple/ipa_context.h | 4 +--- > 2 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp > index 0a98406c1..d7d3dda76 100644 > --- a/src/ipa/simple/algorithms/ccm.cpp > +++ b/src/ipa/simple/algorithms/ccm.cpp > @@ -94,7 +94,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame, > if (frame > 0 && > utils::abs_diff(ct, lastCt_) < kTemperatureThreshold && > saturation == lastSaturation_) { > - frameContext.ccm.ccm = context.activeState.ccm.ccm; > + frameContext.ccm = context.activeState.ccm.ccm; > context.activeState.ccm.changed = false; > return; > } > @@ -106,9 +106,9 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame, > applySaturation(ccm, saturation.value()); > > context.activeState.ccm.ccm = ccm; > - frameContext.ccm.ccm = ccm; > frameContext.saturation = saturation; > context.activeState.ccm.changed = true; > + frameContext.ccm = ccm; > } > > void Ccm::process([[maybe_unused]] IPAContext &context, > @@ -117,7 +117,7 @@ void Ccm::process([[maybe_unused]] IPAContext &context, > [[maybe_unused]] const SwIspStats *stats, > ControlList &metadata) > { > - metadata.set(controls::ColourCorrectionMatrix, frameContext.ccm.ccm.data()); > + metadata.set(controls::ColourCorrectionMatrix, frameContext.ccm.data()); > > const auto &saturation = frameContext.saturation; > metadata.set(controls::Saturation, saturation.value_or(1.0)); > diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h > index c3081e306..330fe39cb 100644 > --- a/src/ipa/simple/ipa_context.h > +++ b/src/ipa/simple/ipa_context.h > @@ -73,9 +73,7 @@ struct IPAActiveState { > }; > > struct IPAFrameContext : public FrameContext { > - struct { > - Matrix<float, 3, 3> ccm; > - } ccm; > + Matrix<float, 3, 3> ccm; > > struct { > int32_t exposure; > -- > 2.51.1 >
diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp index 0a98406c1..d7d3dda76 100644 --- a/src/ipa/simple/algorithms/ccm.cpp +++ b/src/ipa/simple/algorithms/ccm.cpp @@ -94,7 +94,7 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame, if (frame > 0 && utils::abs_diff(ct, lastCt_) < kTemperatureThreshold && saturation == lastSaturation_) { - frameContext.ccm.ccm = context.activeState.ccm.ccm; + frameContext.ccm = context.activeState.ccm.ccm; context.activeState.ccm.changed = false; return; } @@ -106,9 +106,9 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame, applySaturation(ccm, saturation.value()); context.activeState.ccm.ccm = ccm; - frameContext.ccm.ccm = ccm; frameContext.saturation = saturation; context.activeState.ccm.changed = true; + frameContext.ccm = ccm; } void Ccm::process([[maybe_unused]] IPAContext &context, @@ -117,7 +117,7 @@ void Ccm::process([[maybe_unused]] IPAContext &context, [[maybe_unused]] const SwIspStats *stats, ControlList &metadata) { - metadata.set(controls::ColourCorrectionMatrix, frameContext.ccm.ccm.data()); + metadata.set(controls::ColourCorrectionMatrix, frameContext.ccm.data()); const auto &saturation = frameContext.saturation; metadata.set(controls::Saturation, saturation.value_or(1.0)); diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h index c3081e306..330fe39cb 100644 --- a/src/ipa/simple/ipa_context.h +++ b/src/ipa/simple/ipa_context.h @@ -73,9 +73,7 @@ struct IPAActiveState { }; struct IPAFrameContext : public FrameContext { - struct { - Matrix<float, 3, 3> ccm; - } ccm; + Matrix<float, 3, 3> ccm; struct { int32_t exposure;
The struct has only one member and there is no immediate need to add more. Let's use the member directly, to make things a bit simpler. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- src/ipa/simple/algorithms/ccm.cpp | 6 +++--- src/ipa/simple/ipa_context.h | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-)