Skip to content
Snippets Groups Projects
Commit a58030bc authored by Lyndon Brown's avatar Lyndon Brown Committed by Hugo Beauzée-Luyssen
Browse files

postproc: update SIMD variant selection

the cpu SIMD selection code removed here dates from a time when vlc had
options for disabling use of select SIMD variants, from before postproc
added cpu auto-detection ([1]), and from before postproc seems to have
added SSE2 ([2] and [3]).

we are purging MMX/MMXEXT from vlc v4.0-dev, and thus have an interest in
removing the corresponding MMX/MMXEXT bits here. rather than just removing
those lines, alongside adding an entry for SSE2 though, i have instead
chosen to convert the code to use auto-detection, which avoids having to
keep the block of code explicitly enabling implementations in sync with the
set of implementations available.

note, the version of postproc in contribs is very old, pre-dating the
SSE2 and CPU feature auto-detection enhancements. accordingly i have had to
ensure that we define `PP_CPU_CAPS_AUTO` ourselves when not found, as had
been done for `PP_CPU_CAPS_ALTIVEC`. effectively, for users like myself on
linux with a new enough version, the auto-detection will work correctly and
now make use of SSE2, which we were ignoring before; while where the
contrib package is used, its use will fall back to the C implementation
until such time that the contrib gets updated.

[1]: https://github.com/FFmpeg/FFmpeg/commit/59d686f100863d00b8f171dd891e893c2bfd951e
[2]: https://github.com/FFmpeg/FFmpeg/commit/4e264d1c79cfae8c3e05aacf77e350ed1b6d7e4b
[3]: https://github.com/FFmpeg/FFmpeg/commit/f48cddfe4cf04e2d6e802d12e973301ff5a1a9a8
parent 403c0a6c
No related branches found
No related tags found
1 merge request!420postproc: update SIMD variant selection
Pipeline #125526 passed with stage
in 33 minutes and 29 seconds
......@@ -46,8 +46,8 @@
# include <libpostproc/postprocess.h>
#endif
#ifndef PP_CPU_CAPS_ALTIVEC
# define PP_CPU_CAPS_ALTIVEC 0
#ifndef PP_CPU_CAPS_AUTO
# define PP_CPU_CAPS_AUTO 0
#endif
/*****************************************************************************
......@@ -120,7 +120,7 @@ static int OpenPostproc( filter_t *p_filter )
filter_sys_t *p_sys;
vlc_value_t val, val_orig;
const char *desc;
int i_flags = 0;
int i_flags = PP_CPU_CAPS_AUTO;
if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma ||
p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height ||
......@@ -130,17 +130,6 @@ static int OpenPostproc( filter_t *p_filter )
return VLC_EGENERIC;
}
/* Set CPU capabilities */
#if defined(__i386__) || defined(__x86_64__)
if( vlc_CPU_MMX() )
i_flags |= PP_CPU_CAPS_MMX;
if( vlc_CPU_MMXEXT() )
i_flags |= PP_CPU_CAPS_MMX2;
#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
if( vlc_CPU_ALTIVEC() )
i_flags |= PP_CPU_CAPS_ALTIVEC;
#endif
switch( p_filter->fmt_in.video.i_chroma )
{
case VLC_CODEC_I444:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment