Lines Matching full:gain
3 * Functions for auto gain.
9 /* auto gain and exposure algorithm based on the knee algorithm described here:
12 Returns 0 if no changes were made, 1 if the gain and or exposure settings
22 s32 gain, orig_gain, exposure, orig_exposure; in gspca_expo_autogain() local
28 orig_gain = gain = v4l2_ctrl_g_ctrl(gspca_dev->gain); in gspca_expo_autogain()
40 if (gain > gain_knee) in gspca_expo_autogain()
41 gain--; in gspca_expo_autogain()
44 else if (gain > gspca_dev->gain->default_value) in gspca_expo_autogain()
45 gain--; in gspca_expo_autogain()
48 else if (gain > gspca_dev->gain->minimum) in gspca_expo_autogain()
49 gain--; in gspca_expo_autogain()
53 if (gain < gspca_dev->gain->default_value) in gspca_expo_autogain()
54 gain++; in gspca_expo_autogain()
57 else if (gain < gain_knee) in gspca_expo_autogain()
58 gain++; in gspca_expo_autogain()
61 else if (gain < gspca_dev->gain->maximum) in gspca_expo_autogain()
62 gain++; in gspca_expo_autogain()
68 if (gain != orig_gain) { in gspca_expo_autogain()
69 v4l2_ctrl_s_ctrl(gspca_dev->gain, gain); in gspca_expo_autogain()
78 gspca_dbg(gspca_dev, D_FRAM, "autogain: changed gain: %d, expo: %d\n", in gspca_expo_autogain()
79 gain, exposure); in gspca_expo_autogain()
88 this algorithm normally tries to only adjust the gain (between 40 and
94 Returns 0 if no changes were made, 1 if the gain and or exposure settings
102 s32 gain_low, gain_high, gain, orig_gain, exposure, orig_exposure; in gspca_coarse_grained_expo_autogain() local
108 orig_gain = gain = v4l2_ctrl_g_ctrl(gspca_dev->gain); in gspca_coarse_grained_expo_autogain()
111 gain_low = (s32)(gspca_dev->gain->maximum - gspca_dev->gain->minimum) / in gspca_coarse_grained_expo_autogain()
112 5 * 2 + gspca_dev->gain->minimum; in gspca_coarse_grained_expo_autogain()
113 gain_high = (s32)(gspca_dev->gain->maximum - gspca_dev->gain->minimum) / in gspca_coarse_grained_expo_autogain()
114 5 * 4 + gspca_dev->gain->minimum; in gspca_coarse_grained_expo_autogain()
123 if ((gain + steps) > gain_high && in gspca_coarse_grained_expo_autogain()
125 gain = gain_high; in gspca_coarse_grained_expo_autogain()
128 } else if ((gain + steps) < gain_low && in gspca_coarse_grained_expo_autogain()
130 gain = gain_low; in gspca_coarse_grained_expo_autogain()
134 gain += steps; in gspca_coarse_grained_expo_autogain()
135 if (gain > gspca_dev->gain->maximum) in gspca_coarse_grained_expo_autogain()
136 gain = gspca_dev->gain->maximum; in gspca_coarse_grained_expo_autogain()
137 else if (gain < gspca_dev->gain->minimum) in gspca_coarse_grained_expo_autogain()
138 gain = gspca_dev->gain->minimum; in gspca_coarse_grained_expo_autogain()
151 if (gain != orig_gain) { in gspca_coarse_grained_expo_autogain()
152 v4l2_ctrl_s_ctrl(gspca_dev->gain, gain); in gspca_coarse_grained_expo_autogain()
161 gspca_dbg(gspca_dev, D_FRAM, "autogain: changed gain: %d, expo: %d\n", in gspca_coarse_grained_expo_autogain()
162 gain, exposure); in gspca_coarse_grained_expo_autogain()