| Message ID | 20260914140309.3354666-21-stefan.klug@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
2026. 09. 14. 16:02 keltezéssel, Stefan Klug írta: > A pipeline handler can call processStats() on the IPA even in the case > that no valid stats are available, just to populate the metadata with > the values from the frame context. > > Add support for that to the AWB algorithm by populating the metadata > before checking if stats are valid. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> > --- Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > src/ipa/libipa/awb.cpp | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/src/ipa/libipa/awb.cpp b/src/ipa/libipa/awb.cpp > index da835bec018d..81d616c3a646 100644 > --- a/src/ipa/libipa/awb.cpp > +++ b/src/ipa/libipa/awb.cpp > @@ -372,6 +372,12 @@ void AwbAlgorithmBase::process(awb::ActiveState &state, > const AwbStats &stats, unsigned int lux, > ControlList &metadata) > { > + /* Populate metadata. */ > + metadata.set(controls::AwbEnable, frameContext.autoEnabled); > + metadata.set(controls::ColourGains, { static_cast<float>(frameContext.gains.r()), > + static_cast<float>(frameContext.gains.b()) }); > + metadata.set(controls::ColourTemperature, frameContext.colourTemperature); > + > if (!stats.valid()) > return; > > @@ -393,12 +399,6 @@ void AwbAlgorithmBase::process(awb::ActiveState &state, > state.automatic.gains = awbResult.gains * speed + > state.automatic.gains * (1 - speed); > > - /* Populate metadata. */ > - metadata.set(controls::AwbEnable, frameContext.autoEnabled); > - metadata.set(controls::ColourGains, { static_cast<float>(frameContext.gains.r()), > - static_cast<float>(frameContext.gains.b()) }); > - metadata.set(controls::ColourTemperature, frameContext.colourTemperature); > - > LOG(Awb, Debug) << std::showpoint << "Means " << stats.rgbMeans() > << ", gains " << state.automatic.gains > << ", temp " << state.automatic.colourTemperature << "K";
diff --git a/src/ipa/libipa/awb.cpp b/src/ipa/libipa/awb.cpp index da835bec018d..81d616c3a646 100644 --- a/src/ipa/libipa/awb.cpp +++ b/src/ipa/libipa/awb.cpp @@ -372,6 +372,12 @@ void AwbAlgorithmBase::process(awb::ActiveState &state, const AwbStats &stats, unsigned int lux, ControlList &metadata) { + /* Populate metadata. */ + metadata.set(controls::AwbEnable, frameContext.autoEnabled); + metadata.set(controls::ColourGains, { static_cast<float>(frameContext.gains.r()), + static_cast<float>(frameContext.gains.b()) }); + metadata.set(controls::ColourTemperature, frameContext.colourTemperature); + if (!stats.valid()) return; @@ -393,12 +399,6 @@ void AwbAlgorithmBase::process(awb::ActiveState &state, state.automatic.gains = awbResult.gains * speed + state.automatic.gains * (1 - speed); - /* Populate metadata. */ - metadata.set(controls::AwbEnable, frameContext.autoEnabled); - metadata.set(controls::ColourGains, { static_cast<float>(frameContext.gains.r()), - static_cast<float>(frameContext.gains.b()) }); - metadata.set(controls::ColourTemperature, frameContext.colourTemperature); - LOG(Awb, Debug) << std::showpoint << "Means " << stats.rgbMeans() << ", gains " << state.automatic.gains << ", temp " << state.automatic.colourTemperature << "K";
A pipeline handler can call processStats() on the IPA even in the case that no valid stats are available, just to populate the metadata with the values from the frame context. Add support for that to the AWB algorithm by populating the metadata before checking if stats are valid. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/libipa/awb.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)