diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-19 14:50:14 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-05-01 12:13:56 +0200 |
commit | cecf2f690a16ad8a99d739f42b3bdb6745fafc07 (patch) | |
tree | 7c17c0346c8a6649197a53120362eeefe5cac76e /iq.c | |
parent | 0e6faa79f6fae04321abfbb4be30df7d732d5d7f (diff) |
iq: Add ae-delay and ae-interval parameters
The ae-delay parameter selects the number of frames to skip at stream
startup before running the auto exposure algorithm. The ae-interval
selects the number of frames between AE runs. This can be used to delay
AE when the sensor needs one or more frames to apply exposure and/or
gain values.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'iq.c')
-rw-r--r-- | iq.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -61,8 +61,17 @@ void iq_aewb_process(struct iq_tuning *iq, omap3_isp_preview_set_white_balance(iq->isp, gains); - /* Automatic Exposure */ - if ((iq->frame_count++ % 2) == 0) + /* Automatic Exposure + * + * Skip ae_delay frames at stream startup, and only run AE every + * ae_interval frames to take sensor exposure internal delays into + * account. + */ + iq->frame_count++; + if (iq->frame_count <= iqp->ae_delay) + return; + + if ((iq->frame_count - iqp->ae_delay - 1) % iqp->ae_interval) return; mean = stats->accum[0] + stats->accum[1] @@ -97,6 +106,8 @@ void iq_params_init(struct iq_params *params) params->window.top = 0.0; params->window.width = 1.0; params->window.height = 1.0; + params->ae_delay = 1; + params->ae_interval = 2; params->mean_level = 0.15; params->exposure = 1000; params->exposure_min = 10; @@ -137,7 +148,11 @@ int iq_params_parse(struct iq_params *params, const char *arg) size = value - arg; value++; - if (strncmp(arg, "exposure-def", size) == 0) + if (strncmp(arg, "ae-delay", size) == 0) + val_uint = ¶ms->ae_delay; + else if (strncmp(arg, "ae-interval", size) == 0) + val_uint = ¶ms->ae_interval; + else if (strncmp(arg, "exposure-def", size) == 0) val_uint = ¶ms->exposure; else if (strncmp(arg, "exposure-min", size) == 0) val_uint = ¶ms->exposure_min; |