x86: check for AV_CPU_FLAG_AVXSLOW where useful
Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
cae3985120
commit
d68c05380c
@ -98,10 +98,10 @@ av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
s->synth_filter_float = synth_filter_sse2;
|
||||
}
|
||||
if (EXTERNAL_AVX(cpu_flags)) {
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags)) {
|
||||
s->synth_filter_float = synth_filter_avx;
|
||||
}
|
||||
if (EXTERNAL_FMA3(cpu_flags)) {
|
||||
if (EXTERNAL_FMA3(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_AVXSLOW)) {
|
||||
s->synth_filter_float = synth_filter_fma3;
|
||||
}
|
||||
#endif /* HAVE_YASM */
|
||||
|
@ -34,6 +34,6 @@ av_cold void ff_dct_init_x86(DCTContext *s)
|
||||
s->dct32 = ff_dct32_float_sse;
|
||||
if (EXTERNAL_SSE2(cpu_flags))
|
||||
s->dct32 = ff_dct32_float_sse2;
|
||||
if (EXTERNAL_AVX(cpu_flags))
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags))
|
||||
s->dct32 = ff_dct32_float_avx;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ av_cold void ff_fft_init_x86(FFTContext *s)
|
||||
s->fft_calc = ff_fft_calc_sse;
|
||||
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
|
||||
}
|
||||
if (EXTERNAL_AVX(cpu_flags) && s->nbits >= 5) {
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags) && s->nbits >= 5) {
|
||||
/* AVX for SB */
|
||||
s->imdct_half = ff_imdct_half_avx;
|
||||
s->fft_calc = ff_fft_calc_avx;
|
||||
|
@ -52,7 +52,7 @@ av_cold void ff_volume_init_x86(VolumeContext *vol)
|
||||
vol->scale_samples = ff_scale_samples_s32_ssse3_atom;
|
||||
vol->samples_align = 4;
|
||||
}
|
||||
if (EXTERNAL_AVX(cpu_flags)) {
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags)) {
|
||||
vol->scale_samples = ff_scale_samples_s32_avx;
|
||||
vol->samples_align = 8;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_sse2;
|
||||
}
|
||||
if (EXTERNAL_AVX(cpu_flags)) {
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags)) {
|
||||
fdsp->vector_fmul = ff_vector_fmul_avx;
|
||||
fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_avx;
|
||||
fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_avx;
|
||||
|
@ -35,7 +35,7 @@ av_cold void ff_init_lls_x86(LLSModel *m)
|
||||
if (m->indep_count >= 4)
|
||||
m->evaluate_lls = ff_evaluate_lls_sse2;
|
||||
}
|
||||
if (EXTERNAL_AVX(cpu_flags)) {
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags)) {
|
||||
m->update_lls = ff_update_lls_avx;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user