[{"id":32900,"web_url":"https://patchwork.libcamera.org/comment/32900/","msgid":"<173469706635.1594439.16828694913474532608@ping.linuxembedded.co.uk>","date":"2024-12-20T12:17:46","subject":"Re: [PATCH v2 4/5] ipa: simple: Report black levels in metadata","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Milan,\n\nQuoting Milan Zamazal (2024-12-19 21:10:09)\n> From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Provide the determined black level values in the metadata\n> to add to the completed requests.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/ipa/simple/algorithms/blc.cpp | 9 ++++++++-\n>  1 file changed, 8 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\n> index 1d7d370b..d5759f92 100644\n> --- a/src/ipa/simple/algorithms/blc.cpp\n> +++ b/src/ipa/simple/algorithms/blc.cpp\n> @@ -11,6 +11,8 @@\n>  \n>  #include <libcamera/base/log.h>\n>  \n> +#include \"control_ids.h\"\n> +\n>  namespace libcamera {\n>  \n>  namespace ipa::soft::algorithms {\n> @@ -49,8 +51,13 @@ void BlackLevel::process(IPAContext &context,\n>                          [[maybe_unused]] const uint32_t frame,\n>                          IPAFrameContext &frameContext,\n>                          const SwIspStats *stats,\n> -                        [[maybe_unused]] ControlList &metadata)\n> +                        ControlList &metadata)\n>  {\n> +       /* Assign each of the R G G B channels as the same black level. */\n> +       const int32_t blackLevel = context.activeState.blc.level * 256;\n\nWhat are your thoughts on\nhttps://patchwork.libcamera.org/project/libcamera/list/?series=4830?\n\nThis could then be:\n\tconst int32_t blackLevel = context.activeState.blc.level.convert<16>();\n\nor\n\tBitDepthValue<16> blackLevel = context.activeState.blc.level;\n\nI'm curious if you think this provides a helpful / expressive way to\nconvey this? or if it obfuscates more ?\n\n> +       const int32_t blackLevels[] = { blackLevel, blackLevel, blackLevel, blackLevel };\n> +       metadata.set(controls::SensorBlackLevels, blackLevels);\n> +\n>         if (context.configuration.black.level.has_value())\n>                 return;\n>  \n> -- \n> 2.44.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 63FC7C32A3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 12:17:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A6A868493;\n\tFri, 20 Dec 2024 13:17:51 +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 56E1667F24\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 13:17:49 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C1CE2736;\n\tFri, 20 Dec 2024 13:17:09 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SLMGDZb8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734697029;\n\tbh=YksmPNs8jBTB2E9cq1s1cIHKFJNwshkGYDgOttQbhoM=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=SLMGDZb8ymqqTkbPzw+QDnWg5wrKYL6rQHDy0o/XCvjjWNyJz6VOmjT9mhGVSjITA\n\tzlsAMmjBf3IiRS8xH19PJ4zGpTWA7+Y0G8l/F8JdevM4MW49y0wK3VrUSUZrV/cw+G\n\twyjAT6dRzSjWGIKmERxW5lOOPOuVDB5cqut1sQY0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241219211010.103310-5-mzamazal@redhat.com>","References":"<20241219211010.103310-1-mzamazal@redhat.com>\n\t<20241219211010.103310-5-mzamazal@redhat.com>","Subject":"Re: [PATCH v2 4/5] ipa: simple: Report black levels in metadata","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Fri, 20 Dec 2024 12:17:46 +0000","Message-ID":"<173469706635.1594439.16828694913474532608@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32921,"web_url":"https://patchwork.libcamera.org/comment/32921/","msgid":"<85pll59i7f.fsf@mzamazal-thinkpadp1gen3.tpbc.csb>","date":"2025-01-02T18:36:04","subject":"Re: [PATCH v2 4/5] ipa: simple: Report black levels in metadata","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Kieran,\n\nKieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Hi Milan,\n>\n> Quoting Milan Zamazal (2024-12-19 21:10:09)\n>> From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> \n>> Provide the determined black level values in the metadata\n>> to add to the completed requests.\n>> \n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  src/ipa/simple/algorithms/blc.cpp | 9 ++++++++-\n>>  1 file changed, 8 insertions(+), 1 deletion(-)\n>> \n>> diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\n>> index 1d7d370b..d5759f92 100644\n>> --- a/src/ipa/simple/algorithms/blc.cpp\n>> +++ b/src/ipa/simple/algorithms/blc.cpp\n>> @@ -11,6 +11,8 @@\n>>  \n>>  #include <libcamera/base/log.h>\n>>  \n>> +#include \"control_ids.h\"\n>> +\n>>  namespace libcamera {\n>>  \n>>  namespace ipa::soft::algorithms {\n>> @@ -49,8 +51,13 @@ void BlackLevel::process(IPAContext &context,\n>>                          [[maybe_unused]] const uint32_t frame,\n>>                          IPAFrameContext &frameContext,\n>>                          const SwIspStats *stats,\n>> -                        [[maybe_unused]] ControlList &metadata)\n>> +                        ControlList &metadata)\n>>  {\n>> +       /* Assign each of the R G G B channels as the same black level. */\n>> +       const int32_t blackLevel = context.activeState.blc.level * 256;\n>\n> What are your thoughts on\n> https://patchwork.libcamera.org/project/libcamera/list/?series=4830?\n>\n> This could then be:\n> \tconst int32_t blackLevel = context.activeState.blc.level.convert<16>();\n>\n> or\n> \tBitDepthValue<16> blackLevel = context.activeState.blc.level;\n>\n> I'm curious if you think this provides a helpful / expressive way to\n> convey this? or if it obfuscates more ?\n\nI like the general idea of tracking the bit depth explicitly some way,\nit's definitely needed, thank you for the reminder.  As for the\nparticular API proposal, I usually leave making opinions on such matters\nto maintainers but I'll try to make my opinion tomorrow since the RFC\ndeserves more attention than it has got so far.\n\n>> +       const int32_t blackLevels[] = { blackLevel, blackLevel, blackLevel, blackLevel };\n>> +       metadata.set(controls::SensorBlackLevels, blackLevels);\n>> +\n>>         if (context.configuration.black.level.has_value())\n>>                 return;\n>>  \n>> -- \n>> 2.44.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 1F115BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Jan 2025 18:36:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68E75684E1;\n\tThu,  2 Jan 2025 19:36:10 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6F273684D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Jan 2025 19:36:09 +0100 (CET)","from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n\t[209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-684-04vbxe4cPj6OJc5tblWK5Q-1; Thu, 02 Jan 2025 13:36:07 -0500","by mail-wr1-f69.google.com with SMTP id\n\tffacd0b85a97d-3862c67763dso4980332f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 02 Jan 2025 10:36:06 -0800 (PST)","from mzamazal-thinkpadp1gen3.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-38a2432e587sm35146160f8f.95.2025.01.02.10.36.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 02 Jan 2025 10:36:05 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Nqq3zAnF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1735842968;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=X4P+H5lqETUQLXaal7LhjrbQGSu9PLk++mdvntjagAw=;\n\tb=Nqq3zAnF3fb6ZRIeUo4NS7OtSKys+LmFw1VQsj7ufrJboQt6I98NWinDXUNZv5nWERIae8\n\t12E5dv9e6P5QIoP0VVeXy2XMU/VsG9mBOMOk2Nq1oWr4cyic7qZSNg4cb2ucdKCU4NfnBF\n\ttqXJnNoyScnYVRfrecop2laYEOz/124=","X-MC-Unique":"04vbxe4cPj6OJc5tblWK5Q-1","X-Mimecast-MFC-AGG-ID":"04vbxe4cPj6OJc5tblWK5Q","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1735842966; x=1736447766;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=X4P+H5lqETUQLXaal7LhjrbQGSu9PLk++mdvntjagAw=;\n\tb=KdAX1/Yer23fJ45UhWCAn+8wULphUCHnvRLZaYI33tLRZt937i4fhP7Mu5GIEuTYnG\n\tB4I0fD7P0RgQpGXTrUM9pCuy8DI4qba/0uii6YwIAmyzIkaN+fEw100OOUE5Wu/H4pa0\n\tEg1EpP4qgxkOw6zb/RonD+8Y97iIfO2RGBYwqSWkNS7Y1NtJCSd8ne2HfBgkEUaIMeV3\n\tj8vhvs5SIB0S0uQHm/ss8ZmzO5pH/oZz0PRQ6pbyyqDnh3ey4VDAYglJHwe6yYcGbh5U\n\t3u233V/Y2ZHMR8Ln/WLw5bIFW79mvLCooXwp+P15IOo8wSYmJK9qHc3EFrwlQe/1Tiwy\n\tB1Fw==","X-Gm-Message-State":"AOJu0Yw3xqJ9dEsaXKKo8cFb3u8hSFCt7T5NuK3+tZlxKSHlJ+KCsjBO\n\tk9+eKZPwg41/MgWNGYqlV8DKyp43ztOX8yk5jxqD+dKm3Wn9nJjs1DXXwamxnIhRv5mmkVnAC7l\n\tPOEds0AkpcsbYu9DIbTlUlHqWUwGXuSmS7uethXyofAyz5R0SuW2u1kgfzEXML+pKF2AuLqU=","X-Gm-Gg":"ASbGncvhcKkw+6msQzAGT/5mkoQhbfQJ25oq/HdGS3rI3d+Zv9MQPTnDbhSoashPLsU\n\tmpMzlOEXq8ICl3p7g5QEXapIkR8MPSYojsaLqg02MY8H0dD52fR7jd9rpSJQWrs7/ozZlCphYw0\n\tRJIOetM3FBoj/rFxO5zOFrxI6+MdX+9OKjTHsDwxszPDr93QSPcBRnOakWJbCG3JiG6YtJuCgWJ\n\tIaz+BgnUSuNom7q3ZC45z8uF9C/hdxwAAVg523O0vg/U4EJP3dp5SWYHD5448n+mHNG7fuMAGSP\n\ta5qPwLrxGxVdtHqC/otlx8wgB1Y8696J5w==","X-Received":["by 2002:a05:6000:2ad:b0:386:4a0d:bb21 with SMTP id\n\tffacd0b85a97d-38a221f12b0mr42806230f8f.22.1735842965935; \n\tThu, 02 Jan 2025 10:36:05 -0800 (PST)","by 2002:a05:6000:2ad:b0:386:4a0d:bb21 with SMTP id\n\tffacd0b85a97d-38a221f12b0mr42806212f8f.22.1735842965549; \n\tThu, 02 Jan 2025 10:36:05 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHHhghJ7VHJGW1i6UK+GZw7SUsSV+GbsZ6vbRIhQf+3R4RfNLS+RT+AzDjZ+MCZ99ct3uwR4A==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v2 4/5] ipa: simple: Report black levels in metadata","In-Reply-To":"<173469706635.1594439.16828694913474532608@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Fri, 20 Dec 2024 12:17:46 +0000\")","References":"<20241219211010.103310-1-mzamazal@redhat.com>\n\t<20241219211010.103310-5-mzamazal@redhat.com>\n\t<173469706635.1594439.16828694913474532608@ping.linuxembedded.co.uk>","Date":"Thu, 02 Jan 2025 19:36:04 +0100","Message-ID":"<85pll59i7f.fsf@mzamazal-thinkpadp1gen3.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"4p4LxvsD3ziKt2IuIezmoZoM9mcK6VFccf-bKFkDKTQ_1735842966","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]