diff options
author | James Almer <jamrial@gmail.com> | 2014-06-30 13:06:01 -0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-02 01:09:53 +0200 |
commit | 1a69224f44853f0a54c17a81449b63b61c3f2503 (patch) | |
tree | 92585842f242bf4bdbe5e1319aef80a82b0bbe8f /libswresample/x86/resample_x86_dsp.c | |
parent | a441a2437bc2663b05513bb223a8dfd08721a9ee (diff) | |
download | ffmpeg-1a69224f44853f0a54c17a81449b63b61c3f2503.tar.gz |
x86/swr: add ff_resample_{common, linear}_float_fma
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/x86/resample_x86_dsp.c')
-rw-r--r-- | libswresample/x86/resample_x86_dsp.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/libswresample/x86/resample_x86_dsp.c b/libswresample/x86/resample_x86_dsp.c index 9049da6951..ff9f1ec83e 100644 --- a/libswresample/x86/resample_x86_dsp.c +++ b/libswresample/x86/resample_x86_dsp.c @@ -27,30 +27,19 @@ #include "libswresample/resample.h" -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); +#define RESAMPLE_FUNCS(type, opt) \ +int ff_resample_common_##type##_##opt(ResampleContext *c, uint8_t *dst, \ + const uint8_t *src, int sz, int upd); \ +int ff_resample_linear_##type##_##opt(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); -int ff_resample_linear_float_sse(ResampleContext *c, uint8_t *dst, - const uint8_t *src, int sz, int upd); - -int ff_resample_common_float_avx(ResampleContext *c, uint8_t *dst, - const uint8_t *src, int sz, int upd); -int ff_resample_linear_float_avx(ResampleContext *c, uint8_t *dst, - const uint8_t *src, int sz, int upd); - -int ff_resample_common_double_sse2(ResampleContext *c, uint8_t *dst, - const uint8_t *src, int sz, int upd); -int ff_resample_linear_double_sse2(ResampleContext *c, uint8_t *dst, - const uint8_t *src, int sz, int upd); +RESAMPLE_FUNCS(int16, mmxext); +RESAMPLE_FUNCS(int16, sse2); +RESAMPLE_FUNCS(float, sse); +RESAMPLE_FUNCS(float, avx); +RESAMPLE_FUNCS(float, fma3); +RESAMPLE_FUNCS(float, fma4); +RESAMPLE_FUNCS(double, sse2); void swresample_dsp_x86_init(ResampleContext *c) { @@ -76,4 +65,12 @@ void swresample_dsp_x86_init(ResampleContext *c) c->dsp.resample_common[FNIDX(FLTP)] = ff_resample_common_float_avx; c->dsp.resample_linear[FNIDX(FLTP)] = ff_resample_linear_float_avx; } + if (HAVE_FMA3_EXTERNAL && mm_flags & AV_CPU_FLAG_FMA3) { + c->dsp.resample_common[FNIDX(FLTP)] = ff_resample_common_float_fma3; + c->dsp.resample_linear[FNIDX(FLTP)] = ff_resample_linear_float_fma3; + } + if (HAVE_FMA4_EXTERNAL && mm_flags & AV_CPU_FLAG_FMA4) { + c->dsp.resample_common[FNIDX(FLTP)] = ff_resample_common_float_fma4; + c->dsp.resample_linear[FNIDX(FLTP)] = ff_resample_linear_float_fma4; + } } |