[vlc-commits] [Git][videolan/vlc][master] 2 commits: chroma: tidy plugin simd variant flags

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jul 22 05:06:39 UTC 2021



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
991a7795 by Lyndon Brown at 2021-07-21T16:19:29+00:00
chroma: tidy plugin simd variant flags

...to use short labels like `PLUGIN_PLAIN` and `PLUGIN_SSE2` rather than
`MODULE_NAME_IS_xxx_yyy[_zzz]`. this makes the code cleaner, easier to read,
and improves consistency. it also helps remove a source of plugin vs.
module confusion.

trying to recognise that something like `MODULE_NAME_IS_i420_yuy2` refers
to the 'plain' variant, compared to `MODULE_NAME_IS_i420_yuy2_sse2` for the
SSE2 variant, was problematic.

the `#else // defined(MODULE_NAME_IS_xxx_yyy_sse2)` instances have been
changed to `#elif defined(PLUGIN_SSE2)` in the i420 plugin.

the flag passed to the nv12 plugin was removed (rather than replaced with
`PLUGIN_PLAIN`) because it is unused.

the i420_rgb plugin used short `SSE2` type defines. these have been changed
to `PLUGIN_SSE2` style for consistency.

- - - - -
19d74319 by Lyndon Brown at 2021-07-21T16:19:29+00:00
vorbix,x264: tidy plugin variant flags

 - makes the code a little more readable.
 - switches to use of "plugin" rather than "module", as is more
   appropriate here.

- - - - -


11 changed files:

- modules/codec/Makefile.am
- modules/codec/vorbis.c
- modules/codec/x264.c
- modules/video_chroma/Makefile.am
- modules/video_chroma/i420_rgb.c
- modules/video_chroma/i420_rgb.h
- modules/video_chroma/i420_rgb16_x86.c
- modules/video_chroma/i420_yuy2.c
- modules/video_chroma/i420_yuy2.h
- modules/video_chroma/i422_yuy2.c
- modules/video_chroma/i422_yuy2.h


Changes:

=====================================
modules/codec/Makefile.am
=====================================
@@ -310,7 +310,7 @@ EXTRA_LTLIBRARIES += libdaala_plugin.la
 codec_LTLIBRARIES += $(LTLIBdaala)
 
 libtremor_plugin_la_SOURCES = codec/vorbis.c
-libtremor_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DMODULE_NAME_IS_tremor
+libtremor_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_TREMOR
 libtremor_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 libtremor_plugin_la_LIBADD = -lvorbisdec -logg
 EXTRA_LTLIBRARIES += libtremor_plugin.la
@@ -480,7 +480,7 @@ EXTRA_LTLIBRARIES += libx265_plugin.la
 codec_LTLIBRARIES += $(LTLIBx265)
 
 libx262_plugin_la_SOURCES = codec/x264.c
-libx262_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DMODULE_NAME_IS_x262
+libx262_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_X262
 libx262_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_x262)
 libx262_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_x262) -rpath '$(codecdir)'
 libx262_plugin_la_LIBADD = $(LIBS_x262) $(LIBM)
@@ -488,7 +488,7 @@ EXTRA_LTLIBRARIES += libx262_plugin.la
 codec_LTLIBRARIES += $(LTLIBx262)
 
 libx264_plugin_la_SOURCES = codec/x264.c
-libx264_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_x264) -DMODULE_NAME_IS_x264
+libx264_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_x264) -DPLUGIN_X264
 libx264_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_x264)
 libx264_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_x264) -rpath '$(codecdir)'
 libx264_plugin_la_LIBADD = $(LIBS_x264) $(LIBM)
@@ -496,7 +496,7 @@ EXTRA_LTLIBRARIES += libx264_plugin.la
 codec_LTLIBRARIES += $(LTLIBx264)
 
 libx26410b_plugin_la_SOURCES = codec/x264.c
-libx26410b_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DMODULE_NAME_IS_x26410b
+libx26410b_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_X264_10B
 libx26410b_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_x26410b)
 libx26410b_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_x26410b) -rpath '$(codecdir)'
 libx26410b_plugin_la_LIBADD = $(LIBS_x26410b) $(LIBM)


=====================================
modules/codec/vorbis.c
=====================================
@@ -41,7 +41,7 @@
 
 #include <ogg/ogg.h>
 
-#ifdef MODULE_NAME_IS_tremor
+#ifdef PLUGIN_TREMOR
 # include <tremor/ivorbiscodec.h>
 # define INTERLEAVE_TYPE int32_t
 
@@ -186,7 +186,7 @@ static block_t *Encode   ( encoder_t *, block_t * );
 vlc_module_begin ()
     set_shortname( "Vorbis" )
     set_description( N_("Vorbis audio decoder") )
-#ifdef MODULE_NAME_IS_tremor
+#ifdef PLUGIN_TREMOR
     set_capability( "audio decoder", 90 )
 #else
     set_capability( "audio decoder", 100 )
@@ -256,7 +256,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
     }
     else
     {
-#ifdef MODULE_NAME_IS_tremor
+#ifdef PLUGIN_TREMOR
         p_dec->fmt_out.i_codec = VLC_CODEC_S32N;
 #else
         p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
@@ -513,7 +513,7 @@ static void Interleave( INTERLEAVE_TYPE *p_out, const INTERLEAVE_TYPE **pp_in,
     for( int j = 0; j < i_samples; j++ )
         for( int i = 0; i < i_nb_channels; i++ )
         {
-#ifdef MODULE_NAME_IS_tremor
+#ifdef PLUGIN_TREMOR
             union { int32_t i; uint32_t u;} spl;
 
             spl.u = ((uint32_t)pp_in[i][j]) << 8;


=====================================
modules/codec/x264.c
=====================================
@@ -40,7 +40,7 @@
 #if defined(PTW32_STATIC_LIB) && defined(HAVE_PTHREAD_H)
 #include <pthread.h>
 #endif
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
 #include <x262.h>
 #else
 #include <x264.h>
@@ -48,13 +48,13 @@
 
 #include <assert.h>
 
-#ifdef MODULE_NAME_IS_x26410b
+#ifdef PLUGIN_X264_10B
 #define SOUT_CFG_PREFIX "sout-x26410b-"
 #endif
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
 #define SOUT_CFG_PREFIX "sout-x262-"
 #endif
-#ifdef MODULE_NAME_IS_x264
+#ifdef PLUGIN_X264
 #define SOUT_CFG_PREFIX "sout-x264-"
 #endif
 
@@ -436,15 +436,15 @@ static const char *const framepacking_list_text[] =
   { N_("Unset"), N_("Checkerboard"), N_("Column alternation"), N_("Row alternation"), N_("Side by side"), N_("Top bottom"), N_("Frame alternation"), N_("2D") };
 
 vlc_module_begin ()
-#ifdef MODULE_NAME_IS_x26410b
+#ifdef PLUGIN_X264_10B
     set_description( N_("H.264/MPEG-4 Part 10/AVC encoder (x264 10-bit)"))
     set_capability( "encoder", 0 )
 #endif
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
     set_description( N_("H.262/MPEG-2 encoder (x262)"))
     set_capability( "encoder", 0 )
 #endif
-#ifdef MODULE_NAME_IS_x264
+#ifdef PLUGIN_X264
     set_description( N_("H.264/MPEG-4 Part 10/AVC encoder (x264)"))
     set_capability( "encoder", 200 )
 #endif
@@ -775,7 +775,7 @@ static int  Open ( vlc_object_t *p_this )
     int i, i_nal;
     bool fullrange = false;
 
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
     if( p_enc->fmt_out.i_codec != VLC_CODEC_MP2V &&
 #else
     if( p_enc->fmt_out.i_codec != VLC_CODEC_H264 &&
@@ -785,7 +785,7 @@ static int  Open ( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
     /* X264_POINTVER or X264_VERSION are not available */
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
     msg_Dbg ( p_enc, "version x262 0.%d.X", X264_BUILD );
 #else
     msg_Dbg ( p_enc, "version x264 0.%d.X", X264_BUILD );
@@ -794,7 +794,7 @@ static int  Open ( vlc_object_t *p_this )
     config_ChainParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
 
     assert(p_enc->fmt_out.i_cat == VIDEO_ES);
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
     p_enc->fmt_out.i_codec = VLC_CODEC_MP2V;
 #else
     p_enc->fmt_out.i_codec = VLC_CODEC_H264;
@@ -806,7 +806,7 @@ static int  Open ( vlc_object_t *p_this )
     fullrange = var_GetBool( p_enc, SOUT_CFG_PREFIX "fullrange" );
     fullrange |= p_enc->fmt_in.video.color_range == COLOR_RANGE_FULL;
     char *psz_profile = var_GetString( p_enc, SOUT_CFG_PREFIX "profile" );
-# ifdef MODULE_NAME_IS_x26410b
+# ifdef PLUGIN_X264_10B
     const int mask = X264_CSP_HIGH_DEPTH;
 # else
     const int mask = 0;
@@ -831,11 +831,11 @@ static int  Open ( vlc_object_t *p_this )
         }
         else
         {
-# ifdef MODULE_NAME_IS_x26410b
+# ifdef PLUGIN_X264_10B
             msg_Err( p_enc, "Only high-profiles and 10-bit are supported");
             free( psz_profile );
             return VLC_EGENERIC;
-# else // !MODULE_NAME_IS_x26410b
+# else
             p_enc->fmt_in.i_codec = fullrange ? VLC_CODEC_J420 : VLC_CODEC_I420;
             p_sys->i_colorspace = X264_CSP_I420;
 # endif
@@ -844,10 +844,10 @@ static int  Open ( vlc_object_t *p_this )
     }
     else
     {
-# ifdef MODULE_NAME_IS_x26410b
+# ifdef PLUGIN_X264_10B
         msg_Err( p_enc, "Only high-profiles and 10-bit are supported");
         return VLC_EGENERIC;
-# else // !MODULE_NAME_IS_x26410b
+# else
         p_enc->fmt_in.i_codec = fullrange ? VLC_CODEC_J420 : VLC_CODEC_I420;
         p_sys->i_colorspace = X264_CSP_I420;
 # endif
@@ -866,7 +866,7 @@ static int  Open ( vlc_object_t *p_this )
         free(psz_preset);
         psz_preset = NULL;
     }
-#ifdef MODULE_NAME_IS_x262
+#ifdef PLUGIN_X262
     p_sys->param.b_mpeg2 = true;
     x264_param_default_mpeg2( &p_sys->param );
     x264_param_default_preset_mpeg2( &p_sys->param, psz_preset, psz_tune );


=====================================
modules/video_chroma/Makefile.am
=====================================
@@ -21,19 +21,16 @@ 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_yuy2_plugin_la_SOURCES = video_chroma/i420_yuy2.c video_chroma/i420_yuy2.h
-libi420_yuy2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-	-DMODULE_NAME_IS_i420_yuy2
+libi420_yuy2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_PLAIN
 
 libi420_nv12_plugin_la_SOURCES = video_chroma/i420_nv12.c
-libi420_nv12_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-	-DMODULE_NAME_IS_i420_nv12
+libi420_nv12_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
 libi420_nv12_plugin_la_LIBADD = libchroma_copy.la
 
 libi422_i420_plugin_la_SOURCES = video_chroma/i422_i420.c
 
 libi422_yuy2_plugin_la_SOURCES = video_chroma/i422_yuy2.c video_chroma/i422_yuy2.h
-libi422_yuy2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-	-DMODULE_NAME_IS_i422_yuy2
+libi422_yuy2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_PLAIN
 
 librv32_plugin_la_SOURCES = video_chroma/rv32.c
 
@@ -61,8 +58,7 @@ EXTRA_LTLIBRARIES += libswscale_plugin.la libchroma_omx_plugin.la
 
 # AltiVec
 libi420_yuy2_altivec_plugin_la_SOURCES = video_chroma/i420_yuy2.c video_chroma/i420_yuy2.h
-libi420_yuy2_altivec_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-	-DMODULE_NAME_IS_i420_yuy2_altivec
+libi420_yuy2_altivec_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_ALTIVEC
 libi420_yuy2_altivec_plugin_la_CFLAGS = $(AM_CFLAGS) $(ALTIVEC_CFLAGS)
 
 if HAVE_ALTIVEC
@@ -73,15 +69,13 @@ endif
 # SSE2
 libi420_rgb_sse2_plugin_la_SOURCES = video_chroma/i420_rgb.c video_chroma/i420_rgb.h \
 	video_chroma/i420_rgb16_x86.c video_chroma/i420_rgb_sse2.h
-libi420_rgb_sse2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DSSE2
+libi420_rgb_sse2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_SSE2
 
 libi420_yuy2_sse2_plugin_la_SOURCES = video_chroma/i420_yuy2.c video_chroma/i420_yuy2.h
-libi420_yuy2_sse2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-	-DMODULE_NAME_IS_i420_yuy2_sse2
+libi420_yuy2_sse2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_SSE2
 
 libi422_yuy2_sse2_plugin_la_SOURCES = video_chroma/i422_yuy2.c video_chroma/i422_yuy2.h
-libi422_yuy2_sse2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-	-DMODULE_NAME_IS_i422_yuy2_sse2
+libi422_yuy2_sse2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_SSE2
 
 if HAVE_SSE2
 chroma_LTLIBRARIES += \


=====================================
modules/video_chroma/i420_rgb.c
=====================================
@@ -36,7 +36,7 @@
 #include <vlc_cpu.h>
 
 #include "i420_rgb.h"
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
 # include "i420_rgb_c.h"
 
 static void SetYUV( filter_t *, const video_format_t * );
@@ -58,7 +58,7 @@ static int  Activate   ( filter_t * );
 static void Deactivate ( filter_t * );
 
 vlc_module_begin ()
-#if defined (SSE2)
+#if defined (PLUGIN_SSE2)
     set_description( N_( "SSE2 I420,IYUV,YV12 to "
                         "RV15,RV16,RV24,RV32 conversions") )
     set_callback_video_converter( Activate, 120 )
@@ -71,7 +71,7 @@ vlc_module_begin ()
 #endif
 vlc_module_end ()
 
-#ifndef PLAIN
+#ifndef PLUGIN_PLAIN
 VIDEO_FILTER_WRAPPER_CLOSE_EXT( I420_R5G5B5, Deactivate )
 VIDEO_FILTER_WRAPPER_CLOSE_EXT( I420_R5G6B5, Deactivate )
 VIDEO_FILTER_WRAPPER_CLOSE_EXT( I420_A8R8G8B8, Deactivate )
@@ -91,7 +91,7 @@ VIDEO_FILTER_WRAPPER_CLOSE_EXT( I420_RGB32, Deactivate )
  *****************************************************************************/
 static int Activate( filter_t *p_filter )
 {
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
     size_t i_tables_size;
 #endif
 
@@ -114,7 +114,7 @@ static int Activate( filter_t *p_filter )
         case VLC_CODEC_I420:
             switch( p_filter->fmt_out.video.i_chroma )
             {
-#ifndef PLAIN
+#ifndef PLUGIN_PLAIN
                 case VLC_CODEC_RGB15:
                 case VLC_CODEC_RGB16:
                     /* If we don't have support for the bitmasks, bail out */
@@ -204,7 +204,7 @@ static int Activate( filter_t *p_filter )
     p_sys->p_buffer = NULL;
     switch( p_filter->fmt_out.video.i_chroma )
     {
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
         case VLC_CODEC_RGB8:
             p_sys->i_bytespp = 1;
             break;
@@ -232,7 +232,7 @@ static int Activate( filter_t *p_filter )
         return VLC_EGENERIC;
     }
 
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
     switch( p_filter->fmt_out.video.i_chroma )
     {
     case VLC_CODEC_RGB8:
@@ -277,7 +277,7 @@ static void Deactivate( filter_t *p_filter )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
 
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
     free( p_sys->p_base );
 #endif
     free( p_sys->p_offset );
@@ -285,7 +285,7 @@ static void Deactivate( filter_t *p_filter )
     free( p_sys );
 }
 
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
 /*****************************************************************************
  * SetYUV: compute tables and set function pointers
  *****************************************************************************/


=====================================
modules/video_chroma/i420_rgb.h
=====================================
@@ -21,8 +21,8 @@
  *****************************************************************************/
 #include <limits.h>
 
-#if !defined (SSE2)
-# define PLAIN
+#if !defined (PLUGIN_SSE2)
+# define PLUGIN_PLAIN
 #endif
 
 /** Number of entries in RGB palette/colormap */
@@ -41,7 +41,7 @@ typedef struct
     uint8_t   i_bytespp;
     int *p_offset;
 
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
     /**< Pre-calculated conversion tables */
     void *p_base;                      /**< base for all conversion tables */
     uint8_t   *p_rgb8;                 /**< RGB 8 bits table */
@@ -80,7 +80,7 @@ static inline int AllocateOrGrow( uint8_t **pp_buffer, size_t *pi_buffer,
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-#ifdef PLAIN
+#ifdef PLUGIN_PLAIN
 void I420_RGB8         ( filter_t *, picture_t *, picture_t * );
 void I420_RGB16        ( filter_t *, picture_t *, picture_t * );
 void I420_RGB32        ( filter_t *, picture_t *, picture_t * );


=====================================
modules/video_chroma/i420_rgb16_x86.c
=====================================
@@ -31,7 +31,7 @@
 #include <vlc_cpu.h>
 
 #include "i420_rgb.h"
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 # include "i420_rgb_sse2.h"
 # define VLC_TARGET VLC_SSE
 #endif
@@ -158,7 +158,7 @@ void I420_R5G5B5( filter_t *p_filter, picture_t *p_src, picture_t *p_dest )
                     (p_filter->fmt_out.video.i_y_offset + p_filter->fmt_out.video.i_visible_height) :
                     (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height);
 
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 
     i_rewind = (-(p_filter->fmt_in.video.i_x_offset + p_filter->fmt_in.video.i_visible_width)) & 15;
 
@@ -342,7 +342,7 @@ void I420_R5G6B5( filter_t *p_filter, picture_t *p_src, picture_t *p_dest )
                     (p_filter->fmt_out.video.i_y_offset + p_filter->fmt_out.video.i_visible_height) :
                     (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height);
 
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 
     i_rewind = (-(p_filter->fmt_in.video.i_x_offset + p_filter->fmt_in.video.i_visible_width)) & 15;
 
@@ -526,7 +526,7 @@ void I420_A8R8G8B8( filter_t *p_filter, picture_t *p_src,
                     (p_filter->fmt_out.video.i_y_offset + p_filter->fmt_out.video.i_visible_height) :
                     (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height);
 
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 
     i_rewind = (-(p_filter->fmt_in.video.i_x_offset + p_filter->fmt_in.video.i_visible_width)) & 15;
 
@@ -709,7 +709,7 @@ void I420_R8G8B8A8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest )
                     (p_filter->fmt_out.video.i_y_offset + p_filter->fmt_out.video.i_visible_height) :
                     (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height);
 
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 
     i_rewind = (-(p_filter->fmt_in.video.i_x_offset + p_filter->fmt_in.video.i_visible_width)) & 15;
 
@@ -892,7 +892,7 @@ void I420_B8G8R8A8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest )
                     (p_filter->fmt_out.video.i_y_offset + p_filter->fmt_out.video.i_visible_height) :
                     (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height);
 
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 
     i_rewind = (-(p_filter->fmt_in.video.i_x_offset + p_filter->fmt_in.video.i_visible_width)) & 15;
 
@@ -1075,7 +1075,7 @@ void I420_A8B8G8R8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest )
                     (p_filter->fmt_out.video.i_y_offset + p_filter->fmt_out.video.i_visible_height) :
                     (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height);
 
-#ifdef SSE2
+#ifdef PLUGIN_SSE2
 
     i_rewind = (-(p_filter->fmt_in.video.i_x_offset + p_filter->fmt_in.video.i_visible_width)) & 15;
 


=====================================
modules/video_chroma/i420_yuy2.c
=====================================
@@ -35,7 +35,7 @@
 #include <vlc_picture.h>
 #include <vlc_cpu.h>
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec) && defined(HAVE_ALTIVEC_H)
+#if defined (PLUGIN_ALTIVEC) && defined(HAVE_ALTIVEC_H)
 #   include <altivec.h>
 #endif
 
@@ -43,13 +43,13 @@
 
 #define SRC_FOURCC  "I420,IYUV,YV12"
 
-#if defined (MODULE_NAME_IS_i420_yuy2)
+#if defined (PLUGIN_PLAIN)
 #    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,Y211"
 #    define VLC_TARGET
-#elif defined (MODULE_NAME_IS_i420_yuy2_sse2)
+#elif defined (PLUGIN_SSE2)
 #    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV"
 #    define VLC_TARGET VLC_SSE
-#elif defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#elif defined (PLUGIN_ALTIVEC)
 #    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422"
 #    define VLC_TARGET
 #endif
@@ -63,15 +63,15 @@ static int  Activate ( filter_t * );
  * Module descriptor.
  *****************************************************************************/
 vlc_module_begin ()
-#if defined (MODULE_NAME_IS_i420_yuy2)
+#if defined (PLUGIN_PLAIN)
     set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) )
     set_callback_video_converter( Activate, 80 )
 # define vlc_CPU_capable() (true)
-#elif defined (MODULE_NAME_IS_i420_yuy2_sse2)
+#elif defined (PLUGIN_SSE2)
     set_description( N_("SSE2 conversions from " SRC_FOURCC " to " DEST_FOURCC) )
     set_callback_video_converter( Activate, 250 )
 # define vlc_CPU_capable() vlc_CPU_SSE2()
-#elif defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#elif defined (PLUGIN_ALTIVEC)
     set_description( N_("AltiVec conversions from " SRC_FOURCC " to " DEST_FOURCC) );
     set_callback_video_converter( Activate, 250 )
 # define vlc_CPU_capable() vlc_CPU_ALTIVEC()
@@ -81,10 +81,10 @@ vlc_module_end ()
 VIDEO_FILTER_WRAPPER( I420_YUY2 )
 VIDEO_FILTER_WRAPPER( I420_YVYU )
 VIDEO_FILTER_WRAPPER( I420_UYVY )
-#if !defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if !defined (PLUGIN_ALTIVEC)
 VIDEO_FILTER_WRAPPER( I420_IUYV )
 #endif
-#if defined (MODULE_NAME_IS_i420_yuy2)
+#if defined (PLUGIN_PLAIN)
 VIDEO_FILTER_WRAPPER( I420_Y211 )
 #endif
 
@@ -102,12 +102,12 @@ GetFilterOperations( filter_t *p_filter )
         case VLC_CODEC_UYVY:
             return &I420_UYVY_ops;
 
-#if !defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if !defined (PLUGIN_ALTIVEC)
         case VLC_FOURCC('I','U','Y','V'):
             return &I420_IUYV_ops;
 #endif
 
-#if defined (MODULE_NAME_IS_i420_yuy2)
+#if defined (PLUGIN_PLAIN)
         case VLC_CODEC_Y211:
             return &I420_Y211_ops;
 #endif
@@ -175,7 +175,7 @@ static void I420_YUY2( filter_t *p_filter, picture_t *p_source,
 
     int i_x, i_y;
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if defined (PLUGIN_ALTIVEC)
 #define VEC_NEXT_LINES( ) \
     p_line1  = p_line2; \
     p_line2 += p_dest->p->i_pitch; \
@@ -268,7 +268,7 @@ static void I420_YUY2( filter_t *p_filter, picture_t *p_source,
                                - p_dest->p->i_visible_pitch
                                - ( p_filter->fmt_out.video.i_x_offset * 2 );
 
-#if !defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#if !defined(PLUGIN_SSE2)
     for( i_y = (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height) / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -295,11 +295,11 @@ static void I420_YUY2( filter_t *p_filter, picture_t *p_source,
         p_line2 += i_dest_margin;
     }
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if defined (PLUGIN_ALTIVEC)
     }
 #endif
 
-#else // defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#elif defined(PLUGIN_SSE2)
     /*
     ** SSE2 128 bits fetch/store instructions are faster
     ** if memory access is 16 bytes aligned
@@ -361,7 +361,7 @@ static void I420_YUY2( filter_t *p_filter, picture_t *p_source,
     /* make sure all SSE2 stores are visible thereafter */
     SSE2_END;
 
-#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#endif // defined(PLUGIN_SSE2)
 }
 
 /*****************************************************************************
@@ -378,7 +378,7 @@ static void I420_YVYU( filter_t *p_filter, picture_t *p_source,
 
     int i_x, i_y;
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if defined (PLUGIN_ALTIVEC)
 #define VEC_NEXT_LINES( ) \
     p_line1  = p_line2; \
     p_line2 += p_dest->p->i_pitch; \
@@ -468,7 +468,7 @@ static void I420_YVYU( filter_t *p_filter, picture_t *p_source,
                                - p_dest->p->i_visible_pitch
                                - ( p_filter->fmt_out.video.i_x_offset * 2 );
 
-#if !defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#if !defined(PLUGIN_SSE2)
     for( i_y = (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height) / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -495,11 +495,11 @@ static void I420_YVYU( filter_t *p_filter, picture_t *p_source,
         p_line2 += i_dest_margin;
     }
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if defined (PLUGIN_ALTIVEC)
     }
 #endif
 
-#else // defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#elif defined(PLUGIN_SSE2)
     /*
     ** SSE2 128 bits fetch/store instructions are faster
     ** if memory access is 16 bytes aligned
@@ -559,7 +559,7 @@ static void I420_YVYU( filter_t *p_filter, picture_t *p_source,
     }
     /* make sure all SSE2 stores are visible thereafter */
     SSE2_END;
-#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#endif // defined(PLUGIN_SSE2)
 }
 
 /*****************************************************************************
@@ -576,7 +576,7 @@ static void I420_UYVY( filter_t *p_filter, picture_t *p_source,
 
     int i_x, i_y;
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if defined (PLUGIN_ALTIVEC)
 #define VEC_NEXT_LINES( ) \
     p_line1  = p_line2; \
     p_line2 += p_dest->p->i_pitch; \
@@ -666,7 +666,7 @@ static void I420_UYVY( filter_t *p_filter, picture_t *p_source,
                                - p_dest->p->i_visible_pitch
                                - ( p_filter->fmt_out.video.i_x_offset * 2 );
 
-#if !defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#if !defined(PLUGIN_SSE2)
     for( i_y = (p_filter->fmt_in.video.i_y_offset + p_filter->fmt_in.video.i_visible_height) / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -693,11 +693,11 @@ static void I420_UYVY( filter_t *p_filter, picture_t *p_source,
         p_line2 += i_dest_margin;
     }
 
-#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if defined (PLUGIN_ALTIVEC)
     }
 #endif
 
-#else // defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#elif defined(PLUGIN_SSE2)
     /*
     ** SSE2 128 bits fetch/store instructions are faster
     ** if memory access is 16 bytes aligned
@@ -757,10 +757,10 @@ static void I420_UYVY( filter_t *p_filter, picture_t *p_source,
     }
     /* make sure all SSE2 stores are visible thereafter */
     SSE2_END;
-#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
+#endif // defined(PLUGIN_SSE2)
 }
 
-#if !defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#if !defined (PLUGIN_ALTIVEC)
 /*****************************************************************************
  * I420_IUYV: planar YUV 4:2:0 to interleaved packed UYVY 4:2:2
  *****************************************************************************/
@@ -771,12 +771,12 @@ static void I420_IUYV( filter_t *p_filter, picture_t *p_source,
     /* FIXME: TODO ! */
     msg_Err( p_filter, "I420_IUYV unimplemented, please harass <sam at zoy.org>" );
 }
-#endif // !defined (MODULE_NAME_IS_i420_yuy2_altivec)
+#endif // !defined (PLUGIN_ALTIVEC)
 
 /*****************************************************************************
  * I420_Y211: planar YUV 4:2:0 to packed YUYV 2:1:1
  *****************************************************************************/
-#if defined (MODULE_NAME_IS_i420_yuy2)
+#if defined (PLUGIN_PLAIN)
 static void I420_Y211( filter_t *p_filter, picture_t *p_source,
                                            picture_t *p_dest )
 {


=====================================
modules/video_chroma/i420_yuy2.h
=====================================
@@ -21,7 +21,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#if defined( MODULE_NAME_IS_i420_yuy2_sse2 )
+#if defined( PLUGIN_SSE2 )
 
 #if defined(CAN_COMPILE_SSE2)
 


=====================================
modules/video_chroma/i422_yuy2.c
=====================================
@@ -38,7 +38,7 @@
 #include "i422_yuy2.h"
 
 #define SRC_FOURCC  "I422"
-#if defined (MODULE_NAME_IS_i422_yuy2)
+#if defined (PLUGIN_PLAIN)
 #    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,Y211"
 #else
 #    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV"
@@ -53,12 +53,12 @@ static int  Activate ( filter_t * );
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin ()
-#if defined (MODULE_NAME_IS_i422_yuy2)
+#if defined (PLUGIN_PLAIN)
     set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) )
     set_callback_video_converter( Activate, 80 )
 # define vlc_CPU_capable() (true)
 # define VLC_TARGET
-#elif defined (MODULE_NAME_IS_i422_yuy2_sse2)
+#elif defined (PLUGIN_SSE2)
     set_description( N_("SSE2 conversions from " SRC_FOURCC " to " DEST_FOURCC) )
     set_callback_video_converter( Activate, 120 )
 # define vlc_CPU_capable() vlc_CPU_SSE2()
@@ -71,7 +71,7 @@ VIDEO_FILTER_WRAPPER( I422_YUY2 )
 VIDEO_FILTER_WRAPPER( I422_YVYU )
 VIDEO_FILTER_WRAPPER( I422_UYVY )
 VIDEO_FILTER_WRAPPER( I422_IUYV )
-#if defined (MODULE_NAME_IS_i422_yuy2)
+#if defined (PLUGIN_PLAIN)
 VIDEO_FILTER_WRAPPER( I422_Y211 )
 #endif
 
@@ -93,7 +93,7 @@ GetFilterOperations(filter_t *filter)
         case VLC_FOURCC('I','U','Y','V'):
             return &I422_IUYV_ops;
 
-#if defined (MODULE_NAME_IS_i422_yuy2)
+#if defined (PLUGIN_PLAIN)
         case VLC_CODEC_Y211:
             return &I422_Y211_ops;
 #endif
@@ -162,7 +162,7 @@ static void I422_YUY2( filter_t *p_filter, picture_t *p_source,
                                - p_dest->p->i_visible_pitch
                                - ( p_filter->fmt_out.video.i_x_offset * 2 );
 
-#if defined (MODULE_NAME_IS_i422_yuy2_sse2)
+#if defined (PLUGIN_SSE2)
 
     if( 0 == (15 & (p_source->p[Y_PLANE].i_pitch|p_dest->p->i_pitch|
         ((intptr_t)p_line|(intptr_t)p_y))) )
@@ -252,7 +252,7 @@ static void I422_YVYU( filter_t *p_filter, picture_t *p_source,
                                - p_dest->p->i_visible_pitch
                                - ( p_filter->fmt_out.video.i_x_offset * 2 );
 
-#if defined (MODULE_NAME_IS_i422_yuy2_sse2)
+#if defined (PLUGIN_SSE2)
 
     if( 0 == (15 & (p_source->p[Y_PLANE].i_pitch|p_dest->p->i_pitch|
         ((intptr_t)p_line|(intptr_t)p_y))) )
@@ -342,7 +342,7 @@ static void I422_UYVY( filter_t *p_filter, picture_t *p_source,
                                - p_dest->p->i_visible_pitch
                                - ( p_filter->fmt_out.video.i_x_offset * 2 );
 
-#if defined (MODULE_NAME_IS_i422_yuy2_sse2)
+#if defined (PLUGIN_SSE2)
 
     if( 0 == (15 & (p_source->p[Y_PLANE].i_pitch|p_dest->p->i_pitch|
         ((intptr_t)p_line|(intptr_t)p_y))) )
@@ -422,7 +422,7 @@ static void I422_IUYV( filter_t *p_filter, picture_t *p_source,
 /*****************************************************************************
  * I422_Y211: planar YUV 4:2:2 to packed YUYV 2:1:1
  *****************************************************************************/
-#if defined (MODULE_NAME_IS_i422_yuy2)
+#if defined (PLUGIN_PLAIN)
 static void I422_Y211( filter_t *p_filter, picture_t *p_source,
                                            picture_t *p_dest )
 {


=====================================
modules/video_chroma/i422_yuy2.h
=====================================
@@ -21,7 +21,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#if defined( MODULE_NAME_IS_i422_yuy2_sse2 )
+#if defined( PLUGIN_SSE2 )
 
 #if defined(CAN_COMPILE_SSE2)
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/923b582e8f10de38f285be54e92672ca8c1c1c0a...19d74319bb683af5ffe7b07894509ada36c148b1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/923b582e8f10de38f285be54e92672ca8c1c1c0a...19d74319bb683af5ffe7b07894509ada36c148b1
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list