From 44ea5b65c8b76c3596b80d6e72b1f28b52006f21 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 8 Feb 2021 15:07:36 +0000 Subject: ipa: raspberrypi: Rename SdnStatus to DenoiseStatus 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 Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/denoise_status.h | 23 +++++++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/sdn.cpp | 6 +++--- src/ipa/raspberrypi/controller/sdn_status.h | 23 ----------------------- src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++---- 4 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 src/ipa/raspberrypi/controller/denoise_status.h delete mode 100644 src/ipa/raspberrypi/controller/sdn_status.h diff --git a/src/ipa/raspberrypi/controller/denoise_status.h b/src/ipa/raspberrypi/controller/denoise_status.h new file mode 100644 index 00000000..4412d615 --- /dev/null +++ b/src/ipa/raspberrypi/controller/denoise_status.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ +/* + * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited + * + * denoise_status.h - Denoise control algorithm status + */ +#pragma once + +// This stores the parameters required for Denoise. + +#ifdef __cplusplus +extern "C" { +#endif + +struct DenoiseStatus { + double noise_constant; + double noise_slope; + double strength; +}; + +#ifdef __cplusplus +} +#endif diff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp index 0fad2550..825f421f 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,11 +49,11 @@ 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_; - image_metadata->Set("sdn.status", status); + image_metadata->Set("denoise.status", status); LOG(RPiSdn, Debug) << "programmed constant " << status.noise_constant << " slope " << status.noise_slope diff --git a/src/ipa/raspberrypi/controller/sdn_status.h b/src/ipa/raspberrypi/controller/sdn_status.h deleted file mode 100644 index 871e0b62..00000000 --- a/src/ipa/raspberrypi/controller/sdn_status.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: BSD-2-Clause */ -/* - * Copyright (C) 2019, Raspberry Pi (Trading) Limited - * - * sdn_status.h - SDN (spatial denoise) control algorithm status - */ -#pragma once - -// This stores the parameters required for Spatial Denoise (SDN). - -#ifdef __cplusplus -extern "C" { -#endif - -struct SdnStatus { - double noise_constant; - double noise_slope; - double strength; -}; - -#ifdef __cplusplus -} -#endif diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index ff14cfc4..e76688a7 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; -- cgit v1.2.1