From patchwork Thu Nov 27 02:22:42 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: 25224 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 071E6C3260 for ; Thu, 27 Nov 2025 02:23:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A256360AB8; Thu, 27 Nov 2025 03:23:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="z5AMNo66"; dkim-atps=neutral Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B83EB609DE for ; Thu, 27 Nov 2025 03:23:25 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-477a1c28778so3189665e9.3 for ; Wed, 26 Nov 2025 18:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764210205; x=1764815005; 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=rHp1ZpmpNd8F5seragsp7cEDNOHsYn8jNKQx3PfPjQs=; b=z5AMNo66mduPq1jHzSld5DGGqfkcpBjt0Qwtp9RkSHbtJJ9iVhWvQSlX0mVRS9enqP yxSzlnPMO6vZ+LTeaVDp4NoREEog2tAg02FCT36hiNKKR0saUlpYemrTllvXJHJgPO2x Ejf2yje+bWSSmRBCDTxbJ2GFF+xk0ywXM3kkftXfZu+VcE9/V7FGp83VGe0McvGrho0Z IrpB/e9LpzsrZXcb7njxeryFJKsigCNqwjMp0M4F07PbFpxADleh8gYQsfYukN2kw+bc +wJQNuyGRrsGDp7f49fV/PEi9YLzXN9BZgWWcmO/S38/P9RGe+99EYegfv796nIe2FB7 DZYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764210205; x=1764815005; 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=rHp1ZpmpNd8F5seragsp7cEDNOHsYn8jNKQx3PfPjQs=; b=FwIGvmB3zgkCgc64vmcQbnaZbmefPQk1CLtkgftwPS3hZw4bEwEpZrSgJnWiAQ02ws gBnQPQwHzeEhHJTixkKI8T7Df8ipa1Vy/vU9rDP9QQkS1Dj3Bi82DNveSghuQM2pbNfr RvAjFZ3C8GYpXGn+jLOgOLahtuOdkHckogXtNnOKvC+OKeoJ7AeFPIMu05sp0fqZfvT/ 4jpwWDu7yIxcEKRWzOihN5WsE2cSF6jAYevOXKIEbhK6xldQCh/h7zBv/JrZci3dhJTj m1IeWHo2G3sapgAAcW+QPBaYHcjfLMEWpKxi3P6LJZ2m6C0sq+iN3+VNaiabHM+YzZBb fZHQ== X-Gm-Message-State: AOJu0YwMQ2Y3eVrjGvEZMAwyJ+olbXkEoLM87vjA0tQzouXT6Xxa82CH Ay6lJlPnKrcII9moSjQeqjVQY9Fuu/gFapA1QvSwQrzqrd1Onrfs07JcKdCSo5dPVbxoBYx+CfE pswS0c7s= X-Gm-Gg: ASbGncucpM8mu/qcR70oMCkX3nJuAhfy7kG4MS/9z89FrKom5cKY57caj0nKvyFRr9C iwvo2FexIBg1GGyRo2D5R7WhkxsoYwxMhbcsZPlnm1D8zrxKi3kDENULzbNQCHSvx94xROWELOh OHclnrN98UQ+6kpeyV6tKuCficnSHIzhBgCOOnXhjNQQ+Mtz/KbmAwGgWJYZpqSTOHfwB28+XLN uRXBXz9v0onyuJmwfx1PuKikyajByt0ni8keSRcpsvNAU5zjAH/LGB/AJlwFX+bTIRthIiGMMek EWTi2se64KKn67MctDBIErFr0mW+2B1ybgqH7J7tjlavFRte6auWYuwkq1owggmur+nbletgqoQ LWbANWQTSBsiL8UMaWuPkgMxEaBiGeqDmhypT02sl1/vNrS6FsVXeaG04tvC6lev9XNY1nxY7qM 5OPh8rK3Z0HnhJu/amBvWdsWW/K+RSrZv2AZ6oE7YivvX4EQWYMzbhjFw5h+nlIcPsv8odthddC NRvtA== X-Google-Smtp-Source: AGHT+IFm3ugUOAuGXQVG7PI6CM//mxD2RbLwgIvj23fQw3ZTih/B4/N/T6qqDuitUveFarYzsfXUoA== X-Received: by 2002:a05:600c:4591:b0:475:e067:f23d with SMTP id 5b1f17b1804b1-47904b1fac9mr80618965e9.25.1764210205083; Wed, 26 Nov 2025 18:23:25 -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-4790b0e21e8sm71549495e9.15.2025.11.26.18.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 18:23:24 -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 v2 10/22] libcamera: software_isp: Move Bayer params init from DebayerCpu to Debayer Date: Thu, 27 Nov 2025 02:22:42 +0000 Message-ID: <20251127022256.178929-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251127022256.178929-1-bryan.odonoghue@linaro.org> References: <20251127022256.178929-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;