From d68c05380cebf563915412182643a8be04ef890b Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 26 May 2015 14:29:08 -0300 Subject: x86: check for AV_CPU_FLAG_AVXSLOW where useful Signed-off-by: James Almer Signed-off-by: Luca Barbato --- libavresample/x86/audio_convert_init.c | 4 +++- libavresample/x86/audio_mix_init.c | 4 +++- libavresample/x86/dither_init.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'libavresample') diff --git a/libavresample/x86/audio_convert_init.c b/libavresample/x86/audio_convert_init.c index d85ca84..ae6c319 100644 --- a/libavresample/x86/audio_convert_init.c +++ b/libavresample/x86/audio_convert_init.c @@ -226,11 +226,13 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac) ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, 6, 16, 4, "SSE4", ff_conv_fltp_to_flt_6ch_sse4); } - if (EXTERNAL_AVX(cpu_flags)) { + if (EXTERNAL_AVX_FAST(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32, 0, 32, 16, "AVX", ff_conv_s32_to_flt_avx); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT, 0, 32, 32, "AVX", ff_conv_flt_to_s32_avx); + } + if (EXTERNAL_AVX(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, 2, 16, 16, "AVX", ff_conv_s16p_to_s16_2ch_avx); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, diff --git a/libavresample/x86/audio_mix_init.c b/libavresample/x86/audio_mix_init.c index 7fc530e..e14a540 100644 --- a/libavresample/x86/audio_mix_init.c +++ b/libavresample/x86/audio_mix_init.c @@ -195,11 +195,13 @@ av_cold void ff_audio_mix_init_x86(AudioMix *am) ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "SSE4", ff_mix_1_to_2_s16p_flt_sse4); } - if (EXTERNAL_AVX(cpu_flags)) { + if (EXTERNAL_AVX_FAST(cpu_flags)) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 2, 1, 32, 16, "AVX", ff_mix_2_to_1_fltp_flt_avx); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 1, 2, 32, 8, "AVX", ff_mix_1_to_2_fltp_flt_avx); + } + if (EXTERNAL_AVX(cpu_flags)) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "AVX", ff_mix_1_to_2_s16p_flt_avx); } diff --git a/libavresample/x86/dither_init.c b/libavresample/x86/dither_init.c index 8349d5e..2a351c5 100644 --- a/libavresample/x86/dither_init.c +++ b/libavresample/x86/dither_init.c @@ -46,14 +46,14 @@ av_cold void ff_dither_init_x86(DitherDSPContext *ddsp, if (EXTERNAL_SSE2(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_sse2; } - if (EXTERNAL_AVX(cpu_flags)) { + if (EXTERNAL_AVX_FAST(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_avx; } } else { if (EXTERNAL_SSE2(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_sse2; } - if (EXTERNAL_AVX(cpu_flags)) { + if (EXTERNAL_AVX_FAST(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_avx; } } -- cgit v1.1