[vlc-commits] [Git][videolan/vlc][master] swscale: purge obsolete SIMD selection

François Cartegnie (@fcartegnie) gitlab at videolan.org
Thu Jul 22 07:11:47 UTC 2021



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
358fe9c6 by Lyndon Brown at 2021-07-22T06:59:35+00:00
swscale: purge obsolete SIMD selection

the swscale cpu feature flags were deprecated in 2012 and removed in 2015
([1]) in favour of auto-detection, hence the version guard used within the
`GetSwsCpuMask()` function.

in vlc v4.0-dev we are purging MMX/MMXEXT and so have a need to remove the
corresponding portions of the function. this alone though would leave the
function and related code only catering to enabling altivec in the one
special case of compiling with an old swscale version. i felt that it was
probably better to just rip it all out.

[1]: https://github.com/FFmpeg/FFmpeg/commit/9d58639e270f7612874681e0ca30fa461e2667b7

- - - - -


1 changed file:

- modules/video_chroma/swscale.c


Changes:

=====================================
modules/video_chroma/swscale.c
=====================================
@@ -85,7 +85,7 @@ vlc_module_end ()
 typedef struct
 {
     SwsFilter *p_filter;
-    int i_cpu_mask, i_sws_flags;
+    int i_sws_flags;
 
     video_format_t fmt_in;
     video_format_t fmt_out;
@@ -126,8 +126,6 @@ static int GetParameters( ScalerConfiguration *,
                           const video_format_t *p_fmto,
                           int i_sws_flags_default );
 
-static int GetSwsCpuMask(void);
-
 /* SwScaler point resize quality seems really bad, let our scale module do it
  * (change it to true to try) */
 #define ALLOW_YUVP (false)
@@ -211,9 +209,6 @@ static int OpenScaler( filter_t *p_filter )
     if( ( p_filter->p_sys = p_sys = calloc(1, sizeof(filter_sys_t)) ) == NULL )
         return VLC_ENOMEM;
 
-    /* Set CPU capabilities */
-    p_sys->i_cpu_mask = GetSwsCpuMask();
-
     /* */
     i_sws_mode = var_CreateGetInteger( p_filter, "swscale-mode" );
     switch( i_sws_mode )
@@ -275,25 +270,6 @@ static void CloseScaler( filter_t *p_filter )
 /*****************************************************************************
  * Helpers
  *****************************************************************************/
-static int GetSwsCpuMask(void)
-{
-    int i_sws_cpu = 0;
-
-#if LIBSWSCALE_VERSION_MAJOR < 4
-#if defined(__i386__) || defined(__x86_64__)
-    if( vlc_CPU_MMX() )
-        i_sws_cpu |= SWS_CPU_CAPS_MMX;
-    if( vlc_CPU_MMXEXT() )
-        i_sws_cpu |= SWS_CPU_CAPS_MMX2;
-#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
-    if( vlc_CPU_ALTIVEC() )
-        i_sws_cpu |= SWS_CPU_CAPS_ALTIVEC;
-#endif
-#endif
-
-    return i_sws_cpu;
-}
-
 static void FixParameters( enum AVPixelFormat *pi_fmt, bool *pb_has_a, bool *pb_swap_uv, vlc_fourcc_t fmt )
 {
     switch( fmt )
@@ -455,7 +431,7 @@ static int Init( filter_t *p_filter )
 
         ctx = sws_getContext( i_fmti_visible_width, p_fmti->i_visible_height, i_fmti,
                               i_fmto_visible_width, p_fmto->i_visible_height, i_fmto,
-                              cfg.i_sws_flags | p_sys->i_cpu_mask,
+                              cfg.i_sws_flags,
                               p_sys->p_filter, NULL, 0 );
         if( n == 0 )
             p_sys->ctx = ctx;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/358fe9c6c78e587df4331179e4af66c5ade31f0e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/358fe9c6c78e587df4331179e4af66c5ade31f0e
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list