{"id":18904,"url":"https://patchwork.libcamera.org/api/covers/18904/?format=json","web_url":"https://patchwork.libcamera.org/cover/18904/","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":"<20230731094641.73646-1-david.plowman@raspberrypi.com>","date":"2023-07-31T09:46:36","name":"[libcamera-devel,0/5] Multi-channel AGC","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"mbox":"https://patchwork.libcamera.org/cover/18904/mbox/","series":[{"id":3996,"url":"https://patchwork.libcamera.org/api/series/3996/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3996","date":"2023-07-31T09:46:36","name":"Multi-channel AGC","version":1,"mbox":"https://patchwork.libcamera.org/series/3996/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/18904/comments/","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 D2E2EBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 31 Jul 2023 09:46:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A25BB627E8;\n\tMon, 31 Jul 2023 11:46:46 +0200 (CEST)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 11DD36037D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Jul 2023 11:46:45 +0200 (CEST)","by mail-wm1-x32a.google.com with SMTP id\n\t5b1f17b1804b1-3fbf1b82d9cso39673925e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Jul 2023 02:46:45 -0700 (PDT)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:2bce:64d6:1a5c:49a2])\n\tby smtp.gmail.com with ESMTPSA id\n\t9-20020a05600c240900b003fa98908014sm13612838wmp.8.2023.07.31.02.46.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 31 Jul 2023 02:46:43 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690796806;\n\tbh=NoN0ho+Ywmc6vgWzPoPbK8wyDVmRzI+9p10pwvXmdfQ=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=VedjYM6+DDc8J1A9QIpPEPp9MZM7Ur7qUutZRMXMvEKDN0fusOn4ns4LWEARtCdsH\n\tL8ky1CV+3OBUC9U3cCf1VTCn8qI3nCxdVE86qwtRCtCPMr6k1GxceMzCBqf1TIrbFd\n\tlYP0Td++lWyZiaqoLNYbZFBO2BO52CBO9yK/VJcjc304QZgMe9hWAemxtI0JSUtvED\n\t866hdtOqvc5jI7SAo7I48rUiGbTrLlkvQeyyP4oi4snyZtHxyD6iHWfHHNJca2EMPu\n\tNU5xyI3e+vsmtu5kcFThsVf8Mik5bj2YI/j5V4WVj6rR3RVzVLJiNJPFuh+caysyBG\n\tGbb31ihGt1f4w==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1690796804; x=1691401604;\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=HKCWqZVi/sSP3gjL3skd6CV6Q/ckTQR7IbUgKxVx/s0=;\n\tb=BL352t15lsMGpLzB3lMCmHk4EkG7h+vhgUem6608iwjMMRqkqbm1RKuLeAB7k7Sh6l\n\tOejzPYsWWIbN74x2OKZA/fB/AEMMc8KsmVg895rvodb1Nh1dtVrunnU2ASw45o0aXuTI\n\tzUVPZzq0T0a15HR7rbUHXou3JuKFInnF0xumGUCmNIWjaoRk+x3Dz+KelWuqoSdZF5HW\n\tULg8Mi6fCMn25IpaImnQ2zC0NEIYdHYRssXPmq9tecOdpyNbK94/z0+ICdlhbfDNsCzG\n\tdgozSlcLuKKX9QVCs1y5iSYDFbEBmemdP6nSQi4pBCyyn6oVjhMgn7yFwmmHs9iVsWCL\n\tEZog=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"BL352t15\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1690796804; x=1691401604;\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=HKCWqZVi/sSP3gjL3skd6CV6Q/ckTQR7IbUgKxVx/s0=;\n\tb=KE9bDxC3NoXFdEa8kuVhBkxhF4sOd9bcnyO3UqhfcEgK8ozSXaROt4vGiaAMwPGui9\n\tUGktFu5Dck/QB+dtW9iS3TkP95+jvhWy8m9M6l812H7WLJWcR/Pgjd/owLfx5XljFu+j\n\tD2C4Esi34kt0+/GD/DDAs8/e+9AFMgBmPlLDMbkdQLjfZc/mqaPIGwH5UAbsqAJH1kee\n\tPokztv/t9savWVvnDdPU0MO13qRo7NlywSYOqHWpjcJm+BEiQJmbgHEPrNdrktAwttaS\n\tklQmF5I9fwdI9joAvLaPBKfjWYy9zVVxQ42ygNezCVXjWp3iqVN5z1Ew4CfUz/0oyR6P\n\ta2cg==","X-Gm-Message-State":"ABy/qLa3K0XxjHRzWA+X22wNfeY9dHJhMVihzI1528mK0rjyHs+0aFW+\n\tWs76qMATthyb3H6BpU0Qc6pqNfb3uCKw49azgvg=","X-Google-Smtp-Source":"APBJJlFIEqi5LIPX0n3oDP6ll1QfQ8V31xtay881rxRMJU94jInvtGd3ZcjlMf5Rbxv91P2zRbyxgw==","X-Received":"by 2002:a05:600c:230b:b0:3fc:e00:5282 with SMTP id\n\t11-20020a05600c230b00b003fc0e005282mr6425988wmo.0.1690796804243; \n\tMon, 31 Jul 2023 02:46:44 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 31 Jul 2023 10:46:36 +0100","Message-Id":"<20230731094641.73646-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 0/5] Multi-channel AGC","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":"Hi everyone\n\nThis set of patches implements multi-channel AGC for the Raspberry\nPi. This allows an application to run independent instances of AGC on\nsuccessive frames with independent settings, and switching between the\nexposures gets handled for the application. It's a building block for\nHDR type of applications (though not limited to that).\n\nWe have 5 patches:\n\n1. I seem to have built on top of some future work that Naush has been\ndoing, so I've included a small histogram patch of his that is\nrequired.\n\n2. This moves essentially all of the Agc class into an AgcChannel\nclass, and adds a new Agc class that is a thin wrapper around multiple\nAgcChannels. The wrapper is sufficient only to make the AGC work as\nbefore, and does not yet add anything new.\n\n3. Now we add real multi-channel functionality to the Agc class. For\nnow there are no libcamera controls to drive it, but a future commit\nwill add an HDR algorithm that will use it.\n\n4. Adds an AgcChannelConstraint class. Now that we have multiple\nchannels, we might want to constrain the exposures of one channel to\nlie within certain limits of another. Here we add only the class; the\nnext commit will make use of them.\n\n5. Make use of the AgcChannelConstraints.\n\nAs implied above, this work is all preparatory to some HDR features in\na future commit. The Pi, of course, has no facility to combine images\nautomatically, so \"HDR\" on the Pi will be all about driving the\nmulti-channel AGC and letting the application handle the images\nitself.\n\nThanks!\nDavid\n\nDavid Plowman (4):\n  ipa: rpi: agc: Reorganise code for multi-channel AGC\n  ipa: rpi: agc: Implementation of multi-channel AGC\n  ipa: rpi: agc: Add AgcChannelConstraint class\n  ipa: rpi: agc: Use channel constraints in the AGC algorithm\n\nNaushir Patuck (1):\n  ipa: rpi: histogram: Add interBinMean()\n\n src/ipa/rpi/common/ipa_base.cpp            |   14 +-\n src/ipa/rpi/controller/agc_algorithm.h     |   19 +-\n src/ipa/rpi/controller/agc_status.h        |    1 +\n src/ipa/rpi/controller/histogram.cpp       |   22 +-\n src/ipa/rpi/controller/histogram.h         |    2 +\n src/ipa/rpi/controller/meson.build         |    1 +\n src/ipa/rpi/controller/rpi/agc.cpp         |  969 ++++---------------\n src/ipa/rpi/controller/rpi/agc.h           |  124 +--\n src/ipa/rpi/controller/rpi/agc_channel.cpp | 1018 ++++++++++++++++++++\n src/ipa/rpi/controller/rpi/agc_channel.h   |  149 +++\n src/ipa/rpi/vc4/data/imx477.json           |    3 +-\n 11 files changed, 1424 insertions(+), 898 deletions(-)\n create mode 100644 src/ipa/rpi/controller/rpi/agc_channel.cpp\n create mode 100644 src/ipa/rpi/controller/rpi/agc_channel.h"}