{"id":18195,"url":"https://patchwork.libcamera.org/api/patches/18195/?format=json","web_url":"https://patchwork.libcamera.org/patch/18195/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230125132018.5725-1-david.plowman@raspberrypi.com>","date":"2023-01-25T13:20:18","name":"[libcamera-devel] libcamera: controls: Add controls for AEC/AGC flicker avoidance","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"7a51b54b75bec738a7c6b40196c78415f03493d5","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18195/mbox/","series":[{"id":3725,"url":"https://patchwork.libcamera.org/api/series/3725/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3725","date":"2023-01-25T13:20:18","name":"[libcamera-devel] libcamera: controls: Add controls for AEC/AGC flicker avoidance","version":1,"mbox":"https://patchwork.libcamera.org/series/3725/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18195/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18195/checks/","tags":{},"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 564A9BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Jan 2023 13:20:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BF1DA603C0;\n\tWed, 25 Jan 2023 14:20:22 +0100 (CET)","from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n\t[IPv6:2a00:1450:4864:20::332])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 87943603C0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Jan 2023 14:20:20 +0100 (CET)","by mail-wm1-x332.google.com with SMTP id l8so13735721wms.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Jan 2023 05:20:20 -0800 (PST)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tu11-20020a05600c19cb00b003d9fb04f658sm2001790wmq.4.2023.01.25.05.20.19\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 25 Jan 2023 05:20:19 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674652822;\n\tbh=2gsqVNNljuMOh8K7uQizaNWqqyO2xS6ndW2NdjGHv4s=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=GiIhurr+JPct6R+CK9T/McjfZtVUDxrqVbK9fks1yrM0miTXemgz1yVs7FTwFtZLu\n\tEuAxZGWxmxSIKq60lRbp0vgFa8ZgiW5UKNlbLx4YlxaeRSuI0mt2zy9NqlTyNcGHR9\n\tvsz54ZilhiAEIohrt37j/0D4AZIxi+QOsHgwY5DslbkWzwnMtHha63iw8AJMKdmDWl\n\t2PloUjl1U4VBqhRlemVw9i18QtaO9nnSbl8jXm6JbJO0tSxSwVrO6biDPXGn5hKkeF\n\tji5sOICy8fkPoxuP87TwajyYDgjlgaMpmyFHA17evbwq3+Cqn0EipjQ8gOhmb6FL9v\n\tEt/yhyh0K9wKQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=sXmHimgTO9IyKRuXEywwrTEJoUvZeEdVNvqcXMWHjn8=;\n\tb=MdFzHEGfj5FOpWG1w0DixWiNFius0MjVwUxLM7BvyI6knJKnUlBm2grxdfgxTCNWTI\n\tbqN8MYRD6NfxCQK6OtXxcE2myOyHf/ZdVfnwHsj4CQlShoUjtmoFWpsGEYJAfqf/EHLI\n\tHgZ359DazrF7WjQVoKS9HRzvuZpxuAuOb3iApdu/iD92JTsj9iHPpiHafxUQhBm1GFRL\n\tjBSioc4e5lxefntY8910b0RqKd++ZpUrk4vRbMmrN0Xm9q27GRK34Cm5Q2OyUKlpxP/w\n\t8n2pRo3ej/Fn6rq1U+/w2Cc4/u0G/epBozGAFgaSFGTAdPXk9rhDzXCdNrvcCjvytUZL\n\tPOnA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"MdFzHEGf\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=sXmHimgTO9IyKRuXEywwrTEJoUvZeEdVNvqcXMWHjn8=;\n\tb=WVoD/aN1NHkag9SvFxrUWnfoczcfBXm+7PUMcZhUDbjsUPJYP1MB4OxnXlRol5N24I\n\tt1eQhWPDSqj0ns7CxpETRbKPW1M6n7CaWVZ2KDHG0Ar7Y85E5P5rwYBJ57GhwS+uFJIG\n\tyf67lsHDMUEIxVB1zih9yjZ/MC9eQ5oUpvCge0E56qS1TBeKlv6/j+ySrfyMR4eGFiQ6\n\tQm62ZAxerJGNlQXuQFsBDpv7/AD2C/TUmPl/EfqM0Zx4czW9AAjzDhE+IIXVIneoxnwP\n\th9LxkeOVQo2y5IZBVFyWWMad4gpszXZVGJ2KPf7ylxnqNRhAmrWrGxM2Jw+vvv1kn6rd\n\tQBug==","X-Gm-Message-State":"AFqh2krCzszKuiWgfyRN8z9eeirmzcwFq8HBXouKCa7Db1uj/2093dL2\n\tZxdUOdmFZ700IQZXLl3TrtAoNDx2c8dkOmT4","X-Google-Smtp-Source":"AMrXdXsF9T4WOC29yiLodZUiutiqZwf5voLcxig5QRxUxs8zHSsUnCSPW7PnLx4qurd21uG4Kqmwdw==","X-Received":"by 2002:a05:600c:3b02:b0:3da:1bb0:4d71 with SMTP id\n\tm2-20020a05600c3b0200b003da1bb04d71mr39610126wms.11.1674652819954; \n\tWed, 25 Jan 2023 05:20:19 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 25 Jan 2023 13:20:18 +0000","Message-Id":"<20230125132018.5725-1-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] libcamera: controls: Add controls for\n\tAEC/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":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Flicker is the term used to describe brightness banding or oscillation\nof images caused typically by artificial lighting driven by a 50 or\n60Hz mains supply. We add two controls intended to be used by AEC/AGC\nalgorithms:\n\nAeFlickerMode to determine whether flicker avoidance is active or not.\n\nAeFlickerPeriod to specify a custom flicker period when the period is\nother than 50 or 60Hz.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/libcamera/control_ids.yaml | 52 ++++++++++++++++++++++++++++++++++\n 1 file changed, 52 insertions(+)","diff":"diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\nindex adea5f90..5e5428ea 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: Flicker50Hz\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: Flicker60Hz\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","prefixes":["libcamera-devel"]}