From patchwork Wed Jun 11 01:32:19 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: 23515 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 146E3C3324 for ; Wed, 11 Jun 2025 01:33:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AD79568DD0; Wed, 11 Jun 2025 03:33:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="azb/5Mdi"; dkim-atps=neutral Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7367E68DD1 for ; Wed, 11 Jun 2025 03:33:27 +0200 (CEST) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3a503d9ef59so5107789f8f.3 for ; Tue, 10 Jun 2025 18:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749605607; x=1750210407; 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=MnMhF/Y9/Rt41akuVWJPY/Wx/I+HkuTsZYCBn4kRXXw=; b=azb/5MdiG1QgwEY9nf3pUHiduUYRzk/goEEPKrwJfwIMqSAalrV2o434Coi03+WWPK sVaJ65GU8B1ebxp2/RxccCGXhe6wXqyDIVW6dKmtzITODUCEXJBr3GixYhDWHOwEDzfV MR9R+IOrP4rRxGmEhZSBQyiXWQcU2tgGZly34HDHrAMdagjm2cVx14iUQGRd9/qG4DER u2riStg6PDFXlCTq+xcXhb2UDSxtNiRJWuDfrei4OZXpGdxY5nRpFK8wuAo2PZfIDJPn 35+UEmBJGMC8sknelwLa/dSv1ipV42KIIHRwpg+g2n9ePRtR2tkXJxFbVFonCrfsS1TS ipGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749605607; x=1750210407; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MnMhF/Y9/Rt41akuVWJPY/Wx/I+HkuTsZYCBn4kRXXw=; b=cMGxwIdcyAbcl9aRD7ljvuFOQbS+35lF2Sis27WKvrXiKS5LA3cC09Ssw9JhKEqsOc t5YSIajMmN4LDVtpxFpbrE/CE3K4L8drHyuttdea++gUyXdIFJis7FP610BL5NsbJuH1 mfoTodukasTnMQ/f5WIlOfN8QZuGF2CjVPREDk9ofX3Iu2M6SgmVBWwf5T6COYa65Dd7 BOYYcV1cgjhaXPCGwqyAM0AMbKJKYWBjE6KxLwd2QjTWO/AxVdxn0bvoTGOxw8kPw3i9 C5oAmz0wct8qgbTRIl0un8urhmHa2QvjxQ8EEPwznjgwTAEKnMjWxFDG4CI4b/CVaqrQ X+cw== X-Gm-Message-State: AOJu0YyStGF3jMwgYQ4I5q2AjwuW/7Hw5oJ+PDry35bcW7ftwJTvLMJO zQsSu3HqD3CzrbA5MtBawzmOgIX75Wppn8SodDlXuBwSr/ozpSgNWYUHpsbGAkyt0WaLydCIwtm gpjro2xE= X-Gm-Gg: ASbGncvvfkyzzXh8YoDvc4eDb1ACH54hnYBEwXMJjNFjDe6DqG/5KQrE/0ljdaLDicl WeP3b3Y0F1bmssaq7OFfVXvIaw/EoKTZ2GjjkQM6wRgWlmEKcoU7kBj0bFXltTPTD6PR4II3p1f UGgB0VWngFxMPdEdaw71ZNXcwpg1M+6Wgu8loCXdkDFRHklnc5TQdjFiwJnIBJNffNkDawQRobx fGdgmmhF1Uxqo29UIIcRThwgqbWFNs0/fNtwGRRhiduh7jrJoEuSy91R8oenb15IWR6DvzwSSjE r6Yj+ODHR+UVnDP8Jvsn+Z8j536VusxExP6/1ZWCoKkbDBtlZYhWWdsos6DfMZcVQ1hXophtwiV q2qFNq2o9TDV+hoKPfp+aEdiSUO1Nbf5pinHwWcMLuw== X-Google-Smtp-Source: AGHT+IHjk69XazhQiHZBnggSa2PkcljqojJYjG6+qhg8ENnPUiVkeN8WuTou7kLmgB5t6YyhFk63wQ== X-Received: by 2002:a05:6000:2307:b0:3a4:e480:b5df with SMTP id ffacd0b85a97d-3a558a1aee6mr786163f8f.44.1749605606811; Tue, 10 Jun 2025 18:33:26 -0700 (PDT) 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-4532514138asm5680625e9.3.2025.06.10.18.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jun 2025 18:33:26 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: Bryan O'Donoghue Subject: [PATCH 09/35] libcamera: software_isp: Move Bayer parans init from DebayerCpu to Debayer Date: Wed, 11 Jun 2025 02:32:19 +0100 Message-ID: <20250611013245.133785-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250611013245.133785-1-bryan.odonoghue@linaro.org> References: <20250611013245.133785-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. Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/debayer.cpp | 11 +++++++++++ src/libcamera/software_isp/debayer.h | 1 + src/libcamera/software_isp/debayer_cpu.cpp | 10 +--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index e9e18c48..29fdcbbf 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -103,6 +103,17 @@ namespace libcamera { LOG_DEFINE_CATEGORY(Debayer) +Debayer::Debayer() +{ + /* 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 45da822a..01b6e916 100644 --- a/src/libcamera/software_isp/debayer.h +++ b/src/libcamera/software_isp/debayer.h @@ -32,6 +32,7 @@ LOG_DECLARE_CATEGORY(Debayer) class Debayer : public Object { public: + Debayer(); 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 8d30bf4a..13db8a8c 100644 --- a/src/libcamera/software_isp/debayer_cpu.cpp +++ b/src/libcamera/software_isp/debayer_cpu.cpp @@ -40,7 +40,7 @@ namespace libcamera { * \param[in] stats Pointer to the stats object to use */ DebayerCpu::DebayerCpu(std::unique_ptr stats) - : stats_(std::move(stats)) + : Debayer(), stats_(std::move(stats)) { /* * Reading from uncached buffers may be very slow. @@ -51,14 +51,6 @@ DebayerCpu::DebayerCpu(std::unique_ptr stats) * future. */ enableInputMemcpy_ = 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;