Browse Source

af: if it improves on its own, likely scene or AE changed, and time to restart

Pavel Machek 6 months ago
parent
commit
bbc077f528
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/process_pipeline.c

+ 5 - 0
src/process_pipeline.c

@@ -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();