[vlc-commits] Limit sigma range in gaussian blur

Kaarlo Räihä git at videolan.org
Wed Oct 21 18:55:46 CEST 2015


vlc/vlc-2.2 | branch: master | Kaarlo Räihä <kaarlo.raiha at gmail.com> | Sat Aug 22 13:57:48 2015 +0300| [51a401399abda225070b723f5e32ebc5c70b70c8] | committer: Jean-Baptiste Kempf

Limit sigma range in gaussian blur

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit a0dbb73f7678c697803741516c091dc843e5a67e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=51a401399abda225070b723f5e32ebc5c70b70c8
---

 modules/video_filter/gaussianblur.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/video_filter/gaussianblur.c b/modules/video_filter/gaussianblur.c
index 3365ff6..5c85bba 100644
--- a/modules/video_filter/gaussianblur.c
+++ b/modules/video_filter/gaussianblur.c
@@ -44,6 +44,9 @@
 static int  Create    ( vlc_object_t * );
 static void Destroy   ( vlc_object_t * );
 
+#define SIGMA_MIN (0.01)
+#define SIGMA_MAX (4096.0)
+
 #define SIGMA_TEXT N_("Gaussian's std deviation")
 #define SIGMA_LONGTEXT N_( \
     "Gaussian's standard deviation. The blurring will take " \
@@ -61,8 +64,9 @@ vlc_module_begin ()
     set_category( CAT_VIDEO )
     set_subcategory( SUBCAT_VIDEO_VFILTER )
 
-    add_float( FILTER_PREFIX "sigma", 2., SIGMA_TEXT, SIGMA_LONGTEXT,
-               false )
+    add_float_with_range( FILTER_PREFIX "sigma", 2., SIGMA_MIN, SIGMA_MAX,
+                          SIGMA_TEXT, SIGMA_LONGTEXT,
+                          false )
 
     set_callbacks( Create, Destroy )
 vlc_module_end ()
@@ -159,7 +163,7 @@ static int Create( vlc_object_t *p_this )
         var_CreateGetFloat( p_filter, FILTER_PREFIX "sigma" );
     if( p_filter->p_sys->f_sigma <= 0. )
     {
-        msg_Err( p_filter, "sigma must be positive" );
+        msg_Err( p_filter, "sigma must be greater than zero" );
         return VLC_EGENERIC;
     }
     gaussianblur_InitDistribution( p_filter->p_sys );



More information about the vlc-commits mailing list