ipa: rkisp1: awb: Don't calculate RGB means if stats are missing
When statistics are missing we can't meaningfully calculate the RGB means. Move their calculation after checking if stats are available. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
This commit is contained in:
parent
127bc20965
commit
1bb4d3712d
1 changed files with 5 additions and 3 deletions
|
@ -279,10 +279,7 @@ void Awb::process(IPAContext &context,
|
||||||
const rkisp1_stat_buffer *stats,
|
const rkisp1_stat_buffer *stats,
|
||||||
ControlList &metadata)
|
ControlList &metadata)
|
||||||
{
|
{
|
||||||
const rkisp1_cif_isp_stat *params = &stats->params;
|
|
||||||
const rkisp1_cif_isp_awb_stat *awb = ¶ms->awb;
|
|
||||||
IPAActiveState &activeState = context.activeState;
|
IPAActiveState &activeState = context.activeState;
|
||||||
RGB<double> rgbMeans = calculateRgbMeans(frameContext, awb);
|
|
||||||
|
|
||||||
metadata.set(controls::AwbEnable, frameContext.awb.autoEnabled);
|
metadata.set(controls::AwbEnable, frameContext.awb.autoEnabled);
|
||||||
metadata.set(controls::ColourGains, {
|
metadata.set(controls::ColourGains, {
|
||||||
|
@ -296,6 +293,11 @@ void Awb::process(IPAContext &context,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const rkisp1_cif_isp_stat *params = &stats->params;
|
||||||
|
const rkisp1_cif_isp_awb_stat *awb = ¶ms->awb;
|
||||||
|
|
||||||
|
RGB<double> rgbMeans = calculateRgbMeans(frameContext, awb);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the means are too small we don't have enough information to
|
* If the means are too small we don't have enough information to
|
||||||
* meaningfully calculate gains. Freeze the algorithm in that case.
|
* meaningfully calculate gains. Freeze the algorithm in that case.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue