<div dir="ltr"><div dir="ltr">Hi David,<div><br></div><div>Thanks for this work!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 25 Jan 2023 at 13:20, David Plowman via libcamera-devel <<a href="mailto:libcamera-devel@lists.libcamera.org">libcamera-devel@lists.libcamera.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Flicker is the term used to describe brightness banding or oscillation<br>
of images caused typically by artificial lighting driven by a 50 or<br>
60Hz mains supply. We add two controls intended to be used by AEC/AGC<br>
algorithms:<br>
<br>
AeFlickerMode to determine whether flicker avoidance is active or not.<br>
<br>
AeFlickerPeriod to specify a custom flicker period when the period is<br>
other than 50 or 60Hz.<br>
<br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 src/libcamera/control_ids.yaml | 52 ++++++++++++++++++++++++++++++++++<br>
 1 file changed, 52 insertions(+)<br>
<br>
diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml<br>
index adea5f90..5e5428ea 100644<br>
--- a/src/libcamera/control_ids.yaml<br>
+++ b/src/libcamera/control_ids.yaml<br>
@@ -14,6 +14,58 @@ controls:<br>
<br>
         \sa ExposureTime AnalogueGain<br>
<br>
+  - AeFlickerMode:<br>
+      type: int32_t<br>
+      description: |<br>
+        Set the flicker mode, which determines whether, and how, the AGC/AEC<br>
+        algorithm attempts to hide flicker effects caused by the duty cycle of<br>
+        artificial lighting.<br>
+<br>
+        Although implementation dependent, many algorithms for "flicker<br>
+        avoidance" work by restricting the exposure time to integer multiples<br>
+        of this cycle period, wherever possible.<br>
+<br>
+        Implementations may not support all of the flicker modes listed below.<br>
+<br>
+      enum:<br>
+        - name: FlickerOff<br>
+          value: 0<br>
+          description: No flicker avoidance is performed.<br>
+        - name: Flicker50Hz<br>
+          value: 1<br>
+          description: 50Hz flicker avoidance.<br>
+            Suppress flicker effects caused by lighting runing with a<br>
+            100Hz period (such as produced by 50Hz mains electricity).<br>
+        - name: Flicker60Hz<br>
+          value: 2<br>
+          description: 60Hz flicker avoidance.<br>
+            Suppress flicker effects caused by lighting running with a<br>
+            120Hz period (such as produced by 60Hz mains electricity).<br>
+        - name: FlickerCustom<br>
+          value: 3<br>
+          description: Custom flicker avoidance.<br>
+            Suppress flicker effects caused by lighting running with a<br>
+            period specified by AeFlickerPeriod.<br>
+<br>
+            \sa AeFlickerPeriod<br>
+        - name: FlickerAuto<br>
+          value: 4<br>
+          description: Automatic flicker period detection and avoidance.<br>
+            The system will automatically determine the most likely value<br>
+            of the flicker period, and avoid flicker of this frequency.<br>
+        <br>
+  - AeFlickerPeriod:<br>
+      type: int32_t<br>
+      description: Custom flicker period in microseconds.<br>
+        This value is taken as the current flicker period to avoid. It<br>
+        is used when the AeFlickerMode is set to FlickerCustom.<br>
+<br>
+        For example, to avoid 50Hz mains flicker, you could set the period<br>
+        to 10000, corresponding to 10ms (twice the mains frequency), and<br>
+        AeFlickerMode to FlickerCustom.<br>
+<br>
+        \sa AeFlickerMode<br>
+<br>
   - AeLocked:<br>
       type: bool<br>
       description: |<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div></div>