[vlc-commits] i420_rgb: expand constant parameter

Rémi Denis-Courmont git at videolan.org
Mon Dec 17 18:46:02 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 17 17:32:44 2018 +0200| [de5e7b5f1e13914dc9e42f329fe06d6e670d1ff8] | committer: Rémi Denis-Courmont

i420_rgb: expand constant parameter

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

 modules/video_chroma/Makefile.am |  1 -
 modules/video_chroma/i420_rgb.c  | 12 +++---------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/modules/video_chroma/Makefile.am b/modules/video_chroma/Makefile.am
index 96a2299eeb..30974e589e 100644
--- a/modules/video_chroma/Makefile.am
+++ b/modules/video_chroma/Makefile.am
@@ -19,7 +19,6 @@ libgrey_yuv_plugin_la_SOURCES = video_chroma/grey_yuv.c
 
 libi420_rgb_plugin_la_SOURCES = video_chroma/i420_rgb.c video_chroma/i420_rgb.h \
 	video_chroma/i420_rgb8.c video_chroma/i420_rgb16.c video_chroma/i420_rgb_c.h
-libi420_rgb_plugin_la_LIBADD = $(LIBM)
 
 libi420_yuy2_plugin_la_SOURCES = video_chroma/i420_yuy2.c video_chroma/i420_yuy2.h
 libi420_yuy2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
diff --git a/modules/video_chroma/i420_rgb.c b/modules/video_chroma/i420_rgb.c
index b7752a7122..2c81a64424 100644
--- a/modules/video_chroma/i420_rgb.c
+++ b/modules/video_chroma/i420_rgb.c
@@ -30,8 +30,6 @@
 # include "config.h"
 #endif
 
-#include <math.h>                                            /* exp(), pow() */
-
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_filter.h>
@@ -45,7 +43,6 @@ static picture_t *I420_RGB8_Filter( filter_t *, picture_t * );
 static picture_t *I420_RGB16_Filter( filter_t *, picture_t * );
 static picture_t *I420_RGB32_Filter( filter_t *, picture_t * );
 
-static void SetGammaTable( int *pi_table, double f_gamma );
 static void SetYUV( filter_t *, const video_format_t * );
 static void Set8bppPalette( filter_t *, uint8_t * );
 #else
@@ -314,17 +311,14 @@ VIDEO_FILTER_WRAPPER( I420_RGB32 )
  *****************************************************************************
  * pi_table is a table of 256 entries from 0 to 255.
  *****************************************************************************/
-static void SetGammaTable( int *pi_table, double f_gamma )
+static void SetGammaTable( int *pi_table )
 {
     int i_y;                                               /* base intensity */
 
-    /* Use exp(gamma) instead of gamma */
-    f_gamma = exp( f_gamma );
-
     /* Build gamma table */
     for( i_y = 0; i_y < 256; i_y++ )
     {
-        pi_table[ i_y ] = (int)( pow( (double)i_y / 256, f_gamma ) * 256 );
+        pi_table[ i_y ] = i_y;
     }
 }
 
@@ -341,7 +335,7 @@ static void SetYUV( filter_t *p_filter, const video_format_t *vfmt )
     filter_sys_t *p_sys = p_filter->p_sys;
 
     /* Build gamma table */
-    SetGammaTable( pi_gamma, 0 ); //p_filter/*FIXME wasn't used anywhere anyway*/->f_gamma );
+    SetGammaTable( pi_gamma );
 
     /*
      * Set pointers and build YUV tables



More information about the vlc-commits mailing list