diff options
Diffstat (limited to 'libswresample/x86/resample_x86_dsp.c')
-rw-r--r-- | libswresample/x86/resample_x86_dsp.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/libswresample/x86/resample_x86_dsp.c b/libswresample/x86/resample_x86_dsp.c index c7d2054..5130ecd 100644 --- a/libswresample/x86/resample_x86_dsp.c +++ b/libswresample/x86/resample_x86_dsp.c @@ -27,34 +27,14 @@ #include "libswresample/resample.h" -int swri_resample_common_int16_mmx2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx); -int swri_resample_linear_int16_mmx2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx); -int swri_resample_common_int16_sse2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx); -int swri_resample_linear_int16_sse2 (ResampleContext *c, int16_t *dst, const int16_t *src, int n, int update_ctx); -int swri_resample_common_float_sse (ResampleContext *c, float *dst, const float *src, int n, int update_ctx); -int swri_resample_linear_float_sse (ResampleContext *c, float *dst, const float *src, int n, int update_ctx); -int swri_resample_common_float_avx (ResampleContext *c, float *dst, const float *src, int n, int update_ctx); -int swri_resample_linear_float_avx (ResampleContext *c, float *dst, const float *src, int n, int update_ctx); int swri_resample_common_double_sse2(ResampleContext *c, double *dst, const double *src, int n, int update_ctx); int swri_resample_linear_double_sse2(ResampleContext *c, double *dst, const double *src, int n, int update_ctx); -#if HAVE_MMXEXT_INLINE - +#if HAVE_SSE2_INLINE #define DO_RESAMPLE_ONE 0 #include "resample_mmx.h" -#if ARCH_X86_32 -#define TEMPLATE_RESAMPLE_S16_MMX2 -#include "libswresample/resample_template.c" -#undef TEMPLATE_RESAMPLE_S16_MMX2 -#endif - -#if HAVE_SSE2_INLINE -#define TEMPLATE_RESAMPLE_S16_SSE2 -#include "libswresample/resample_template.c" -#undef TEMPLATE_RESAMPLE_S16_SSE2 - #define TEMPLATE_RESAMPLE_DBL_SSE2 #include "libswresample/resample_template.c" #undef TEMPLATE_RESAMPLE_DBL_SSE2 @@ -62,7 +42,15 @@ int swri_resample_linear_double_sse2(ResampleContext *c, double *dst, const do #undef DO_RESAMPLE_ONE -#endif // HAVE_MMXEXT_INLINE +int ff_resample_common_int16_mmxext(ResampleContext *c, uint8_t *dst, + const uint8_t *src, int sz, int upd); +int ff_resample_linear_int16_mmxext(ResampleContext *c, uint8_t *dst, + const uint8_t *src, int sz, int upd); + +int ff_resample_common_int16_sse2(ResampleContext *c, uint8_t *dst, + const uint8_t *src, int sz, int upd); +int ff_resample_linear_int16_sse2(ResampleContext *c, uint8_t *dst, + const uint8_t *src, int sz, int upd); int ff_resample_common_float_sse(ResampleContext *c, uint8_t *dst, const uint8_t *src, int sz, int upd); @@ -79,17 +67,19 @@ void swresample_dsp_x86_init(ResampleContext *c) int av_unused mm_flags = av_get_cpu_flags(); #define FNIDX(fmt) (AV_SAMPLE_FMT_##fmt - AV_SAMPLE_FMT_S16P) - if (ARCH_X86_32 && HAVE_MMXEXT_INLINE && mm_flags & AV_CPU_FLAG_MMX2) { - c->dsp.resample_common[FNIDX(S16P)] = (resample_fn) swri_resample_common_int16_mmx2; - c->dsp.resample_linear[FNIDX(S16P)] = (resample_fn) swri_resample_linear_int16_mmx2; + if (ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL && mm_flags & AV_CPU_FLAG_MMX2) { + c->dsp.resample_common[FNIDX(S16P)] = ff_resample_common_int16_mmxext; + c->dsp.resample_linear[FNIDX(S16P)] = ff_resample_linear_int16_mmxext; } if (HAVE_SSE_EXTERNAL && mm_flags & AV_CPU_FLAG_SSE) { c->dsp.resample_common[FNIDX(FLTP)] = ff_resample_common_float_sse; c->dsp.resample_linear[FNIDX(FLTP)] = ff_resample_linear_float_sse; } + if (HAVE_SSE2_EXTERNAL && mm_flags & AV_CPU_FLAG_SSE2) { + c->dsp.resample_common[FNIDX(S16P)] = ff_resample_common_int16_sse2; + c->dsp.resample_linear[FNIDX(S16P)] = ff_resample_linear_int16_sse2; + } if (HAVE_SSE2_INLINE && mm_flags & AV_CPU_FLAG_SSE2) { - c->dsp.resample_common[FNIDX(S16P)] = (resample_fn) swri_resample_common_int16_sse2; - c->dsp.resample_linear[FNIDX(S16P)] = (resample_fn) swri_resample_linear_int16_sse2; c->dsp.resample_common[FNIDX(DBLP)] = (resample_fn) swri_resample_common_double_sse2; c->dsp.resample_linear[FNIDX(DBLP)] = (resample_fn) swri_resample_linear_double_sse2; } |