[libcamera-devel] [PATCH 2/3] ipa: raspberrypi: Clean up NoiseReductionMode values

Paul Elder paul.elder at ideasonboard.com
Mon Sep 13 12:20:06 CEST 2021


Remove the NoiseReductionMode values that the raspberrypi IPA does not
support. The ControlInfo values that the IPA reports will be used for
capability detection, so values that it does not support shall be
removed.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 include/libcamera/ipa/raspberrypi.h | 8 +++++++-
 src/ipa/raspberrypi/raspberrypi.cpp | 2 --
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h
index e0dc6f5e..6e97ef53 100644
--- a/include/libcamera/ipa/raspberrypi.h
+++ b/include/libcamera/ipa/raspberrypi.h
@@ -18,6 +18,12 @@ namespace libcamera {
 
 namespace RPi {
 
+const std::array<const ControlValue, 3> RPiNoiseReductionModeValues = {
+	static_cast<int32_t>(controls::NoiseReductionModeOff),
+	static_cast<int32_t>(controls::NoiseReductionModeFast),
+	static_cast<int32_t>(controls::NoiseReductionModeHighQuality),
+};
+
 /*
  * List of controls handled by the Raspberry Pi IPA
  *
@@ -45,7 +51,7 @@ static const ControlInfoMap Controls({
 		{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
 		{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
 		{ &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
-		{ &controls::NoiseReductionMode, ControlInfo(controls::NoiseReductionModeValues) }
+		{ &controls::NoiseReductionMode, ControlInfo(RPiNoiseReductionModeValues) }
 	}, controls::controls);
 
 } /* namespace RPi */
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index 8d44ab0a..daef1c2d 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -608,8 +608,6 @@ static const std::map<int32_t, RPiController::DenoiseMode> DenoiseModeTable = {
 	{ controls::NoiseReductionModeOff, RPiController::DenoiseMode::Off },
 	{ controls::NoiseReductionModeFast, RPiController::DenoiseMode::ColourFast },
 	{ controls::NoiseReductionModeHighQuality, RPiController::DenoiseMode::ColourHighQuality },
-	{ controls::NoiseReductionModeMinimal, RPiController::DenoiseMode::ColourOff },
-	{ controls::NoiseReductionModeZSL, RPiController::DenoiseMode::ColourHighQuality },
 };
 
 void IPARPi::queueRequest(const ControlList &controls)
-- 
2.27.0



More information about the libcamera-devel mailing list