From patchwork Tue Dec 2 13:31:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 25296 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4FE0FC32EA for ; Tue, 2 Dec 2025 13:32:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6410A60D16; Tue, 2 Dec 2025 14:32:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z6dClsls"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 19B9D60C88 for ; Tue, 2 Dec 2025 14:32:13 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4779cb0a33fso57734675e9.0 for ; Tue, 02 Dec 2025 05:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764682332; x=1765287132; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KQPTsn/KLpLpdnxwrT8L2zFzJbbxCaiz8WDvZQ7olVM=; b=Z6dClsls72P/CDnOVHWrmJHSWm/2rNvmZ1Ohf/2+IVeY7nMDcLi6qU0s2/liOEbukp Q2AFVSF63Ndo8G0qLsnme71cVUrzMJqziSR7FNLCrnhvomMOokLDqBQHI/vg99Ckwtzi zM94Sct6+m7QMiyWYkCs6/Qn8T5dEH5d1TiydlTjznejEqS2U5p8zQSjanbPk71L0i8/ wy82JZsk2eKyXmibiRmqZ3axxeMN8Bozg3ZZaWyWeP26Xa8WlIcR5ghmuRx6L13L3STX Ao++/N0VT1MpjuK2mTRekH05lbXorhyMZp8XQwl01bRp9VuWwwmw42BCppNkQboJTP4E Aeyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764682332; x=1765287132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KQPTsn/KLpLpdnxwrT8L2zFzJbbxCaiz8WDvZQ7olVM=; b=QAlNn90XYuuoDr0vl2yQ+eGmuumz99S8xWDBq0La7wSqJUY6tnAAXbJe/T635ReHIl CXZe+G7Rw7j6dDHmuRi+s3JtbQFWbqyQPDspsdZIGWYW7o3t4SUvApZ9e53UnigK2OAg OkADrzw6FhpV2PsS28wunwxsCXAjgYIECIlZRFZiQE5AWk3NwBYqjYLvUyIaI2YJQi8P 0mDWJ6Rdv0pLdb6BhPTBCSszjtm+N9tsp0yQiPLQm274oozFka0mZQ5Em5nszM+AVd+t XX9m2tmywqYNlzW9aWe7TMaqMwNCvanwhJRgN9WyE5kCeCKrMkKZuCyWKlhg3vokq97N 9Dgw== X-Gm-Message-State: AOJu0YxT7IaGWUZGIw8KGHzRohxSc5I/q0Y8xIh1b8hAlfa/UGh3AttU bAi3YQzpWu00eH2SdftQTows90OKA5sEWA4yv1POSOynQiUWRDrnLqw8wb+w2B3GCdvXoXWKrNo ga7nP X-Gm-Gg: ASbGncsE2m9i+hI7wV3SYjF5ICOMzHE6HDk852/+0UZ9FmRpTfL6lMMc4md3CydqEyX qyFyhbW7MDA4RX/FW6/UhIVEV4qka9iVEsieawv5YbCkRbbZW8FF90DFzVGZvw9v3/zNvIiwZQZ ZFK1/IkqvcSH0LdjxYMbqo6pFhzdnUBH2H8FGhUrMiylqsWYCAg4UC2VF5WqdqwBoF86bqxxInF Oqek36fcknLQp/Z740E2hKwPVr87CnhM3R44VJzZxKfZfKQINL29SYmhXSiSyaa72iS+d7DnAO0 z1h1W1Z70pL+1AlzXPRFtsAdWg3kZOr7/fgyuCVIuuDUK4ViVtEfZfjtMAeHR30+01q4IQZijOy hH3HrqbcG/h4+Mv8Nm9x2+1tK1vKn4DkAgHJHs8oeDSEjJ+HmjSbpZPpDGhu27KfE9Lc+YBMnEe MdeG3niVgAkAm66jP3Nd3KPcgoylHWm7ArvqWkkc3NPdwxsgDu5ma/H3UMgUWhHzfzpS8= X-Google-Smtp-Source: AGHT+IHboZ31W7T4jzanYYc591RzQoc78FjKsMHQrrxgjf5eAJy4cYgKcX12+cCHmliK65gF0Kz3ZA== X-Received: by 2002:a5d:5d83:0:b0:42b:3257:f175 with SMTP id ffacd0b85a97d-42cc1d0cd34mr45406119f8f.28.1764682332250; Tue, 02 Dec 2025 05:32:12 -0800 (PST) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5c30c4sm33363322f8f.9.2025.12.02.05.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:32:11 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Kieran Bingham , Milan Zamazal Subject: [PATCH v3 10/22] libcamera: software_isp: Move Bayer params init from DebayerCpu to Debayer Date: Tue, 2 Dec 2025 13:31:41 +0000 Message-ID: <20251202133157.661407-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202133157.661407-1-bryan.odonoghue@linaro.org> References: <20251202133157.661407-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Move the initialisation of Bayer params and CCM to a new constructor in the Debayer class. Ensure we call the base class constructor from DebayerCpu's constructor in the expected constructor order Debayer then DebayerCpu. Reviewed-by: Kieran Bingham Reviewed-by: Milan Zamazal Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/debayer.cpp | 11 +++++++++++ src/libcamera/software_isp/debayer.h | 2 +- src/libcamera/software_isp/debayer_cpu.cpp | 8 -------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index 1e3f08673..8cadfaadc 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -109,6 +109,17 @@ namespace libcamera { LOG_DEFINE_CATEGORY(Debayer) +Debayer::Debayer(const GlobalConfiguration &configuration) : bench_(configuration) +{ + /* Initialize color lookup tables */ + for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) { + red_[i] = green_[i] = blue_[i] = i; + redCcm_[i] = { static_cast(i), 0, 0 }; + greenCcm_[i] = { 0, static_cast(i), 0 }; + blueCcm_[i] = { 0, 0, static_cast(i) }; + } +} + Debayer::~Debayer() { } diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h index b562985a6..f4373ddeb 100644 --- a/src/libcamera/software_isp/debayer.h +++ b/src/libcamera/software_isp/debayer.h @@ -33,7 +33,7 @@ LOG_DECLARE_CATEGORY(Debayer) class Debayer : public Object { public: - Debayer (const GlobalConfiguration &configuration) : bench_(configuration) {}; + Debayer (const GlobalConfiguration &configuration); virtual ~Debayer() = 0; virtual int configure(const StreamConfiguration &inputCfg, diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp index e55599f09..8f42d706b 100644 --- a/src/libcamera/software_isp/debayer_cpu.cpp +++ b/src/libcamera/software_isp/debayer_cpu.cpp @@ -57,14 +57,6 @@ DebayerCpu::DebayerCpu(std::unique_ptr stats, const GlobalConfigurat */ enableInputMemcpy_ = configuration.option({ "software_isp", "copy_input_buffer" }).value_or(true); - - /* Initialize color lookup tables */ - for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) { - red_[i] = green_[i] = blue_[i] = i; - redCcm_[i] = { static_cast(i), 0, 0 }; - greenCcm_[i] = { 0, static_cast(i), 0 }; - blueCcm_[i] = { 0, 0, static_cast(i) }; - } } DebayerCpu::~DebayerCpu() = default;