[FFmpeg-devel] [PATCH] Fix compilation with YASM/NASM versions not supporting AVX.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu May 26 19:45:13 CEST 2011


---
 libavcodec/x86/fft_mmx.asm |   10 ++++++++++
 libavcodec/x86/fft_sse.c   |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
index 2551b48..b9739d7 100644
--- a/libavcodec/x86/fft_mmx.asm
+++ b/libavcodec/x86/fft_mmx.asm
@@ -299,6 +299,8 @@ IF%1 mova  Z(1), m5
 
 INIT_YMM
 
+%ifdef HAVE_AVX
+
 align 16
 fft8_avx:
     mova      m0, Z(0)
@@ -388,6 +390,8 @@ fft32_interleave_avx:
     jg .deint_loop
     ret
 
+%endif
+
 INIT_XMM
 %define movdqa  movaps
 
@@ -543,8 +547,10 @@ INIT_YMM
 
 %define INTERL INTERL_AVX
 
+%ifdef HAVE_AVX
 DECL_PASS pass_avx, PASS_BIG 1
 DECL_PASS pass_interleave_avx, PASS_BIG 0
+%endif
 
 INIT_XMM
 
@@ -634,8 +640,10 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits
     RET
 %endmacro ; DECL_FFT
 
+%ifdef HAVE_AVX
 DECL_FFT 6, _avx
 DECL_FFT 6, _avx, _interleave
+%endif
 DECL_FFT 5, _sse
 DECL_FFT 5, _sse, _interleave
 DECL_FFT 4, _3dn
@@ -847,4 +855,6 @@ DECL_IMDCT _sse, POSROTATESHUF
 
 INIT_YMM
 
+%ifdef HAVE_AVX
 DECL_IMDCT _avx, POSROTATESHUF_AVX
+%endif
diff --git a/libavcodec/x86/fft_sse.c b/libavcodec/x86/fft_sse.c
index 801dc1b..2f727e7 100644
--- a/libavcodec/x86/fft_sse.c
+++ b/libavcodec/x86/fft_sse.c
@@ -30,10 +30,12 @@ void ff_fft_dispatch_sse(FFTComplex *z, int nbits);
 void ff_fft_dispatch_interleave_sse(FFTComplex *z, int nbits);
 void ff_fft_dispatch_interleave_avx(FFTComplex *z, int nbits);
 
+#if HAVE_AVX
 void ff_fft_calc_avx(FFTContext *s, FFTComplex *z)
 {
     ff_fft_dispatch_interleave_avx(z, s->nbits);
 }
+#endif
 
 void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
 {
-- 
1.7.5.1



More information about the ffmpeg-devel mailing list