From patchwork Thu Nov 20 23:20:07 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: 25111 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 675A5C3333 for ; Thu, 20 Nov 2025 23:20:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1268460AB2; Fri, 21 Nov 2025 00:20:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rxwqmCzz"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A6AE60A8A for ; Fri, 21 Nov 2025 00:20:43 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-47798ded6fcso8877155e9.1 for ; Thu, 20 Nov 2025 15:20:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763680842; x=1764285642; 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=6taQd3w4X1L7oCzH3j3Wpop7VYRFzi9h4x9pwFGHnV8=; b=rxwqmCzztppcewPysY5p7W1ZLgV5HlEVbO0tq+WzYzk8uOTVQouNpaWe5ro8X5rxPc YuW9SMQUbwC0jYPk8mvJ7KYmi91x3JaC+uKcu4q2MXcVUn2iCBfJcrCRjg4TYnrRD/a6 MH/A0a6/TQN7quQj280iArXejn20UM41+ILjVgOgJ+o9QpWCzC2q3Y8ClicqgFDMvR++ sp2FT92SxggokygjksV88rnKZ4vmVM1mdub5gFr7kmgWf9MM2MDRR6xo0MP8MKjFWhm5 FdeLxA7cOx1MwWZ+CJ6+O3QwSmGJFlm4ffQInQgT/0Bwb62o0jtpUHgiQkP0BU3FD9X0 s5bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763680842; x=1764285642; 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=6taQd3w4X1L7oCzH3j3Wpop7VYRFzi9h4x9pwFGHnV8=; b=taEzp2YkJ3tEvAZHwzR1HcsMfRXHx9jFsKGfVx7rUSPQsq7cPILNAmpsSlpyEOZFaO uEaiutk3o2GZuFlJ4xe/C/PANL+fu8KOBF5NKstEC6vjBF7ZyCeMvCUa09pEQGi1raOB /F8Yulem0CaxrtDD6p27TqHk+/tt3/TJ2GXYfNvIs/ZzBwx74XfaqXlEPVnW7HK5qVq0 bvaDCaeN/NJGbIKKDSygc+OYe+2LflwnPYmQIzOIc9oQLBLFa/O1637lOrOAQsBSKWnm jUm0XLcReQ4B6p8038D6l0vHANqotpsATEZKZEHDx0FeAMXlu2Ydwxzq3Pa7s2jDgZK4 6Ntw== X-Gm-Message-State: AOJu0YyEc5rvnBs4wMvv6EQtftnSUO6JD/NgIu+8OSMs8FAvkyi0LTa+ vF4PVamm/QCXr75/CNW+GONaqoGhqBHqikBLsGWnenNSHBFhUNsgOTUgtKjAAkrI0sFGqXy2+/Q w+WfxHJM= X-Gm-Gg: ASbGncsg42fld5zKRIX3dp4L3W8VSRHC1z7bJNKTdRB/BAtjiN7RQ8LO9hRNayuhYwd SLpcIPM6c2VotZrUJTjKhC36Vh3rf+dDHmJq9GXLPBsgkuU10NlK9HVMRAHotwfpiedehD7hAYY 74QDxt4jfO/oyb8AuILK9WypgoubUPS5crbRWn6o+nDeNXXUcC28NMcMRgBr/qIIBNKKMAer9nW XQawelLcTxdAyGmN14YEoKlqSjN9BlSYrBdH+DEXvK0sFo4nDwXaKfDy3MY5Np/pbFeBDW26mWa 309zHQttpTuGtD7f2YSg7JiFENkW+wVwxki4Wzvd5bAwC8/nZa3qFuuN8wZHXjD+NFSEOQmJ4p7 c2fB2DWdJ0zVspMeTsfDZIpA1PD+LZN+PVIVgzKcFpN+EvmhR/NNmRf8nbOPc45A9Mpgf/0Gumy qCPrgyVuEc4vK7clihraotCLOFk7EhqIbAloG/L3iiBTYQThcR/uXktu5oj9LmRUpTFhU= X-Google-Smtp-Source: AGHT+IGPVfSINfNlHRtOdH9zwOfPn0hHHkM5fDAP7QiF9spkFXScVpbOrajmrhoafPWNJd4UspJyyA== X-Received: by 2002:a05:600c:5249:b0:477:5897:a0c4 with SMTP id 5b1f17b1804b1-477c10c858bmr541755e9.4.1763680842624; Thu, 20 Nov 2025 15:20:42 -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 5b1f17b1804b1-477bf3af0ecsm11618415e9.9.2025.11.20.15.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 15:20:41 -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 10/22] libcamera: software_isp: Move Bayer params init from DebayerCpu to Debayer Date: Thu, 20 Nov 2025 23:20:07 +0000 Message-ID: <20251120232019.3590-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251120232019.3590-1-bryan.odonoghue@linaro.org> References: <20251120232019.3590-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 e9130df1e..f267f8c7f 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 578535b20..dc0b8e67b 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;