[libcamera-devel] [PATCH v2 2/4] libcamera: ipa: raspberrypi: make sharpening mode_factor an ordinary double

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Jun 23 00:47:14 CEST 2020


Hi David,

Thank you for the patch.

On Mon, Jun 22, 2020 at 02:55:48PM +0100, David Plowman wrote:
> No need for it to be std::atomic as SwitchMode runs synchronously with
> Prepare.
> 
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  src/ipa/raspberrypi/controller/rpi/sharpen.cpp | 7 +++----
>  src/ipa/raspberrypi/controller/rpi/sharpen.hpp | 2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp
> index 086952f..4c2fdb3 100644
> --- a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp
> +++ b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp
> @@ -44,13 +44,12 @@ void Sharpen::Read(boost::property_tree::ptree const &params)
>  
>  void Sharpen::Prepare(Metadata *image_metadata)
>  {
> -	double mode_factor = mode_factor_;
>  	struct SharpenStatus status;
>  	// Binned modes seem to need the sharpening toned down with this
>  	// pipeline.
> -	status.threshold = threshold_ * mode_factor;
> -	status.strength = strength_ / mode_factor;
> -	status.limit = limit_ / mode_factor;
> +	status.threshold = threshold_ * mode_factor_;
> +	status.strength = strength_ / mode_factor_;
> +	status.limit = limit_ / mode_factor_;
>  	image_metadata->Set("sharpen.status", status);
>  }
>  
> diff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.hpp b/src/ipa/raspberrypi/controller/rpi/sharpen.hpp
> index f871aa6..a3bf899 100644
> --- a/src/ipa/raspberrypi/controller/rpi/sharpen.hpp
> +++ b/src/ipa/raspberrypi/controller/rpi/sharpen.hpp
> @@ -26,7 +26,7 @@ private:
>  	double threshold_;
>  	double strength_;
>  	double limit_;
> -	std::atomic<double> mode_factor_;
> +	double mode_factor_;
>  };
>  
>  } // namespace RPi

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list