Message ID | 20250815102945.1602071-18-stefan.klug@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
On 15/08/2025 11:29, Stefan Klug wrote: > The upcoming WDR algorithm needs access to the effective yTarget value > for its calculations. Add it to the frame context. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> > --- > src/ipa/rkisp1/algorithms/agc.cpp | 5 +++++ > src/ipa/rkisp1/ipa_context.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp > index d566a3fbef4a..7a4d3b064415 100644 > --- a/src/ipa/rkisp1/algorithms/agc.cpp > +++ b/src/ipa/rkisp1/algorithms/agc.cpp > @@ -207,6 +207,8 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) > context.configuration.sensor.minAnalogueGain, > context.configuration.sensor.maxAnalogueGain, {}); > > + context.activeState.agc.automatic.yTarget = effectiveYTarget(); > + > resetFrameCount(); > > return 0; > @@ -374,6 +376,8 @@ void Agc::prepare(IPAContext &context, const uint32_t frame, > frameContext.compress.gain = frameContext.agc.quantizationGain; > } > > + frameContext.agc.yTarget = context.activeState.agc.automatic.yTarget; > + > if (frame > 0 && !frameContext.agc.updateMetering) > return; > > @@ -618,6 +622,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, > activeState.agc.automatic.exposure = newExposureTime / lineDuration; > activeState.agc.automatic.gain = aGain; > activeState.agc.automatic.quantizationGain = qGain; > + activeState.agc.automatic.yTarget = effectiveYTarget(); > /* > * Expand the target frame duration so that we do not run faster than > * the minimum frame duration when we have short exposures. > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h > index 60cfab228edf..ab0bbe0eb690 100644 > --- a/src/ipa/rkisp1/ipa_context.h > +++ b/src/ipa/rkisp1/ipa_context.h > @@ -79,6 +79,7 @@ struct IPAActiveState { > uint32_t exposure; > double gain; > double quantizationGain; > + double yTarget; > } automatic; > > bool autoExposureEnabled; > @@ -139,6 +140,7 @@ struct IPAFrameContext : public FrameContext { > double exposureValue; > double quantizationGain; > uint32_t vblank; > + double yTarget; > bool autoExposureEnabled; > bool autoGainEnabled; > controls::AeConstraintModeEnum constraintMode;
Quoting Stefan Klug (2025-08-15 19:29:37) > The upcoming WDR algorithm needs access to the effective yTarget value > for its calculations. Add it to the frame context. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/ipa/rkisp1/algorithms/agc.cpp | 5 +++++ > src/ipa/rkisp1/ipa_context.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp > index d566a3fbef4a..7a4d3b064415 100644 > --- a/src/ipa/rkisp1/algorithms/agc.cpp > +++ b/src/ipa/rkisp1/algorithms/agc.cpp > @@ -207,6 +207,8 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) > context.configuration.sensor.minAnalogueGain, > context.configuration.sensor.maxAnalogueGain, {}); > > + context.activeState.agc.automatic.yTarget = effectiveYTarget(); > + > resetFrameCount(); > > return 0; > @@ -374,6 +376,8 @@ void Agc::prepare(IPAContext &context, const uint32_t frame, > frameContext.compress.gain = frameContext.agc.quantizationGain; > } > > + frameContext.agc.yTarget = context.activeState.agc.automatic.yTarget; > + > if (frame > 0 && !frameContext.agc.updateMetering) > return; > > @@ -618,6 +622,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, > activeState.agc.automatic.exposure = newExposureTime / lineDuration; > activeState.agc.automatic.gain = aGain; > activeState.agc.automatic.quantizationGain = qGain; > + activeState.agc.automatic.yTarget = effectiveYTarget(); > /* > * Expand the target frame duration so that we do not run faster than > * the minimum frame duration when we have short exposures. > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h > index 60cfab228edf..ab0bbe0eb690 100644 > --- a/src/ipa/rkisp1/ipa_context.h > +++ b/src/ipa/rkisp1/ipa_context.h > @@ -79,6 +79,7 @@ struct IPAActiveState { > uint32_t exposure; > double gain; > double quantizationGain; > + double yTarget; > } automatic; > > bool autoExposureEnabled; > @@ -139,6 +140,7 @@ struct IPAFrameContext : public FrameContext { > double exposureValue; > double quantizationGain; > uint32_t vblank; > + double yTarget; > bool autoExposureEnabled; > bool autoGainEnabled; > controls::AeConstraintModeEnum constraintMode; > -- > 2.48.1 >
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index d566a3fbef4a..7a4d3b064415 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -207,6 +207,8 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) context.configuration.sensor.minAnalogueGain, context.configuration.sensor.maxAnalogueGain, {}); + context.activeState.agc.automatic.yTarget = effectiveYTarget(); + resetFrameCount(); return 0; @@ -374,6 +376,8 @@ void Agc::prepare(IPAContext &context, const uint32_t frame, frameContext.compress.gain = frameContext.agc.quantizationGain; } + frameContext.agc.yTarget = context.activeState.agc.automatic.yTarget; + if (frame > 0 && !frameContext.agc.updateMetering) return; @@ -618,6 +622,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, activeState.agc.automatic.exposure = newExposureTime / lineDuration; activeState.agc.automatic.gain = aGain; activeState.agc.automatic.quantizationGain = qGain; + activeState.agc.automatic.yTarget = effectiveYTarget(); /* * Expand the target frame duration so that we do not run faster than * the minimum frame duration when we have short exposures. diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 60cfab228edf..ab0bbe0eb690 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -79,6 +79,7 @@ struct IPAActiveState { uint32_t exposure; double gain; double quantizationGain; + double yTarget; } automatic; bool autoExposureEnabled; @@ -139,6 +140,7 @@ struct IPAFrameContext : public FrameContext { double exposureValue; double quantizationGain; uint32_t vblank; + double yTarget; bool autoExposureEnabled; bool autoGainEnabled; controls::AeConstraintModeEnum constraintMode;
The upcoming WDR algorithm needs access to the effective yTarget value for its calculations. Add it to the frame context. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/rkisp1/algorithms/agc.cpp | 5 +++++ src/ipa/rkisp1/ipa_context.h | 2 ++ 2 files changed, 7 insertions(+)