[{"id":28821,"web_url":"https://patchwork.libcamera.org/comment/28821/","msgid":"<87msreavg3.fsf@redhat.com>","date":"2024-03-04T15:05:48","subject":"Re: [PATCH v4 06/18] libcamera: software_isp: Add SwStatsCpu class","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hans de Goede <hdegoede@redhat.com> writes:\n\n> Add a CPU based SwStats implementation for SoftwareISP / SoftIPA use.\n>\n> This implementation offers a configure function + functions to gather\n> statistics on a line by line basis. This allows CPU based software\n> debayering to call into interlace debayering and statistics gathering\n> on a line by line bases while the input data is still hot in the cache.\n>\n> This implementation also allows specifying a window over which to gather\n> statistics instead of processing the whole frame.\n>\n> Doxygen documentation by Dennis Bonke.\n>\n> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s\n> Tested-by: Pavel Machek <pavel@ucw.cz>\n> Reviewed-by: Pavel Machek <pavel@ucw.cz>\n> Co-developed-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n> Co-developed-by: Pavel Machek <pavel@ucw.cz>\n> Signed-off-by: Pavel Machek <pavel@ucw.cz>\n> Co-developed-by: Dennis Bonke <admin@dennisbonke.com>\n> Signed-off-by: Dennis Bonke <admin@dennisbonke.com>\n> Co-developed-by: Marttico <g.martti@gmail.com>\n> Signed-off-by: Marttico <g.martti@gmail.com>\n> Co-developed-by: Toon Langendam <t.langendam@gmail.com>\n> Signed-off-by: Toon Langendam <t.langendam@gmail.com>\n> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n\nOne more minor typo in a docstring below, after it's fixed:\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n> Changes in v3:\n> - Merge SwStats base-class into SwStatsCpu\n> - Move swstats_cpu.h to src/libcamera/software_isp/\n> - Move documentation to .cpp file and extend it\n> - Rename a bunch of foo_bar symbols to fooBar\n> - Change a couple of defines and hardcoded values to constexpr\n> - Remove statsBayer10P in swstats_cpu.cpp, instead move the loop to\n>   statsBGGR10PLine0 / statsGBRG10PLine0\n> - Make startFrame() and finishFrame() normal methods instead of\n>   using function pointers for these\n> ---\n>  include/libcamera/internal/meson.build        |   1 +\n>  .../internal/software_isp/meson.build         |   5 +\n>  .../internal/software_isp/swisp_stats.h       |  38 ++++\n>  src/libcamera/meson.build                     |   1 +\n>  src/libcamera/software_isp/meson.build        |   5 +\n>  src/libcamera/software_isp/swstats_cpu.cpp    | 208 ++++++++++++++++++\n>  src/libcamera/software_isp/swstats_cpu.h      | 159 +++++++++++++\n>  7 files changed, 417 insertions(+)\n>  create mode 100644 include/libcamera/internal/software_isp/meson.build\n>  create mode 100644 include/libcamera/internal/software_isp/swisp_stats.h\n>  create mode 100644 src/libcamera/software_isp/meson.build\n>  create mode 100644 src/libcamera/software_isp/swstats_cpu.cpp\n>  create mode 100644 src/libcamera/software_isp/swstats_cpu.h\n>\n\n[...]\n\n> diff --git a/src/libcamera/software_isp/swstats_cpu.h b/src/libcamera/software_isp/swstats_cpu.h\n> new file mode 100644\n> index 00000000..df13263b\n> --- /dev/null\n> +++ b/src/libcamera/software_isp/swstats_cpu.h\n> @@ -0,0 +1,159 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2023, Linaro Ltd\n> + * Copyright (C) 2023, Red Hat Inc.\n> + *\n> + * Authors:\n> + * Hans de Goede <hdegoede@redhat.com>\n> + *\n> + * swstats_cpu.h - CPU based software statistics implementation\n> + */\n> +\n> +#pragma once\n> +\n> +#include <stdint.h>\n> +\n> +#include <libcamera/base/signal.h>\n> +\n> +#include <libcamera/geometry.h>\n> +\n> +#include \"libcamera/internal/shared_mem_object.h\"\n> +#include \"libcamera/internal/software_isp/swisp_stats.h\"\n> +\n> +namespace libcamera {\n> +\n> +class PixelFormat;\n> +struct StreamConfiguration;\n> +\n> +class SwStatsCpu\n> +{\n> +public:\n> +\tSwStatsCpu();\n> +\t~SwStatsCpu() = default;\n> +\n> +\t/**\n> +\t * \\brief Gets wether the statistics object is valid.\n\nwether -> weather\n\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 204C0BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 15:05:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 630476286F;\n\tMon,  4 Mar 2024 16:05:56 +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 0033C627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 16:05:54 +0100 (CET)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-446-wsILBjpsMw6aLuhjvWNhVg-1; Mon, 04 Mar 2024 10:05:51 -0500","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-412e992444eso481345e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 04 Mar 2024 07:05:51 -0800 (PST)","from nuthatch (nat-pool-brq-t.redhat.com. [213.175.37.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tw2-20020adfe042000000b0033e3c4e600asm3313029wrh.7.2024.03.04.07.05.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 04 Mar 2024 07:05:49 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Lpqecgxl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1709564753;\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=28YNnokDJ/3js0KFDs5mJN0ajvoVFr5MIGcdhXpKCf4=;\n\tb=LpqecgxlgiSlfv5IykMQ6cbA1/hQ+jJPukJKmVNzWt1pREYTFSQ9zq6koS/oceHO0RVE2A\n\tbv9o3P+3nm0le3wI2L6m3a8mFADSjtCOsuHer+vtztP42srG+TrZf5u7z/8ukwa3V71848\n\tCcjb6sBT9i4JZ7Qry+ivgCD908H+TfE=","X-MC-Unique":"wsILBjpsMw6aLuhjvWNhVg-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1709564750; x=1710169550;\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=28YNnokDJ/3js0KFDs5mJN0ajvoVFr5MIGcdhXpKCf4=;\n\tb=NIzY9e/eO0w92r2vn/G3P/ln8gFWGiYLhBS3Cp2PYggZlNkRpja2XtqQ7S0O18DBoc\n\tw6myGg/QJ9gMyKbqoR5ZmuGuuvgIcHcGYp2ytB8fq4bJnWfpU5am4Euu6nUrjjpV6pPR\n\t1UJFtoReHwJeexuMl0WERgZ39KjrJpBE6s5aPFPGaGSmFL5yr8PO7dN1lsXHIYhqE5R9\n\tkGbZbpebCP1GKiQcC10sWjV8opzFk2pVXPEXY3+ewMhyXAEaRCq/1BYgUVtqC2ocgEKO\n\tNjC3dMaWbZDqWUdvbU77tFxA0H+HYBRZRiGjSIz0aNVgXPfuUPUuMA8YPz6t8Xk7l5ud\n\t9Bcw==","X-Gm-Message-State":"AOJu0Yyls9WuivjhvtAK3wsiwMKEf2kMz7w6eB7uDKOxMH98WOtUKoa2\n\tdy7a73K1gK14tHLYBAHyWkeg1YbysmzKYmyjIRYN4V9khgmX3aNXWSyIZbg6Auf/7pb/D/KBaKl\n\tJnpqQum1qyLCUeey0cOTYCu3iEmxzIxbvhV60+2UgdiFJsISsxFSiRgS+0G+0S7hYlou8HjI=","X-Received":["by 2002:a05:600c:470d:b0:412:a7da:8286 with SMTP id\n\tv13-20020a05600c470d00b00412a7da8286mr7023823wmo.4.1709564750253; \n\tMon, 04 Mar 2024 07:05:50 -0800 (PST)","by 2002:a05:600c:470d:b0:412:a7da:8286 with SMTP id\n\tv13-20020a05600c470d00b00412a7da8286mr7023804wmo.4.1709564749875; \n\tMon, 04 Mar 2024 07:05:49 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IGLTfQp+vK7qUSxikEdJantXSuO1nvg2qU1zkKIPTjSLEIiHcuuOVCsFDBc7iY0Mn5Eq+Gt5w==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Hans de Goede <hdegoede@redhat.com>","Subject":"Re: [PATCH v4 06/18] libcamera: software_isp: Add SwStatsCpu class","In-Reply-To":"<20240229183654.7206-7-hdegoede@redhat.com> (Hans de Goede's\n\tmessage of \"Thu, 29 Feb 2024 19:36:17 +0100\")","References":"<20240229183654.7206-1-hdegoede@redhat.com>\n\t<20240229183654.7206-7-hdegoede@redhat.com>","Date":"Mon, 04 Mar 2024 16:05:48 +0100","Message-ID":"<87msreavg3.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","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>","Cc":"Maxime Ripard <mripard@redhat.com>, Marttico <g.martti@gmail.com>,\n\tToon Langendam <t.langendam@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org, Pavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tDennis Bonke <admin@dennisbonke.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28823,"web_url":"https://patchwork.libcamera.org/comment/28823/","msgid":"<efe19b97-518d-4564-8ad0-722fc525a472@redhat.com>","date":"2024-03-04T15:30:43","subject":"Re: [PATCH v4 06/18] libcamera: software_isp: Add SwStatsCpu class","submitter":{"id":102,"url":"https://patchwork.libcamera.org/api/people/102/","name":"Hans de Goede","email":"hdegoede@redhat.com"},"content":"Hi,\n\nOn 3/4/24 4:05 PM, Milan Zamazal wrote:\n> Hans de Goede <hdegoede@redhat.com> writes:\n> \n>> Add a CPU based SwStats implementation for SoftwareISP / SoftIPA use.\n>>\n>> This implementation offers a configure function + functions to gather\n>> statistics on a line by line basis. This allows CPU based software\n>> debayering to call into interlace debayering and statistics gathering\n>> on a line by line bases while the input data is still hot in the cache.\n>>\n>> This implementation also allows specifying a window over which to gather\n>> statistics instead of processing the whole frame.\n>>\n>> Doxygen documentation by Dennis Bonke.\n>>\n>> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s\n>> Tested-by: Pavel Machek <pavel@ucw.cz>\n>> Reviewed-by: Pavel Machek <pavel@ucw.cz>\n>> Co-developed-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n>> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n>> Co-developed-by: Pavel Machek <pavel@ucw.cz>\n>> Signed-off-by: Pavel Machek <pavel@ucw.cz>\n>> Co-developed-by: Dennis Bonke <admin@dennisbonke.com>\n>> Signed-off-by: Dennis Bonke <admin@dennisbonke.com>\n>> Co-developed-by: Marttico <g.martti@gmail.com>\n>> Signed-off-by: Marttico <g.martti@gmail.com>\n>> Co-developed-by: Toon Langendam <t.langendam@gmail.com>\n>> Signed-off-by: Toon Langendam <t.langendam@gmail.com>\n>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n> \n> One more minor typo in a docstring below, after it's fixed:\n> \n> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>\n> \n>> ---\n>> Changes in v3:\n>> - Merge SwStats base-class into SwStatsCpu\n>> - Move swstats_cpu.h to src/libcamera/software_isp/\n>> - Move documentation to .cpp file and extend it\n>> - Rename a bunch of foo_bar symbols to fooBar\n>> - Change a couple of defines and hardcoded values to constexpr\n>> - Remove statsBayer10P in swstats_cpu.cpp, instead move the loop to\n>>   statsBGGR10PLine0 / statsGBRG10PLine0\n>> - Make startFrame() and finishFrame() normal methods instead of\n>>   using function pointers for these\n>> ---\n>>  include/libcamera/internal/meson.build        |   1 +\n>>  .../internal/software_isp/meson.build         |   5 +\n>>  .../internal/software_isp/swisp_stats.h       |  38 ++++\n>>  src/libcamera/meson.build                     |   1 +\n>>  src/libcamera/software_isp/meson.build        |   5 +\n>>  src/libcamera/software_isp/swstats_cpu.cpp    | 208 ++++++++++++++++++\n>>  src/libcamera/software_isp/swstats_cpu.h      | 159 +++++++++++++\n>>  7 files changed, 417 insertions(+)\n>>  create mode 100644 include/libcamera/internal/software_isp/meson.build\n>>  create mode 100644 include/libcamera/internal/software_isp/swisp_stats.h\n>>  create mode 100644 src/libcamera/software_isp/meson.build\n>>  create mode 100644 src/libcamera/software_isp/swstats_cpu.cpp\n>>  create mode 100644 src/libcamera/software_isp/swstats_cpu.h\n>>\n> \n> [...]\n> \n>> diff --git a/src/libcamera/software_isp/swstats_cpu.h b/src/libcamera/software_isp/swstats_cpu.h\n>> new file mode 100644\n>> index 00000000..df13263b\n>> --- /dev/null\n>> +++ b/src/libcamera/software_isp/swstats_cpu.h\n>> @@ -0,0 +1,159 @@\n>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n>> +/*\n>> + * Copyright (C) 2023, Linaro Ltd\n>> + * Copyright (C) 2023, Red Hat Inc.\n>> + *\n>> + * Authors:\n>> + * Hans de Goede <hdegoede@redhat.com>\n>> + *\n>> + * swstats_cpu.h - CPU based software statistics implementation\n>> + */\n>> +\n>> +#pragma once\n>> +\n>> +#include <stdint.h>\n>> +\n>> +#include <libcamera/base/signal.h>\n>> +\n>> +#include <libcamera/geometry.h>\n>> +\n>> +#include \"libcamera/internal/shared_mem_object.h\"\n>> +#include \"libcamera/internal/software_isp/swisp_stats.h\"\n>> +\n>> +namespace libcamera {\n>> +\n>> +class PixelFormat;\n>> +struct StreamConfiguration;\n>> +\n>> +class SwStatsCpu\n>> +{\n>> +public:\n>> +\tSwStatsCpu();\n>> +\t~SwStatsCpu() = default;\n>> +\n>> +\t/**\n>> +\t * \\brief Gets wether the statistics object is valid.\n> \n> wether -> weather\n\nActually that should be whether, weather is talking about\nhow sunny / cloudy it is. I'll do:\n\ns/wether/whether/\n\nfor v5.\n\nThanks & Regards,\n\nHans\n\n\n\n\n\n\n> \n> [...]\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 2705FBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 15:30:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5593B6286F;\n\tMon,  4 Mar 2024 16:30:50 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 57C56627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 16:30:49 +0100 (CET)","from mail-ed1-f71.google.com (mail-ed1-f71.google.com\n\t[209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-673-ZRBHeIszOrKS2SEXJ1QQhg-1; Mon, 04 Mar 2024 10:30:46 -0500","by mail-ed1-f71.google.com with SMTP id\n\t4fb4d7f45d1cf-56773232ebaso200482a12.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 04 Mar 2024 07:30:45 -0800 (PST)","from [10.40.98.142] ([78.108.130.194])\n\tby smtp.gmail.com with ESMTPSA id\n\tcs4-20020a0564020c4400b00566a4dec01fsm4626678edb.11.2024.03.04.07.30.43\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 04 Mar 2024 07:30:44 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"FxT+WM5o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1709566248;\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\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=EEGzyC6cKzNnMxEugtGRDcyqA9ETinPGccsvt6CVhiI=;\n\tb=FxT+WM5ok+9Vlr0cl1MGzaiWlbtE0qVNL5uUIG+lQPRLL4gUHqIarIgnW0qeiLvpnFbRAu\n\tMBpMfUTPO7thc8So13XGBTWqdKRP/UkWJXi/req7EiPh5vfb4M+J6TNdH33gF/q8h6BE7K\n\tOMJSrpRiQ1sfrsKnSYtP5jkLvQulhdY=","X-MC-Unique":"ZRBHeIszOrKS2SEXJ1QQhg-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1709566245; x=1710171045;\n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=EEGzyC6cKzNnMxEugtGRDcyqA9ETinPGccsvt6CVhiI=;\n\tb=pxX04ZgZo9YDLrWM9VGyH17HI3vjIoo8Qei5i1hslS2/5frP+x2qcmthf6G1kuWnT5\n\taBCy42HSHb6A1Tk2cDsmAAxwJMGprzCfhkvgjvV4q1FIcJzvTyaoUmK1Pmk8N0aHNzgZ\n\tVRN/T5J9cyES+emOfZh4zUvmOAqDIPYffpLCY9o4+a35cBmiJWRYu81beoVU2XKb/Dzl\n\tjCyg9V0LzlYPC8qcaW4zMDIEV54QyWS1HMhl3AfM3Af9ztx0oo4CSRSc7Va/5LLGydsA\n\t3G3dYn/x59GR5+WYlh3xkBuQNZyeYLzZfZtMstXqgHW6vX1+79I0YAS2QgW4WDPnD3Un\n\taoEg==","X-Gm-Message-State":"AOJu0Yzy7djufuYieDXP84nmsK9pGB1RNwZ4ZnioMl286YrK842WKeC4\n\tustWegj3JcrTwggSDy49z2LFLoVP4RYbBKnZFtwny7zFpHLUKlRkHi4uuy4cJ6x51jKwsl2NlNG\n\t2TQrfuxcmpK6e+vdh5SQd0vwfl09Gb4xFfxIQB1RmpUQ9ULlXKTVgbhWFUgmZeok3bZ1fU5A=","X-Received":["by 2002:a05:6402:313a:b0:567:3436:b85b with SMTP id\n\tdd26-20020a056402313a00b005673436b85bmr2803466edb.12.1709566244984; \n\tMon, 04 Mar 2024 07:30:44 -0800 (PST)","by 2002:a05:6402:313a:b0:567:3436:b85b with SMTP id\n\tdd26-20020a056402313a00b005673436b85bmr2803451edb.12.1709566244649; \n\tMon, 04 Mar 2024 07:30:44 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IEnLqrMAagggaOfRtcid9yszb0w/6NmbcPZvlDdTtjzOOTqk4t1LeM/4pa5si0nUY4OIZJj1w==","Message-ID":"<efe19b97-518d-4564-8ad0-722fc525a472@redhat.com>","Date":"Mon, 4 Mar 2024 16:30:43 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 06/18] libcamera: software_isp: Add SwStatsCpu class","To":"Milan Zamazal <mzamazal@redhat.com>","References":"<20240229183654.7206-1-hdegoede@redhat.com>\n\t<20240229183654.7206-7-hdegoede@redhat.com>\n\t<87msreavg3.fsf@redhat.com>","From":"Hans de Goede <hdegoede@redhat.com>","In-Reply-To":"<87msreavg3.fsf@redhat.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Language":"en-US","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","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>","Cc":"Maxime Ripard <mripard@redhat.com>, Marttico <g.martti@gmail.com>,\n\tToon Langendam <t.langendam@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org, Pavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tDennis Bonke <admin@dennisbonke.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28828,"web_url":"https://patchwork.libcamera.org/comment/28828/","msgid":"<87wmqhaozy.fsf@redhat.com>","date":"2024-03-04T17:25:05","subject":"Re: [PATCH v4 06/18] libcamera: software_isp: Add SwStatsCpu class","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hans de Goede <hdegoede@redhat.com> writes:\n\n> Hi,\n>\n> On 3/4/24 4:05 PM, Milan Zamazal wrote:\n>> Hans de Goede <hdegoede@redhat.com> writes:\n>> \n>>> Add a CPU based SwStats implementation for SoftwareISP / SoftIPA use.\n>>>\n>>> This implementation offers a configure function + functions to gather\n>>> statistics on a line by line basis. This allows CPU based software\n>>> debayering to call into interlace debayering and statistics gathering\n>>> on a line by line bases while the input data is still hot in the cache.\n>>>\n>>> This implementation also allows specifying a window over which to gather\n>>> statistics instead of processing the whole frame.\n>>>\n>>> Doxygen documentation by Dennis Bonke.\n>>>\n>>> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s\n>>> Tested-by: Pavel Machek <pavel@ucw.cz>\n>>> Reviewed-by: Pavel Machek <pavel@ucw.cz>\n>>> Co-developed-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n>>> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n>>> Co-developed-by: Pavel Machek <pavel@ucw.cz>\n>>> Signed-off-by: Pavel Machek <pavel@ucw.cz>\n>>> Co-developed-by: Dennis Bonke <admin@dennisbonke.com>\n>>> Signed-off-by: Dennis Bonke <admin@dennisbonke.com>\n>>> Co-developed-by: Marttico <g.martti@gmail.com>\n>>> Signed-off-by: Marttico <g.martti@gmail.com>\n>>> Co-developed-by: Toon Langendam <t.langendam@gmail.com>\n>>> Signed-off-by: Toon Langendam <t.langendam@gmail.com>\n>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n>> \n>> One more minor typo in a docstring below, after it's fixed:\n>> \n>> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>\n>> \n>>> ---\n>>> Changes in v3:\n>>> - Merge SwStats base-class into SwStatsCpu\n>>> - Move swstats_cpu.h to src/libcamera/software_isp/\n>>> - Move documentation to .cpp file and extend it\n>>> - Rename a bunch of foo_bar symbols to fooBar\n>>> - Change a couple of defines and hardcoded values to constexpr\n>>> - Remove statsBayer10P in swstats_cpu.cpp, instead move the loop to\n>>>   statsBGGR10PLine0 / statsGBRG10PLine0\n>>> - Make startFrame() and finishFrame() normal methods instead of\n>>>   using function pointers for these\n>>> ---\n>>>  include/libcamera/internal/meson.build        |   1 +\n>>>  .../internal/software_isp/meson.build         |   5 +\n>>>  .../internal/software_isp/swisp_stats.h       |  38 ++++\n>>>  src/libcamera/meson.build                     |   1 +\n>>>  src/libcamera/software_isp/meson.build        |   5 +\n>>>  src/libcamera/software_isp/swstats_cpu.cpp    | 208 ++++++++++++++++++\n>>>  src/libcamera/software_isp/swstats_cpu.h      | 159 +++++++++++++\n>>>  7 files changed, 417 insertions(+)\n>>>  create mode 100644 include/libcamera/internal/software_isp/meson.build\n>>>  create mode 100644 include/libcamera/internal/software_isp/swisp_stats.h\n>>>  create mode 100644 src/libcamera/software_isp/meson.build\n>>>  create mode 100644 src/libcamera/software_isp/swstats_cpu.cpp\n>>>  create mode 100644 src/libcamera/software_isp/swstats_cpu.h\n>>>\n>> \n>> [...]\n>> \n>>> diff --git a/src/libcamera/software_isp/swstats_cpu.h b/src/libcamera/software_isp/swstats_cpu.h\n>>> new file mode 100644\n>>> index 00000000..df13263b\n>>> --- /dev/null\n>>> +++ b/src/libcamera/software_isp/swstats_cpu.h\n>>> @@ -0,0 +1,159 @@\n>>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>> +/*\n>>> + * Copyright (C) 2023, Linaro Ltd\n>>> + * Copyright (C) 2023, Red Hat Inc.\n>>> + *\n>>> + * Authors:\n>>> + * Hans de Goede <hdegoede@redhat.com>\n>>> + *\n>>> + * swstats_cpu.h - CPU based software statistics implementation\n>>> + */\n>>> +\n>>> +#pragma once\n>>> +\n>>> +#include <stdint.h>\n>>> +\n>>> +#include <libcamera/base/signal.h>\n>>> +\n>>> +#include <libcamera/geometry.h>\n>>> +\n>>> +#include \"libcamera/internal/shared_mem_object.h\"\n>>> +#include \"libcamera/internal/software_isp/swisp_stats.h\"\n>>> +\n>>> +namespace libcamera {\n>>> +\n>>> +class PixelFormat;\n>>> +struct StreamConfiguration;\n>>> +\n>>> +class SwStatsCpu\n>>> +{\n>>> +public:\n>>> +\tSwStatsCpu();\n>>> +\t~SwStatsCpu() = default;\n>>> +\n>>> +\t/**\n>>> +\t * \\brief Gets wether the statistics object is valid.\n>> \n>> wether -> weather\n>\n> Actually that should be whether, weather is talking about\n> how sunny / cloudy it is. I'll do:\n\nAbsolutely!  Cool, typo in a typo fix :-).\n\nI wonder how brain works when one wants to type an English word, the right one,\nknows how to spell it and still the fingers type a similarly sounding different\nword unnoticed.  I've observed this phenomenon also in e-mails of native\nspeakers so it cannot be explained simply as that writing in a foreign language\nis more demanding.\n\n> s/wether/whether/\n\nThis one looks correct. :-)\n\n> for v5.\n>\n> Thanks & Regards,\n>\n> Hans\n>\n>\n>\n>\n>\n>\n>> \n>> [...]\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 BF92EBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 17:25:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C0DE5627FC;\n\tMon,  4 Mar 2024 18:25:11 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 656C0627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 18:25:10 +0100 (CET)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-465-H8ICSGCZOQ6LveuKGtzreQ-1; Mon, 04 Mar 2024 12:25:07 -0500","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-412de139895so7063525e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 04 Mar 2024 09:25:07 -0800 (PST)","from nuthatch (nat-pool-brq-t.redhat.com. [213.175.37.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tl19-20020a7bc453000000b0041292306f2csm17939398wmi.16.2024.03.04.09.25.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 04 Mar 2024 09:25:05 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"acq/8ZpL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1709573109;\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=VKi6DpTP4ADMf6uvWW2wNORq4WdvXn3+hoR70MGHpPQ=;\n\tb=acq/8ZpL+kZSffy8weKqV/t7TeLlWwT0FxJDDutppmrbyWADfAdcwszA4cAk7AwwSGJMGC\n\tmXZRhmYSwvXhdJ6caegWNMZDNIJ/fU5k5nzvVvKm7db5l/+J7k4MkxOKrciz1E68ti04jF\n\t0nSCdS3gCJSSsPYqkt/zTvF/wra2BXY=","X-MC-Unique":"H8ICSGCZOQ6LveuKGtzreQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1709573106; x=1710177906;\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=VKi6DpTP4ADMf6uvWW2wNORq4WdvXn3+hoR70MGHpPQ=;\n\tb=bzb/DeLEHQMBzbeEHgw896sccXk2rpEiXdAFAAMd6lNpkZUMk/WbVejXQTuF91lN6r\n\twh1sbBI8t64EsFFyL9JiUc+gFzLN8iPfYhswjYofdkWpHX0jEmdcFAGsUPlpI84EaQou\n\t97ryO0IdjDr6DoBGOeVEYQJ3zOCefheI36ADSLFtuBZ+UvXPdjwCCeRLvfpbb7iSwQJ0\n\tSiPpMF3TJwp/bHsqPQVIAkaqr71+ld/03wjIsOKBKKeS+VjWcY5IeCwnCiXuZQPMZ+kJ\n\tsvxiJAeKK58dAgut9npy2tH4wpvzQHDe3o+B26EE0G2YMA3TpMa9XHzZa25I0Ba8U3Pd\n\tByWg==","X-Gm-Message-State":"AOJu0YwGLOODIY7DAkLEb7mpliWKn5LsIP20DxLc1mMdWym8+aVNNMer\n\t4A5WyARuJtMELUtgQz9i0qjFfT9oKt6oIAcnL0OtaUeF0TsvI5QtpfJ+mXrsjvYg/OJwLmLajPW\n\tn9kUzLQEmeCjTj6YQkTDAK27mjAnOoh1oqNN0K0qlxfPnOl+Vy5dsKIQJfjCrGgEYsy/W9tY=","X-Received":["by 2002:a05:600c:45c7:b0:412:bb8e:eb0 with SMTP id\n\ts7-20020a05600c45c700b00412bb8e0eb0mr128517wmo.18.1709573106595; \n\tMon, 04 Mar 2024 09:25:06 -0800 (PST)","by 2002:a05:600c:45c7:b0:412:bb8e:eb0 with SMTP id\n\ts7-20020a05600c45c700b00412bb8e0eb0mr128491wmo.18.1709573106191; \n\tMon, 04 Mar 2024 09:25:06 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHieeDhNcuS1AWXunIhuG//quqE4QhqxMSi1Ljtpe1KWW/94M72lbJHHIWZoA+Gqi1pDEQPTA==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Hans de Goede <hdegoede@redhat.com>","Subject":"Re: [PATCH v4 06/18] libcamera: software_isp: Add SwStatsCpu class","In-Reply-To":"<efe19b97-518d-4564-8ad0-722fc525a472@redhat.com> (Hans de\n\tGoede's message of \"Mon, 4 Mar 2024 16:30:43 +0100\")","References":"<20240229183654.7206-1-hdegoede@redhat.com>\n\t<20240229183654.7206-7-hdegoede@redhat.com>\n\t<87msreavg3.fsf@redhat.com>\n\t<efe19b97-518d-4564-8ad0-722fc525a472@redhat.com>","Date":"Mon, 04 Mar 2024 18:25:05 +0100","Message-ID":"<87wmqhaozy.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","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>","Cc":"Maxime Ripard <mripard@redhat.com>, Marttico <g.martti@gmail.com>,\n\tToon Langendam <t.langendam@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org, Pavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tDennis Bonke <admin@dennisbonke.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]