From patchwork Wed Oct 15 01:22:22 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: 24655 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 79D67C3264 for ; Wed, 15 Oct 2025 01:23:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2A01460624; Wed, 15 Oct 2025 03:23:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HYd2z6Rj"; dkim-atps=neutral Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2DBDD60615 for ; Wed, 15 Oct 2025 03:23:05 +0200 (CEST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-b07d4d24d09so477426466b.2 for ; Tue, 14 Oct 2025 18:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1760491384; x=1761096184; 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=rj1Q9DVnuRBHPeor/fvWxLXblC1U/WJh3SPsduMY8kI=; b=HYd2z6Rj9dg6tjjBTZQgCyCcrCl+vUV4+1Jst9qIEuhW3rjYsPlMES2J+AKaV4mMds Z2wsTFmFivz2Q2J+8+Qmz//oe/wIPi2RpHf7Ah6GCQrIs5GxgWca7yup/anJL22TjSrI 68ypY7+6n07+QiGdCNMo64vJO+17ZtonI+zmxkyZuz2JuaVdMULfZ8aV57EXlkXoskhD TMwFbYH//oUcgOImTBGX4g2FS+Lcjr7wkOxK5gQS2/K8ilmNNk1CpL5Yepyi67nCYelM cPhvaKMD5/9nmt6E1uBM5l9XuPPSH89Pw2hDchMRUkb7Mbg/5+Y9C7BYS7XLmINzU+vO ogUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760491384; x=1761096184; 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=rj1Q9DVnuRBHPeor/fvWxLXblC1U/WJh3SPsduMY8kI=; b=CLmwR9j+i5Dpnv7zqhV2+WdrBYxOuGWZ8WnNOICIWQZ/zHTIGNdYtvcPnfWi4KG97S qUbU0MukqYZ/mu2Q0rtol7XcoBP8G8gCg8tLoEvg2hzOf3K2Sv0X1r4kl/RS09fu8sp/ 9id7eGnooy3jBN1WWWsvSG6J+q2aCTqz5UjMgTRAyIlqPbV4xI7nhuVrI5K7AZz7hkZR BP09XBCh65vLODpyyl/28ekNTOpkt7JK9zrY1zgYdKHKMcC3eVn+tuWFSowvmkGVgtxH NwBf7sjQImcU7ByNo7ixqtN9UACoIy3QgSkMe8QCAbdSnl7in+JhfX66CyU4Ib0WKx42 AaVQ== X-Gm-Message-State: AOJu0YwvYGXPyvehn4SdxE+oxEj4dQePKFAkbr2UGM4PjKjM8WLT2iHQ 7Vp5bsPs7fbPHdyj2zjJn2bZC1d49qGCP+CTCWC3Ls0OldPWjgSEscZYJ3oD8bqAcYZqpf52t9C 3HD+q X-Gm-Gg: ASbGncs+rCrWnfiJPUhw74gm94Mf8VvVBCdhpO+5bxTO+Z5b39doQauLQLzzOBBRY1J OnIoe8RRRyUAYw6WSvJxocV7W4lr4hZEQ7ANIlUyJN70OoWQ4I5HoGqxR2IIMXbGWZ72VEuGmmV bzqDDgCK+Z6duZhnJ1HhbVAlCfNO3R2bMgTrkLNsIyJsalfbw/PHX0bCHnhX8E7fSZ8hDtTTSGK 0T30pLfhyzdQTChlOxf/5t3JGleqsJx7fktAOhWFixDcuaT10PwIalxIITIlFxRNlkg3L7xNZfn zadcfbb5JJl4La/KQZ3TljnxzkaMAjYGkGrszMAcGyydrIiu2sfVLdzrBzF/E6qTIFz9d8WjTxt A56PSyTdTZKQcFY+MLwKmyWzmh9yuoRdpumcJ90ENgwoeQ5ixY2W9VMl4R7KFIbVKQ69Qvvf+Rw rTCJqiVAHejaDFtBmvqoDV/7SW41BaVoZWFxq8DhcR X-Google-Smtp-Source: AGHT+IHMnOB1soD11NbYfr07bmRyMLyRTuZeh7yKeF0kPhDyO8bj7qHInhjKGXJcDhvE8F5Pc45XQA== X-Received: by 2002:a17:906:c10e:b0:b04:2533:e8dd with SMTP id a640c23a62f3a-b50acb0cc4cmr2742600166b.60.1760491384451; Tue, 14 Oct 2025 18:23:04 -0700 (PDT) Received: from inspiron14p-linux.nxsw.local (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b5ccd7b202dsm98348466b.82.2025.10.14.18.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 18:23:03 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org, bod.linux@nxsw.ie Subject: [PATCH v3 10/39] libcamera: software_isp: Move Bayer params init from DebayerCpu to Debayer Date: Wed, 15 Oct 2025 02:22:22 +0100 Message-ID: <20251015012251.17508-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015012251.17508-1-bryan.odonoghue@linaro.org> References: <20251015012251.17508-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 Reviewed-by: Kieran Bingham Reviewed-by: Milan Zamazal --- 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 e9e18c48..937d5e2e 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(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 1b195d29..2cbf0823 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 612f01a6..42a0f374 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;