[{"id":26364,"web_url":"https://patchwork.libcamera.org/comment/26364/","msgid":"<167481625659.42371.6276115870784922456@Monstersaurus>","date":"2023-01-27T10:44:16","subject":"Re: [libcamera-devel] [PATCH v2 1/2] libcamera: controls: Add\n\tcontrols for AEC/AGC flicker avoidance","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting David Plowman via libcamera-devel (2023-01-26 13:45:58)\n> Flicker is the term used to describe brightness banding or oscillation\n> of images caused typically by artificial lighting driven by a 50 or\n> 60Hz mains supply. We add two controls intended to be used by AEC/AGC\n> algorithms:\n> \n> AeFlickerMode to determine whether flicker avoidance is active or not.\n> \n> AeFlickerPeriod to specify a custom flicker period when the period is\n> other than 50 or 60Hz.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/libcamera/control_ids.yaml | 69 +++++++++++++++++++++++++---------\n>  1 file changed, 52 insertions(+), 17 deletions(-)\n> \n> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> index adea5f90..8093ab75 100644\n> --- a/src/libcamera/control_ids.yaml\n> +++ b/src/libcamera/control_ids.yaml\n> @@ -14,6 +14,58 @@ controls:\n>  \n>          \\sa ExposureTime AnalogueGain\n>  \n> +  - AeFlickerMode:\n> +      type: int32_t\n> +      description: |\n> +        Set the flicker mode, which determines whether, and how, the AGC/AEC\n> +        algorithm attempts to hide flicker effects caused by the duty cycle of\n> +        artificial lighting.\n> +\n> +        Although implementation dependent, many algorithms for \"flicker\n> +        avoidance\" work by restricting the exposure time to integer multiples\n> +        of this cycle period, wherever possible.\n> +\n> +        Implementations may not support all of the flicker modes listed below.\n> +\n> +      enum:\n> +        - name: FlickerOff\n> +          value: 0\n> +          description: No flicker avoidance is performed.\n> +        - name: FlickerFreq50Hz\n> +          value: 1\n> +          description: 50Hz flicker avoidance.\n> +            Suppress flicker effects caused by lighting runing with a\n> +            100Hz period (such as produced by 50Hz mains electricity).\n> +        - name: FlickerFreq60Hz\n> +          value: 2\n> +          description: 60Hz flicker avoidance.\n> +            Suppress flicker effects caused by lighting running with a\n> +            120Hz period (such as produced by 60Hz mains electricity).\n> +        - name: FlickerCustom\n> +          value: 3\n> +          description: Custom flicker avoidance.\n> +            Suppress flicker effects caused by lighting running with a\n> +            period specified by AeFlickerPeriod.\n> +\n> +            \\sa AeFlickerPeriod\n> +        - name: FlickerAuto\n> +          value: 4\n> +          description: Automatic flicker period detection and avoidance.\n> +            The system will automatically determine the most likely value\n> +            of the flicker period, and avoid flicker of this frequency.\n> +        \n> +  - AeFlickerPeriod:\n> +      type: int32_t\n> +      description: Custom flicker period in microseconds.\n> +        This value is taken as the current flicker period to avoid. It\n> +        is used when the AeFlickerMode is set to FlickerCustom.\n> +\n> +        For example, to avoid 50Hz mains flicker, you could set the period\n> +        to 10000, corresponding to 10ms (twice the mains frequency), and\n> +        AeFlickerMode to FlickerCustom.\n> +\n> +        \\sa AeFlickerMode\n> +\n>    - AeLocked:\n>        type: bool\n>        description: |\n> @@ -843,23 +895,6 @@ controls:\n>            value: 1\n>            description: The lens shading map mode is available.\n>  \n> -  - SceneFlicker:\n> -      type: int32_t\n> -      draft: true\n> -      description: |\n> -       Control to report the detected scene light frequency. Currently\n> -       identical to ANDROID_STATISTICS_SCENE_FLICKER.\n\nThis reads as if it is expected to be used to report the detected\nflicker as metadata (presumably in the equivalent to FlickerAuto).\n\nWould you expect to always report the used flicker period with\nAeFlickerPeriod in the metadata perhaps?\n\n\n\n\n> -      enum:\n> -        - name: SceneFickerOff\n> -          value: 0\n> -          description: No flickering detected.\n> -        - name: SceneFicker50Hz\n> -          value: 1\n> -          description: 50Hz flickering detected.\n> -        - name: SceneFicker60Hz\n> -          value: 2\n> -          description: 60Hz flickering detected.\n> -\n>    - PipelineDepth:\n>        type: int32_t\n>        draft: true\n> -- \n> 2.30.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1BA0DBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jan 2023 10:44:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 786AF625E4;\n\tFri, 27 Jan 2023 11:44:22 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 106E7600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 11:44:20 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8132C2B3;\n\tFri, 27 Jan 2023 11:44:19 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674816262;\n\tbh=RkdvCa0xwwuAUbmg9Wcee6zY+EPKrA/C0wbVgM6Yg7o=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=qLK3Ws8GWbIW8hna+DYHYVKfLZtYhTXU4IGsjqUxwHOhq9pzJaokckhVXTZAqXFpn\n\tHQl7m1m+ZVFgL63njrtDQK2H/nNtS/F/0YwkF1wht7bVMfik4/eF0kNPgCLwL+gy7h\n\tuO72VAbRuq5z/CCMOiYjF0oKyS/GxmKnOpBBkmtrGdWUGv0CRI+8gLD8G7FMS60y9i\n\trGEeL0Z8mfM2j9di75U3HNN7oZxVktLqn952I/dWjiXeTZ89aQpSjtlyjrY0H/JnnR\n\tCOrY1iAamlgUIxx0JWEqguuoFqc4CHxdmtVQfK5+nSVKbvrvbda0zSz2X99ZYuWk0Y\n\tccDvb4rqVCh9g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1674816259;\n\tbh=RkdvCa0xwwuAUbmg9Wcee6zY+EPKrA/C0wbVgM6Yg7o=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=KRuhbNcUzTeYLLzEgFF0Ztdx1Di1ja3oPOlBwG5vO3G/bNK1vPguHkK5fYxOuTKzO\n\tn6Ogw7QWS50X8oljtS4nFFPfT/GbiBjYc049FOsuFm9KSXG1DN3Z2HLS4HcOBHwiV6\n\tPg+OBBr2rH4MckDTCYSVXxpbVMb1pCJnVLTC7S9g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KRuhbNcU\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230126134559.3323-2-david.plowman@raspberrypi.com>","References":"<20230126134559.3323-1-david.plowman@raspberrypi.com>\n\t<20230126134559.3323-2-david.plowman@raspberrypi.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 27 Jan 2023 10:44:16 +0000","Message-ID":"<167481625659.42371.6276115870784922456@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 1/2] libcamera: controls: Add\n\tcontrols for AEC/AGC flicker avoidance","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]