[{"id":36264,"web_url":"https://patchwork.libcamera.org/comment/36264/","msgid":"<176056366650.162040.15163216501117454729@ping.linuxembedded.co.uk>","date":"2025-10-15T21:27:46","subject":"Re: [PATCH v3 10/39] libcamera: software_isp: Move Bayer params init\n\tfrom DebayerCpu to Debayer","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Bryan O'Donoghue (2025-10-15 02:22:22)\n> Move the initialisation of Bayer params and CCM to a new constructor in the\n> Debayer class.\n> \n> Ensure we call the base class constructor from DebayerCpu's constructor in\n> the expected constructor order Debayer then DebayerCpu.\n> \n\nLooks like a straight move.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  src/libcamera/software_isp/debayer.cpp     | 11 +++++++++++\n>  src/libcamera/software_isp/debayer.h       |  2 +-\n>  src/libcamera/software_isp/debayer_cpu.cpp |  8 --------\n>  3 files changed, 12 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index e9e18c48..937d5e2e 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -103,6 +103,17 @@ namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(Debayer)\n>  \n> +Debayer::Debayer(const GlobalConfiguration &configuration) : bench_(configuration)\n> +{\n> +       /* Initialize color lookup tables */\n> +       for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n> +               red_[i] = green_[i] = blue_[i] = i;\n> +               redCcm_[i] = { static_cast<int16_t>(i), 0, 0 };\n> +               greenCcm_[i] = { 0, static_cast<int16_t>(i), 0 };\n> +               blueCcm_[i] = { 0, 0, static_cast<int16_t>(i) };\n> +       }\n> +}\n> +\n>  Debayer::~Debayer()\n>  {\n>  }\n> diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\n> index 1b195d29..2cbf0823 100644\n> --- a/src/libcamera/software_isp/debayer.h\n> +++ b/src/libcamera/software_isp/debayer.h\n> @@ -33,7 +33,7 @@ LOG_DECLARE_CATEGORY(Debayer)\n>  class Debayer : public Object\n>  {\n>  public:\n> -       Debayer (const GlobalConfiguration &configuration) : bench_(configuration) {};\n> +       Debayer (const GlobalConfiguration &configuration);\n>         virtual ~Debayer() = 0;\n>  \n>         virtual int configure(const StreamConfiguration &inputCfg,\n> diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\n> index 612f01a6..42a0f374 100644\n> --- a/src/libcamera/software_isp/debayer_cpu.cpp\n> +++ b/src/libcamera/software_isp/debayer_cpu.cpp\n> @@ -57,14 +57,6 @@ DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats, const GlobalConfigurat\n>          */\n>         enableInputMemcpy_ =\n>                 configuration.option<bool>({ \"software_isp\", \"copy_input_buffer\" }).value_or(true);\n> -\n> -       /* Initialize color lookup tables */\n> -       for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n> -               red_[i] = green_[i] = blue_[i] = i;\n> -               redCcm_[i] = { static_cast<int16_t>(i), 0, 0 };\n> -               greenCcm_[i] = { 0, static_cast<int16_t>(i), 0 };\n> -               blueCcm_[i] = { 0, 0, static_cast<int16_t>(i) };\n> -       }\n>  }\n>  \n>  DebayerCpu::~DebayerCpu() = default;\n> -- \n> 2.51.0\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 1158DC3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Oct 2025 21:27:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61FB86062E;\n\tWed, 15 Oct 2025 23:27:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BBB660615\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Oct 2025 23:27:50 +0200 (CEST)","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 9778EE7C;\n\tWed, 15 Oct 2025 23:26:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RW5aSWZa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760563570;\n\tbh=STA8wxeHx4hW/rSt8mdzQfClOh20wmNtD3/iqx0S7+k=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=RW5aSWZamZ6g+olz7JqgXCdhHPj6MPPkE2LmZ/+1ACtVcbM0X8S/cTua6adv296tW\n\t5cJBiBcQfromiGlQY/RMwDfL7f+J57dRWPwWhNjElViqaRIyYiwzMRLmrjkR26bY4k\n\tx2F41j4SdRx/E6FcsHazuiKRDyncvr7+aFHUWbQs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251015012251.17508-11-bryan.odonoghue@linaro.org>","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<20251015012251.17508-11-bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH v3 10/39] libcamera: software_isp: Move Bayer params init\n\tfrom DebayerCpu to Debayer","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org,\n\tbod.linux@nxsw.ie","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 15 Oct 2025 22:27:46 +0100","Message-ID":"<176056366650.162040.15163216501117454729@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":36295,"web_url":"https://patchwork.libcamera.org/comment/36295/","msgid":"<85ldlbgt0d.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-10-16T08:17:38","subject":"Re: [PATCH v3 10/39] libcamera: software_isp: Move Bayer params\n\tinit from DebayerCpu to Debayer","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Bryan,\n\nBryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> Move the initialisation of Bayer params and CCM to a new constructor in the\n> Debayer class.\n>\n> Ensure we call the base class constructor from DebayerCpu's constructor in\n> the expected constructor order Debayer then DebayerCpu.\n\nThis is already ensured, isn't it?\n\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n\nIt looks like it can be easily reverted once we decide to get rid of the\nlookup tables, good.\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  src/libcamera/software_isp/debayer.cpp     | 11 +++++++++++\n>  src/libcamera/software_isp/debayer.h       |  2 +-\n>  src/libcamera/software_isp/debayer_cpu.cpp |  8 --------\n>  3 files changed, 12 insertions(+), 9 deletions(-)\n>\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index e9e18c48..937d5e2e 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -103,6 +103,17 @@ namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(Debayer)\n>  \n> +Debayer::Debayer(const GlobalConfiguration &configuration) : bench_(configuration)\n> +{\n> +\t/* Initialize color lookup tables */\n> +\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n> +\t\tred_[i] = green_[i] = blue_[i] = i;\n> +\t\tredCcm_[i] = { static_cast<int16_t>(i), 0, 0 };\n> +\t\tgreenCcm_[i] = { 0, static_cast<int16_t>(i), 0 };\n> +\t\tblueCcm_[i] = { 0, 0, static_cast<int16_t>(i) };\n> +\t}\n> +}\n> +\n>  Debayer::~Debayer()\n>  {\n>  }\n> diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\n> index 1b195d29..2cbf0823 100644\n> --- a/src/libcamera/software_isp/debayer.h\n> +++ b/src/libcamera/software_isp/debayer.h\n> @@ -33,7 +33,7 @@ LOG_DECLARE_CATEGORY(Debayer)\n>  class Debayer : public Object\n>  {\n>  public:\n> -\tDebayer (const GlobalConfiguration &configuration) : bench_(configuration) {};\n> +\tDebayer (const GlobalConfiguration &configuration);\n>  \tvirtual ~Debayer() = 0;\n>  \n>  \tvirtual int configure(const StreamConfiguration &inputCfg,\n> diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\n> index 612f01a6..42a0f374 100644\n> --- a/src/libcamera/software_isp/debayer_cpu.cpp\n> +++ b/src/libcamera/software_isp/debayer_cpu.cpp\n> @@ -57,14 +57,6 @@ DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats, const GlobalConfigurat\n>  \t */\n>  \tenableInputMemcpy_ =\n>  \t\tconfiguration.option<bool>({ \"software_isp\", \"copy_input_buffer\" }).value_or(true);\n> -\n> -\t/* Initialize color lookup tables */\n> -\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n> -\t\tred_[i] = green_[i] = blue_[i] = i;\n> -\t\tredCcm_[i] = { static_cast<int16_t>(i), 0, 0 };\n> -\t\tgreenCcm_[i] = { 0, static_cast<int16_t>(i), 0 };\n> -\t\tblueCcm_[i] = { 0, 0, static_cast<int16_t>(i) };\n> -\t}\n>  }\n>  \n>  DebayerCpu::~DebayerCpu() = default;","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 EEE54BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Oct 2025 08:17:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D367860667;\n\tThu, 16 Oct 2025 10:17:46 +0200 (CEST)","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 76E0E600CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 10:17:45 +0200 (CEST)","from mail-ej1-f71.google.com (mail-ej1-f71.google.com\n\t[209.85.218.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-Sd5lTPLxMjSM-jdM0NM2nQ-1; Thu, 16 Oct 2025 04:17:42 -0400","by mail-ej1-f71.google.com with SMTP id\n\ta640c23a62f3a-b5cbb3629f2so46368466b.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 01:17:41 -0700 (PDT)","from mzamazal-thinkpadp1gen7.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\ta640c23a62f3a-b5ccd1b061fsm447668666b.64.2025.10.16.01.17.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 16 Oct 2025 01:17:39 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"ZPc3MGTj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1760602664;\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=ebzi8xjv0BIwJgRWW6hFGaQgljCJxchkf+S7ckDtAVo=;\n\tb=ZPc3MGTjenIE/6NHiqB0VTYbdy2/E6qle1Fuhu8Jvnzimu0h4/64/0MihycsGhx67McWFC\n\tcsdNTIswdTsyhsNiXqKl90Hz+piwyRZnTnnED0GAzcqsJPxMoelVu8bnNoIr9Sd0AsYFwj\n\tKMSZuXAkzBcBJIq+cwnp6T3MZ/1ne3E=","X-MC-Unique":"Sd5lTPLxMjSM-jdM0NM2nQ-1","X-Mimecast-MFC-AGG-ID":"Sd5lTPLxMjSM-jdM0NM2nQ_1760602661","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1760602660; x=1761207460;\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=ebzi8xjv0BIwJgRWW6hFGaQgljCJxchkf+S7ckDtAVo=;\n\tb=gE+OoxhZKLOaHgtsyNF4dZFg8RCk5i8ctvdbgCVmAG4Hkf6gum8X/NMIbbOkSff7Ga\n\tQiD/g5h8P0n8YmbGXdXw9EzSMVsXhDwQsj6AFNSLzTjmojGQt1bDchIS23143Mc08hYe\n\tzieK8pyJ9PaLu6A7LjPzc4fvcabqtix94Ef1tfGXsiydXKZYHxNPZWPuPEuVqOWBKa4d\n\tX+qqOACuu8LQCPrIf0j2nUa00++Iposbjh7RY2IiThf63SP/hcpGWbLu2wKwuEjhdgo3\n\tjvGtg1y8cKTLRm+FAsIOXrml9IrkpK/J5EudRfvStk2cc2sRIBoZThSNKkhD4QulnBD0\n\taP/g==","X-Gm-Message-State":"AOJu0YzRWu2G658w3lgENLmlkUmwbUzGPl4NR8LcbKFMS1H4CaW3W3bQ\n\t3oYlNKZyAky2b0w2IQNqbpkzz4NUZq9zSTOAKE7wd9BU+bu09dUpUQ17URscchM9ydQti2sQbbr\n\tyk2xgNLbXacWsSQtNl0RE6lVyr+YoiH7HOLRwn5UISVGLGc6lNNbtz6qys3EUoCgEFVxta5BYEe\n\tboa9SiFlM=","X-Gm-Gg":"ASbGncsFqnxk/paKxk4Y8K5qONm4Yb6sv/d2SLOENUKRxVoHMj1ZG9vRE6HxOaa7lKL\n\tN/n9W5gU7SvcY2Nojh47PFuaxQ/68uNUVFYJwCcb0zpCOxhKGYl1DlC0B51W3b9Ay7uLYYlg55A\n\tL3HNfAnOmQwP0wBALPB9P+SOnXAg6bJLm3oBihIldteCCcuYx8V4IUwvIuM6X2RR/BwqYHAj2rD\n\tlu6o/MYyGzs7ktdSY6eRRE25ek54Ey8TtIw9cU0DXGZFD42sNjK806T/owqNwlLoA/7nzGAvWp8\n\tem4ZvH0x/grGCkrGXvzQaShLjGgfsE+n6Lipb3E3Hv5mnkD4S7Dgm+79Ack5EKmqe1HfME6wF/I\n\tkrOeVQkWGk4yERF5Ka5+WW3xhDuEUKBC56IxOF3heZVmyUdUaaIuS","X-Received":["by 2002:a17:907:86a6:b0:b3b:b839:577b with SMTP id\n\ta640c23a62f3a-b50a9d59a19mr3446284266b.12.1760602660352; \n\tThu, 16 Oct 2025 01:17:40 -0700 (PDT)","by 2002:a17:907:86a6:b0:b3b:b839:577b with SMTP id\n\ta640c23a62f3a-b50a9d59a19mr3446280966b.12.1760602659819; \n\tThu, 16 Oct 2025 01:17:39 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IEiGx8ijPx3NZy1k1Ffs4OSF5HZ2FP6ECem8i1KdHtf9n+IH0n8JhulSx2Bno5793fFTHXjsw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  hdegoede@redhat.com,\n\tbod.linux@nxsw.ie","Subject":"Re: [PATCH v3 10/39] libcamera: software_isp: Move Bayer params\n\tinit from DebayerCpu to Debayer","In-Reply-To":"<20251015012251.17508-11-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 15 Oct 2025 02:22:22 +0100\")","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<20251015012251.17508-11-bryan.odonoghue@linaro.org>","Date":"Thu, 16 Oct 2025 10:17:38 +0200","Message-ID":"<85ldlbgt0d.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"iP4PUrNN4EkWlM4QTAz_Rg7EFowb78q3Fc7JAg19ckM_1760602661","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>"}}]