From patchwork Sun Aug 24 00:48:20 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: 24191 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 02C62C332A for ; Sun, 24 Aug 2025 00:48:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AEFCA69312; Sun, 24 Aug 2025 02:48:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HUFSV1Hh"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C8AA1692F9 for ; Sun, 24 Aug 2025 02:48:43 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-45a20c51c40so26179505e9.3 for ; Sat, 23 Aug 2025 17:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1755996523; x=1756601323; darn=lists.libcamera.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tLEHqivrWJMjpVCUINDZ9MbPl02eXZ0jb9Y1qP3OEYE=; b=HUFSV1HhwK4xfQz8YKD10iJBlDmJEeCZCA7uu1qXdrykBvCJ6e9jUmRFhFU9mzQBxx PwX/MghLJqRHdYpj8W8g5/9JHkcd77EOCq43HYObmAYZ0x/djztAy1JXzpB+XsGy9635 d4ViaiUU4CTdwlHCSUm/i9xjxYWje03BQvonZ7jHEmC+aoeJB32/ZqlDunVxfSL6UEPb iM6uct3wgHw5/QTtpcrD6NdX09ivInTGa6aby1KkZFD3j07nNgDlHYlvIwc2RtaJO1pw qjfrepmtuKp44yvNVzzsn4dVXXr0IaT3wf8fxYpsupEOb+uiuXvJE8nTEFmhMYmm3ksw oTmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755996523; x=1756601323; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tLEHqivrWJMjpVCUINDZ9MbPl02eXZ0jb9Y1qP3OEYE=; b=cxxtPzqULUU+byUoIQ3IRzJ7QrabBcJFNBTNwqw6YPHpKjw260G7j6GbADUzc18F3n rFGRRHy4f1TBalzeQq0+IOTur0qJ9Q6p13FVFD0gAkQr2hXcsG77cJxtQp2gHJAsCvUc ytOFTEyGl+nwOkopdn8bzuWVnumFncXemKqbdrwWCt2bScYNq5/Bh3h9lQ9ENE8jltR6 R2lcgxAqzKciKepQBMiDzIlUZdMap+x3GLAjEQtPF9KfW+k+mJAoNT6JTDz1+nNwJY3U j8t65v0nojyf9pDq2OQ91yvEuL6KUx2osTjZ7JZuqCG1ExCONiUFLDMyVc5h9sN9r5oL 94Lg== X-Gm-Message-State: AOJu0YxD/0Zgrn/87u5NFAdEXx9oOSy6jz5RKkNMz6Opw0ySOCBIbReV c8kS3HBbVwkIlCDixy2IkUp8Yw5hYmfGwYOeQ2ddM01mx+sjX8L3NF0IDuMEA7BMOJ8RyB6negJ CnsujNI0= X-Gm-Gg: ASbGncuH9vKPKxGgWZteBrWkeVijNlM0mUEKCwbrp/SRsX0sCjYTkLQ57OFpjwyx777 qfMZKBrwiKmmdk9u/Bp4cr2D6ibpbX+BzEuSxFv2rD7Yi90tf7ze5nVwDf5CW16Y/HInFeTuN3u xeWNtFL96dN3W5e6HaVI0jr+DXkN+UKmI18JsG8xAYslI2s/TBHLIlYyqopwcZMwG2iQsqF6Cp5 YFM/kyA0VpPUJq5qRmxWM1Z6xTjx2RJHx3D2V0nfhmbFKsXVK6j/4SfDfxV2u3DI7hfrbqFwQEn cp8k8n4EI8tvNEfG/p4kW8WRa+HctyF0gTm9F1hJaUTlR9YwwkhOJq+RSUF3JlSCWvrQ5S6qPpC IQEqgiczDeKjIs70cNOSdyjNNbkTBJCzTdV6hI6+gd3zTHfFX3cZCyul7Cy7k3W/mYHndD4FFzc mymJNGVnwh+lBFmXJAvSPm X-Google-Smtp-Source: AGHT+IFjptaJdN2vrT2gFU5/REGe/9B7ex2dmWlVztgCLktnMAyS3lx+vQVeT7YHQqJp5lePure0YQ== X-Received: by 2002:a05:600c:3147:b0:459:d46a:ee3d with SMTP id 5b1f17b1804b1-45b51798f71mr61017965e9.2.1755996523366; Sat, 23 Aug 2025 17:48:43 -0700 (PDT) Received: from [192.168.0.13] (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b4e1d530esm69347225e9.0.2025.08.23.17.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Aug 2025 17:48:42 -0700 (PDT) From: Bryan O'Donoghue Date: Sun, 24 Aug 2025 01:48:20 +0100 Subject: [PATCH v2 08/37] libcamera: software_isp: Move Bayer params init from DebayerCpu to Debayer MIME-Version: 1.0 Message-Id: <20250824-b4-v0-5-2-gpuisp-v2-a-v2-8-96f4576c814e@linaro.org> References: <20250824-b4-v0-5-2-gpuisp-v2-a-v2-0-96f4576c814e@linaro.org> In-Reply-To: <20250824-b4-v0-5-2-gpuisp-v2-a-v2-0-96f4576c814e@linaro.org> To: libcamera-devel@lists.libcamera.org Cc: Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2546; i=bryan.odonoghue@linaro.org; h=from:subject:message-id; bh=9pqT/2tcr+vuIs31tYBPjv6bibSNjZwn3wDmv+0JjMQ=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBoqmFds/QdokyC9dde07KRjCYeifDjtt6/oK5uA wv5RLwHc1qJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCaKphXQAKCRAicTuzoY3I Oqi2EAC0eVG4tTAR1sUyZJaEHeUb8lT7UYkbjYfGGxputIm/uK8MlIONuNWimkbaftRUeIMoe+v oqVQgqfb71W8m71pShpXJHgm9qj0gOdlVMubR6YD4NE5qrySBBWAxZ83oteaZvfjQEYXxygaXYI /5KLfctJaj6yxlFR+V5/sm2y9jYVXqc9ArHGbTRxX47xNwwea7H1AbYq5Rd92G9AvjxLgoUtq7p SYo+YURFHo4+VcFg7o7GloMRt2wkguxqTy/j6KI1bV28DoiOLqQ22enev/tX14Gp0m2CKZwYsl7 L5O4QBboMIpMnAFSHhG78TGKPOa1G9q+j+qjOQ9ug8lZ0lYHbZqaFDHXxNuaqJORGWBRRfVZAH1 SLTWBp7hxpy1iNABysjYyESNThUdaAZ5wI3Cr7xAa7Dr6nFt29IV8YpIR5p+vOouT/dM9LGwa0T oC55b/qckv9cstf3Nq5RUDjBZTwStUJv4HPoctka9WfCmFDry+J4UZG6I9un8F77CXfkJqUDX9X W4QC/dWzhpsODL2fGRLBICDbXRiKJbccyOhtYPmMV2Z0lKRfycnvCP2Bd5NX2BE/VV7rPzBoGyT IxsxkOYjW9TTqireH3r4MT3B1bFpMSLtw00JIZk+MI17c5p/lKtcg4bxD8IW3EH0VAAZoPQk2mG uri1q1tWXqKXeCw== X-Developer-Key: i=bryan.odonoghue@linaro.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A 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 | 8 -------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index e9e18c488489c776ee93886184113406f39e6685..29fdcbbfd4eba4a23c520b22784bf003f22a93f4 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 45da822a2173070fd1b99bbfed4c0fdeaa1a88c6..01b6e916f2a7199c592abd8a57ef549eaf388a8b 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 8d30bf4a2115137939f01378e8af594170d4d459..408ce2baa5e8a23902cbf0ca2b9ea87e73b4e882 100644 --- a/src/libcamera/software_isp/debayer_cpu.cpp +++ b/src/libcamera/software_isp/debayer_cpu.cpp @@ -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;