From 0fa2b05a868665c27d74433b227d54d8f3af6c89 Mon Sep 17 00:00:00 2001 From: Nick Hollinghurst Date: Fri, 20 Jun 2025 13:42:24 +0100 Subject: [PATCH] ipa: rpi: controller: AutoFocus weighting tweak In getPhase(), stop using different weights for sumWc and sumWcp. This should improve linearity e.g. in earlyTerminationByPhase(). Phases are slightly larger but confidence values slightly reduced. Signed-off-by: Nick Hollinghurst Signed-off-by: Naushir Patuck Reviewed-by: Naushir Patuck Signed-off-by: Kieran Bingham --- src/ipa/rpi/controller/rpi/af.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/af.cpp b/src/ipa/rpi/controller/rpi/af.cpp index 8df614ed7..5304f54ca 100644 --- a/src/ipa/rpi/controller/rpi/af.cpp +++ b/src/ipa/rpi/controller/rpi/af.cpp @@ -328,9 +328,8 @@ bool Af::getPhase(PdafRegions const ®ions, double &phase, double &conf) if (c >= cfg_.confThresh) { if (c > cfg_.confClip) c = cfg_.confClip; - c -= (cfg_.confThresh >> 2); + c -= (cfg_.confThresh >> 1); sumWc += w * c; - c -= (cfg_.confThresh >> 2); sumWcp += (int64_t)(w * c) * (int64_t)data.phase; } }