auto: tweak debugging
This commit is contained in:
@@ -401,22 +401,22 @@ struct focus_stats {
|
|||||||
static void auto_focus_step(const struct focus_stats *stats)
|
static void auto_focus_step(const struct focus_stats *stats)
|
||||||
{
|
{
|
||||||
static uint64_t best_sharp, best_focus;
|
static uint64_t best_sharp, best_focus;
|
||||||
static const bool debug = true;
|
static const int debug = 1;
|
||||||
|
|
||||||
if (debug) printf("Phase %d, sharp %d best %d ", focus_phase, (int)(stats->sharp / 10000), (int)(best_sharp/ 10000));
|
|
||||||
if (focus_phase >= PH_DONE) {
|
if (focus_phase >= PH_DONE) {
|
||||||
|
if (debug>1) printf("Phase %d, sharp %d best %d ", focus_phase, (int)(stats->sharp / 10000), (int)(best_sharp/ 10000));
|
||||||
focus_phase++;
|
focus_phase++;
|
||||||
if (stats->sharp > (best_sharp * 2)) {
|
if (stats->sharp > (best_sharp * 2)) {
|
||||||
if (debug) printf("Improved on its own.\n");
|
if (debug>1) printf("Improved on its own.\n");
|
||||||
auto_focus_start();
|
auto_focus_start();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (stats->sharp < (best_sharp * 6) / 10) {
|
if (stats->sharp < (best_sharp * 6) / 10) {
|
||||||
if (debug) printf("Lost, restart.\n");
|
if (debug>1) printf("Lost, restart.\n");
|
||||||
auto_focus_start();
|
auto_focus_start();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (debug) printf("Idle @ %d.\n", focus);
|
if (debug>1) printf("Idle @ %d.\n", focus);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (focus_phase < PH_SWEEP) {
|
if (focus_phase < PH_SWEEP) {
|
||||||
@@ -424,9 +424,11 @@ static void auto_focus_step(const struct focus_stats *stats)
|
|||||||
focus = 200;
|
focus = 200;
|
||||||
focus_phase ++;
|
focus_phase ++;
|
||||||
best_focus = 0;
|
best_focus = 0;
|
||||||
if (debug) printf("...prepare\n");
|
if (debug>1) printf("...prepare\n");
|
||||||
goto set;
|
goto set;
|
||||||
}
|
}
|
||||||
|
if (debug)
|
||||||
|
printf("Phase %d, sharp %d best %d ", focus_phase, (int)(stats->sharp / 10000), (int)(best_sharp/ 10000));
|
||||||
if (stats->sharp > best_sharp) {
|
if (stats->sharp > best_sharp) {
|
||||||
if (debug) printf("Still improving, focus %d\n", focus);
|
if (debug) printf("Still improving, focus %d\n", focus);
|
||||||
best_focus = focus;
|
best_focus = focus;
|
||||||
@@ -473,6 +475,7 @@ focus_stats(struct focus_stats *stats, const unsigned int *frame, const int widt
|
|||||||
stats->sharp = sharp;
|
stats->sharp = sharp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This does approximately 1.3 EV steps */
|
||||||
static void update_exp(controlstate *control, int direction)
|
static void update_exp(controlstate *control, int direction)
|
||||||
{
|
{
|
||||||
int step = 0;
|
int step = 0;
|
||||||
@@ -534,7 +537,7 @@ process_aaa()
|
|||||||
printf("D/Gain + %d\n", state_proc.dgain.value_req);
|
printf("D/Gain + %d\n", state_proc.dgain.value_req);
|
||||||
} else {
|
} else {
|
||||||
printf("AE: out of options\n");
|
printf("AE: out of options\n");
|
||||||
exit(1); /* HACK HACK don't merge */
|
//exit(1); /* HACK HACK don't merge */
|
||||||
}
|
}
|
||||||
} else if (direction < 0) {
|
} else if (direction < 0) {
|
||||||
// Preview is too bright
|
// Preview is too bright
|
||||||
|
Reference in New Issue
Block a user