From patchwork Mon Feb 8 15:07:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11195 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 56660BD162 for ; Mon, 8 Feb 2021 15:08:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2560660D26; Mon, 8 Feb 2021 16:08:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="fHnWd8Ba"; dkim-atps=neutral Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 50B0C60D21 for ; Mon, 8 Feb 2021 16:08:33 +0100 (CET) Received: by mail-wr1-x435.google.com with SMTP id u14so17572495wri.3 for ; Mon, 08 Feb 2021 07:08:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MeSSeQisOMZr1VtdPoWYea3+nhKVhtFXVS0jLnW5PYM=; b=fHnWd8Ba3I9vbcqjtsLpUzTgu1gd+cbe8qUT5/kEZKv1cQGHiZLjsWbMyE25GqT5kY LRXCPaTMZfFGZMU7KRCuThOPVMWeBMOlqJKgerA6AkspB7U3GpK0kVNcxmP4tH8og4um FXEou5BG4cJsWxi6Ad0ao2jjIsgKaPKK6AmS7hPm2NQUyVPk3Z7GB6qQBEQE7LO1oSeU KYP+ENOMn+DbV7twaAhoiYpKnZVbeleFxTW4BMhns4dkB9gibgrbIJjDgaprAG5XqP+S QPpPOGZcad264F5dPyYGz9WTviIyAMr+69ahD2sjGX2nl0ZvgZBLtJ6GDi7uZY6CUy1H FOCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MeSSeQisOMZr1VtdPoWYea3+nhKVhtFXVS0jLnW5PYM=; b=J51h7Rb2roRLCstY29UCFvUhGjEA52P0kwnPQ+8gNBXZ8OIXL6YA5muhxeL7wjM3fQ 9VQeoq7kfbXxXc8SoU4aeJe5jlT4XJf3Lh0KnnSpL50hvc2a3mQPmxZDBXlh9nESFImC dEv2hYEPlaDo9rxcT4HzRS0TjPxhRSZQNULWA+ysMg9ggkhQW839oaD6zg0EzWis5mS2 Sl4DyEGaLz/vG6KJs+18OZzX3f/YeGyUvqsNViKcbiNJpLl2tx5wm7LrXYA76VDnAQsu GSE1o4PwUXHChWQIEujMCrwRK/wtkMtRne5Uu9dyp1szXOn8SPoDuCr8yg7nAVA9cydy iXOA== X-Gm-Message-State: AOAM531GGtMn9RQQKFc6KmbuWAxLwqA12cvnIpLRaKsDPNfdE/smRRpH 7CBbsdPsvDWh5NI1/FsiOGL5q2FZL/eYcbIA X-Google-Smtp-Source: ABdhPJxthSXt+jz2Q3HLqhY8c3kyVEdmu++TITUImB1iuc305Pxr1Gn51/keTfUi+vciXa0RyvtwlA== X-Received: by 2002:a5d:47ae:: with SMTP id 14mr20271703wrb.378.1612796881599; Mon, 08 Feb 2021 07:08:01 -0800 (PST) Received: from naush-laptop.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id a17sm31261389wrx.63.2021.02.08.07.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 07:07:56 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 8 Feb 2021 15:07:36 +0000 Message-Id: <20210208150738.2293520-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210208150738.2293520-1-naush@raspberrypi.com> References: <20210208150738.2293520-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 4/6] ipa: raspberrypi: Rename SdnStatus to DenoiseStatus 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" This change is in anticipation of the addition of a DenoiseAlgorithm base class which the SDN class will derive from. We want to match the metadata object name with the base class algorithm name. This renames: - SdnStatus metadata object to DenoiseStatus - "sdn.status" metadata string key to "denoise.status" - sdn_status.h header file to denoise_status.h Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- .../controller/{sdn_status.h => denoise_status.h} | 8 ++++---- src/ipa/raspberrypi/controller/rpi/sdn.cpp | 4 ++-- src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/ipa/raspberrypi/controller/{sdn_status.h => denoise_status.h} (50%) diff --git a/src/ipa/raspberrypi/controller/sdn_status.h b/src/ipa/raspberrypi/controller/denoise_status.h similarity index 50% rename from src/ipa/raspberrypi/controller/sdn_status.h rename to src/ipa/raspberrypi/controller/denoise_status.h index 871e0b62af1f..94f5df200ffd 100644 --- a/src/ipa/raspberrypi/controller/sdn_status.h +++ b/src/ipa/raspberrypi/controller/denoise_status.h @@ -1,18 +1,18 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2019, Raspberry Pi (Trading) Limited + * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited * - * sdn_status.h - SDN (spatial denoise) control algorithm status + * denoise_status.h - Denoise control algorithm status */ #pragma once -// This stores the parameters required for Spatial Denoise (SDN). +// This stores the parameters required for Denoise (SDN). #ifdef __cplusplus extern "C" { #endif -struct SdnStatus { +struct DenoiseStatus { double noise_constant; double noise_slope; double strength; diff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp index 0fad25504345..ef84a2dcbf86 100644 --- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp +++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp @@ -7,8 +7,8 @@ #include "libcamera/internal/log.h" +#include "../denoise_status.h" #include "../noise_status.h" -#include "../sdn_status.h" #include "sdn.hpp" @@ -49,7 +49,7 @@ void Sdn::Prepare(Metadata *image_metadata) LOG(RPiSdn, Debug) << "Noise profile: constant " << noise_status.noise_constant << " slope " << noise_status.noise_slope; - struct SdnStatus status; + struct DenoiseStatus status; status.noise_constant = noise_status.noise_constant * deviation_; status.noise_slope = noise_status.noise_slope * deviation_; status.strength = strength_; diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index ff14cfc4b706..e76688a7b323 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -43,13 +43,13 @@ #include "contrast_algorithm.hpp" #include "contrast_status.h" #include "controller.hpp" +#include "denoise_status.h" #include "dpc_status.h" #include "focus_status.h" #include "geq_status.h" #include "lux_status.h" #include "metadata.hpp" #include "noise_status.h" -#include "sdn_status.h" #include "sharpen_algorithm.hpp" #include "sharpen_status.h" @@ -110,7 +110,7 @@ private: void applyBlackLevel(const struct BlackLevelStatus *blackLevelStatus, ControlList &ctrls); void applyGamma(const struct ContrastStatus *contrastStatus, ControlList &ctrls); void applyGEQ(const struct GeqStatus *geqStatus, ControlList &ctrls); - void applyDenoise(const struct SdnStatus *denoiseStatus, ControlList &ctrls); + void applyDenoise(const struct DenoiseStatus *denoiseStatus, ControlList &ctrls); void applySharpen(const struct SharpenStatus *sharpenStatus, ControlList &ctrls); void applyDPC(const struct DpcStatus *dpcStatus, ControlList &ctrls); void applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls); @@ -952,7 +952,7 @@ void IPARPi::prepareISP(unsigned int bufferId) if (geqStatus) applyGEQ(geqStatus, ctrls); - SdnStatus *denoiseStatus = rpiMetadata_.GetLocked("sdn.status"); + DenoiseStatus *denoiseStatus = rpiMetadata_.GetLocked("denoise.status"); if (denoiseStatus) applyDenoise(denoiseStatus, ctrls); @@ -1171,7 +1171,7 @@ void IPARPi::applyGEQ(const struct GeqStatus *geqStatus, ControlList &ctrls) ctrls.set(V4L2_CID_USER_BCM2835_ISP_GEQ, c); } -void IPARPi::applyDenoise(const struct SdnStatus *denoiseStatus, ControlList &ctrls) +void IPARPi::applyDenoise(const struct DenoiseStatus *denoiseStatus, ControlList &ctrls) { bcm2835_isp_denoise denoise;