summaryrefslogtreecommitdiff
path: root/libavcodec/x86/fft_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/x86/fft_init.c')
-rw-r--r--libavcodec/x86/fft_init.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c
index fcde3fa797..9ee3f9c86e 100644
--- a/libavcodec/x86/fft_init.c
+++ b/libavcodec/x86/fft_init.c
@@ -17,29 +17,29 @@
*/
#include "libavutil/cpu.h"
+#include "libavutil/x86/cpu.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/dct.h"
#include "fft.h"
av_cold void ff_fft_init_mmx(FFTContext *s)
{
-#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
#if ARCH_X86_32
- if (has_vectors & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
+ if (EXTERNAL_AMD3DNOW(has_vectors)) {
/* 3DNow! for K6-2/3 */
s->imdct_calc = ff_imdct_calc_3dnow;
s->imdct_half = ff_imdct_half_3dnow;
s->fft_calc = ff_fft_calc_3dnow;
}
- if (has_vectors & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT) {
+ if (EXTERNAL_AMD3DNOWEXT(has_vectors)) {
/* 3DNowEx for K7 */
s->imdct_calc = ff_imdct_calc_3dnowext;
s->imdct_half = ff_imdct_half_3dnowext;
s->fft_calc = ff_fft_calc_3dnowext;
}
#endif
- if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
+ if (EXTERNAL_SSE(has_vectors)) {
/* SSE for P3/P4/K8 */
s->imdct_calc = ff_imdct_calc_sse;
s->imdct_half = ff_imdct_half_sse;
@@ -47,26 +47,23 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
s->fft_calc = ff_fft_calc_sse;
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
}
- if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) {
+ if (EXTERNAL_AVX(has_vectors) && s->nbits >= 5) {
/* AVX for SB */
s->imdct_half = ff_imdct_half_avx;
s->fft_calc = ff_fft_calc_avx;
s->fft_permutation = FF_FFT_PERM_AVX;
}
-#endif
}
#if CONFIG_DCT
av_cold void ff_dct_init_mmx(DCTContext *s)
{
-#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
- if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
+ if (EXTERNAL_SSE(has_vectors))
s->dct32 = ff_dct32_float_sse;
- if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
+ if (EXTERNAL_SSE2(has_vectors))
s->dct32 = ff_dct32_float_sse2;
- if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
+ if (EXTERNAL_AVX(has_vectors))
s->dct32 = ff_dct32_float_avx;
-#endif
}
#endif