|
@@ -398,6 +398,11 @@ static void auto_focus_step(const struct focus_stats *stats)
|
|
|
if (debug) printf("Phase %d, sharp %d best %d ", focus_phase, (int)(stats->sharp / 10000), (int)(best_sharp/ 10000));
|
|
|
if (focus_phase >= PH_DONE) {
|
|
|
focus_phase++;
|
|
|
+ if (stats->sharp > (best_sharp * 2)) {
|
|
|
+ if (debug) printf("Improved on its own.\n");
|
|
|
+ auto_focus_start();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (stats->sharp < (best_sharp * 6) / 10) {
|
|
|
if (debug) printf("Lost, restart.\n");
|
|
|
auto_focus_start();
|