ipa: ipu3: Rework IPAFrameContext

Currently, IPAFrameContext consolidates the values computed by the
active state of the algorithms, along with the values applied on
the sensor.

Moving ahead, we want to have a frame context associated with each
incoming request (or frame to be captured). This shouldn't necessarily
be tied to "active state" of the algorithms hence:

- Rename current IPAFrameContext -> IPAActiveState
  This will now reflect the latest active state of the algorithms and
  has nothing to do with any frame-related ops/values.

- Re-instate IPAFrameContext with a sub-structure 'sensor' currently
  storing the exposure and gain value.

Adapt the various access to the frame context to the new changes
as described above.

Subsequently, the re-instated IPAFrameContext will be extended to
contain a frame number and ControlList to remember the incoming
request controls provided by the application. A ring-buffer will
be introduced to store these frame contexts for a certain number
of frames.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Umang Jain 2022-05-06 15:23:06 +05:30 committed by Kieran Bingham
parent e0766fa205
commit bab437df1f
8 changed files with 113 additions and 95 deletions

View file

@ -396,10 +396,10 @@ void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)
* The results are cached, so if no results were calculated, we set the
* cached values from asyncResults_ here.
*/
context.frameContext.awb.gains.blue = asyncResults_.blueGain;
context.frameContext.awb.gains.green = asyncResults_.greenGain;
context.frameContext.awb.gains.red = asyncResults_.redGain;
context.frameContext.awb.temperatureK = asyncResults_.temperatureK;
context.activeState.awb.gains.blue = asyncResults_.blueGain;
context.activeState.awb.gains.green = asyncResults_.greenGain;
context.activeState.awb.gains.red = asyncResults_.redGain;
context.activeState.awb.temperatureK = asyncResults_.temperatureK;
}
constexpr uint16_t Awb::threshold(float value)
@ -450,10 +450,10 @@ void Awb::prepare(IPAContext &context, ipu3_uapi_params *params)
params->acc_param.bnr.opt_center_sqr.y_sqr_reset = params->acc_param.bnr.opt_center.y_reset
* params->acc_param.bnr.opt_center.y_reset;
/* Convert to u3.13 fixed point values */
params->acc_param.bnr.wb_gains.gr = 8192 * context.frameContext.awb.gains.green;
params->acc_param.bnr.wb_gains.r = 8192 * context.frameContext.awb.gains.red;
params->acc_param.bnr.wb_gains.b = 8192 * context.frameContext.awb.gains.blue;
params->acc_param.bnr.wb_gains.gb = 8192 * context.frameContext.awb.gains.green;
params->acc_param.bnr.wb_gains.gr = 8192 * context.activeState.awb.gains.green;
params->acc_param.bnr.wb_gains.r = 8192 * context.activeState.awb.gains.red;
params->acc_param.bnr.wb_gains.b = 8192 * context.activeState.awb.gains.blue;
params->acc_param.bnr.wb_gains.gb = 8192 * context.activeState.awb.gains.green;
LOG(IPU3Awb, Debug) << "Color temperature estimated: " << asyncResults_.temperatureK;