Skip to content

Commit 15255c9

Browse files
ipa: rpi: AF speed up CDAF->PDAF transition. TO BE SQUASHED
Fix phase sign test; allow more extrapolation (clipped) in CAF Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
1 parent 06d67e8 commit 15255c9

File tree

1 file changed

+4
-3
lines changed
  • src/ipa/rpi/controller/rpi

1 file changed

+4
-3
lines changed

src/ipa/rpi/controller/rpi/af.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,12 @@ bool Af::earlyTerminationByPhase(double phase)
485485
* Interpolate/extrapolate the lens position for zero phase.
486486
* Check that the extrapolation is well-conditioned.
487487
*/
488-
if ((ftarget_ - oldFocus) * (phase - oldPhase) > 0.0) {
488+
if ((ftarget_ - oldFocus) * (phase - oldPhase) * cfg_.speeds[speed_].pdafGain < 0.0) {
489489
double param = phase / (phase - oldPhase);
490-
if (-2.5 <= param && param <= 3.0) {
491-
ftarget_ += param * (oldFocus - ftarget_);
490+
if ((-2.5 <= param || mode_ == AfModeContinuous) && param <= 3.0) {
492491
LOG(RPiAf, Debug) << "ETBP: param=" << param;
492+
param = std::max(param, -2.5);
493+
ftarget_ += param * (oldFocus - ftarget_);
493494
return true;
494495
}
495496
}

0 commit comments

Comments
 (0)