diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-11-03 18:45:37 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-11-09 17:38:24 +0100 |
commit | 1f0948272a0fcd0e4947f629b600983f3338c02f (patch) | |
tree | c2dd5ffa2cf331a710767a986e95203e1123b027 /libpostproc/postprocess.c | |
parent | 10ddbaf5144c902189fa7388f717b6350e23504b (diff) | |
download | ffmpeg-1f0948272a0fcd0e4947f629b600983f3338c02f.tar.gz |
postproc/postprocess: Remove obsolete MMX(EXT)/3Dnow functions
postprocess.c currently has C, MMX, MMXEXT, 3DNow as well as
SSE2 versions of its internal functions. But given that only
ancient 32-bit x86 CPUs don't support SSE2, the MMX, MMXEXT
and 3DNow versions are obsolete and are therefore removed by
this commit. This saves about 56KB here.
(The SSE2 version in particular is not really complete,
so that it often falls back to MMXEXT (which means that
there were some identical (apart from the name) MMXEXT
and SSE2 functions; this duplication no longer exists
with this commit.)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libpostproc/postprocess.c')
-rw-r--r-- | libpostproc/postprocess.c | 69 |
1 files changed, 20 insertions, 49 deletions
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 383c691cb4..0586e458b4 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -26,28 +26,27 @@ */ /* - C MMX MMX2 3DNow AltiVec -isVertDC Ec Ec Ec -isVertMinMaxOk Ec Ec Ec -doVertLowPass E e e Ec -doVertDefFilter Ec Ec e e Ec -isHorizDC Ec Ec Ec -isHorizMinMaxOk a E Ec -doHorizLowPass E e e Ec -doHorizDefFilter Ec Ec e e Ec -do_a_deblock Ec E Ec E -deRing E e e* Ecp -Vertical RKAlgo1 E a a -Horizontal RKAlgo1 a a -Vertical X1# a E E -Horizontal X1# a E E -LinIpolDeinterlace e E E* -CubicIpolDeinterlace a e e* -LinBlendDeinterlace e E E* + C MMX MMX2 AltiVec +isVertDC Ec Ec Ec +isVertMinMaxOk Ec Ec Ec +doVertLowPass E e Ec +doVertDefFilter Ec Ec e Ec +isHorizDC Ec Ec Ec +isHorizMinMaxOk a E Ec +doHorizLowPass E e Ec +doHorizDefFilter Ec Ec e Ec +do_a_deblock Ec E Ec +deRing E e Ecp +Vertical RKAlgo1 E a +Horizontal RKAlgo1 a +Vertical X1# a E +Horizontal X1# a E +LinIpolDeinterlace e E +CubicIpolDeinterlace a e +LinBlendDeinterlace e E MedianDeinterlace# E Ec Ec -TempDeNoiser# E e e Ec +TempDeNoiser# E e Ec -* I do not have a 3DNow! CPU -> it is untested, but no one said it does not work so it seems to work # more or less selfinvented filters so the exactness is not too meaningful E = Exact implementation e = almost exact implementation (slightly different rounding,...) @@ -83,7 +82,6 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks #include <stdlib.h> #include <string.h> //#undef HAVE_MMXEXT_INLINE -//#define HAVE_AMD3DNOW_INLINE //#undef HAVE_MMX_INLINE //#undef ARCH_X86 //#define DEBUG_BRIGHTNESS @@ -494,7 +492,7 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, } } -//Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one +//Note: we have C and SSE2 version (which uses MMX(EXT) when advantageous) //Plain C versions //we always compile C for testing which needs bitexactness #define TEMPLATE_PP_C 1 @@ -508,27 +506,12 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, #if ARCH_X86 && HAVE_INLINE_ASM # if CONFIG_RUNTIME_CPUDETECT -# define TEMPLATE_PP_MMX 1 -# include "postprocess_template.c" -# define TEMPLATE_PP_MMXEXT 1 -# include "postprocess_template.c" -# define TEMPLATE_PP_3DNOW 1 -# include "postprocess_template.c" # define TEMPLATE_PP_SSE2 1 # include "postprocess_template.c" # else # if HAVE_SSE2_INLINE # define TEMPLATE_PP_SSE2 1 # include "postprocess_template.c" -# elif HAVE_MMXEXT_INLINE -# define TEMPLATE_PP_MMXEXT 1 -# include "postprocess_template.c" -# elif HAVE_AMD3DNOW_INLINE -# define TEMPLATE_PP_3DNOW 1 -# include "postprocess_template.c" -# elif HAVE_MMX_INLINE -# define TEMPLATE_PP_MMX 1 -# include "postprocess_template.c" # endif # endif #endif @@ -549,21 +532,12 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[] #if ARCH_X86 && HAVE_INLINE_ASM // ordered per speed fastest first if (c->cpuCaps & AV_CPU_FLAG_SSE2) pp = postProcess_SSE2; - else if (c->cpuCaps & AV_CPU_FLAG_MMXEXT) pp = postProcess_MMX2; - else if (c->cpuCaps & AV_CPU_FLAG_3DNOW) pp = postProcess_3DNow; - else if (c->cpuCaps & AV_CPU_FLAG_MMX) pp = postProcess_MMX; #elif HAVE_ALTIVEC if (c->cpuCaps & AV_CPU_FLAG_ALTIVEC) pp = postProcess_altivec; #endif #else /* CONFIG_RUNTIME_CPUDETECT */ #if HAVE_SSE2_INLINE pp = postProcess_SSE2; -#elif HAVE_MMXEXT_INLINE - pp = postProcess_MMX2; -#elif HAVE_AMD3DNOW_INLINE - pp = postProcess_3DNow; -#elif HAVE_MMX_INLINE - pp = postProcess_MMX; #elif HAVE_ALTIVEC pp = postProcess_altivec; #endif @@ -877,9 +851,6 @@ av_cold pp_context *pp_get_context(int width, int height, int cpuCaps){ c->cpuCaps = av_get_cpu_flags(); } else { c->cpuCaps = 0; - if (cpuCaps & PP_CPU_CAPS_MMX) c->cpuCaps |= AV_CPU_FLAG_MMX; - if (cpuCaps & PP_CPU_CAPS_MMX2) c->cpuCaps |= AV_CPU_FLAG_MMXEXT; - if (cpuCaps & PP_CPU_CAPS_3DNOW) c->cpuCaps |= AV_CPU_FLAG_3DNOW; if (cpuCaps & PP_CPU_CAPS_ALTIVEC) c->cpuCaps |= AV_CPU_FLAG_ALTIVEC; } |