[vlc-commits] sharpen: add data type to SHARPEN_FRAME macro's parameters

Victorien Le Couviour--Tuffet git at videolan.org
Wed Apr 12 10:35:48 CEST 2017


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Tue Apr 11 23:39:19 2017 +0200| [89ebac6f4b0e99f44ddf206b99b256e3cc95ccfd] | committer: Jean-Baptiste Kempf

sharpen: add data type to SHARPEN_FRAME macro's parameters

this allows to remove the typedef and brackets from where it's called

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=89ebac6f4b0e99f44ddf206b99b256e3cc95ccfd
---

 modules/video_filter/sharpen.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/modules/video_filter/sharpen.c b/modules/video_filter/sharpen.c
index 65268cc6a4..c6fe3586f1 100644
--- a/modules/video_filter/sharpen.c
+++ b/modules/video_filter/sharpen.c
@@ -157,7 +157,7 @@ static void Destroy( vlc_object_t *p_this )
 
 #define IS_YUV_420_10BITS(fmt) (fmt == VLC_CODEC_I420_10L || fmt == VLC_CODEC_I420_10B)
 
-#define SHARPEN_FRAME(maxval)                                           \
+#define SHARPEN_FRAME(maxval, data_t)                                   \
     do                                                                  \
     {                                                                   \
         data_t *restrict p_src = (data_t *)p_pic->p[Y_PLANE].p_pixels;  \
@@ -210,17 +210,9 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     }
 
     if (!IS_YUV_420_10BITS(p_pic->format.i_chroma))
-    {
-        typedef uint8_t data_t;
-
-        SHARPEN_FRAME(255);
-    }
+        SHARPEN_FRAME(255, uint8_t);
     else
-    {
-        typedef uint16_t data_t;
-
-        SHARPEN_FRAME(1023);
-    }
+        SHARPEN_FRAME(1023, uint16_t);
 
     plane_CopyPixels( &p_outpic->p[U_PLANE], &p_pic->p[U_PLANE] );
     plane_CopyPixels( &p_outpic->p[V_PLANE], &p_pic->p[V_PLANE] );



More information about the vlc-commits mailing list