]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/x86/fft_mmx.asm
SBR DSP x86: implement SSE sbr_sum_square_sse
[ffmpeg] / libavcodec / x86 / fft_mmx.asm
index bd79fc14237044b912b8dc68893769565a8c968a..a2f26cca339ef09f1895236190d99ec7fa3a8cd1 100644 (file)
@@ -20,7 +20,7 @@
 ;*
 ;* You should have received a copy of the GNU Lesser General Public
 ;* License along with Libav; if not, write to the Free Software
-;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
 ; These functions are not individually interchangeable with the C versions.
@@ -30,7 +30,7 @@
 
 %include "x86inc.asm"
 
-%ifdef ARCH_X86_64
+%if ARCH_X86_64
 %define pointer resq
 %else
 %define pointer resd
@@ -73,7 +73,7 @@ cextern cos_ %+ i
 %assign i i<<1
 %endrep
 
-%ifdef ARCH_X86_64
+%if ARCH_X86_64
     %define pointer dq
 %else
     %define pointer dd
@@ -85,7 +85,7 @@ cextern cos_ %+ i
     %1
 %endmacro
 
-section .text align=16
+SECTION_TEXT
 
 %macro T2_3DN 4 ; z0, z1, mem0, mem1
     mova     %1, %3
@@ -299,6 +299,7 @@ IF%1 mova  Z(1), m5
 
 INIT_YMM
 
+%if HAVE_AVX
 align 16
 fft8_avx:
     mova      m0, Z(0)
@@ -387,6 +388,7 @@ fft32_interleave_avx:
     sub r2d, mmsize/4
     jg .deint_loop
     ret
+%endif
 
 INIT_XMM
 %define movdqa  movaps
@@ -532,6 +534,7 @@ DEFINE_ARGS z, w, n, o1, o3
 
 INIT_YMM
 
+%if HAVE_AVX
 %macro INTERL_AVX 5
     vunpckhps      %3, %2, %1
     vunpcklps      %2, %2, %1
@@ -545,6 +548,7 @@ INIT_YMM
 
 DECL_PASS pass_avx, PASS_BIG 1
 DECL_PASS pass_interleave_avx, PASS_BIG 0
+%endif
 
 INIT_XMM
 
@@ -634,10 +638,15 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits
     RET
 %endmacro ; DECL_FFT
 
+%if HAVE_AVX
+INIT_YMM
 DECL_FFT 6, _avx
 DECL_FFT 6, _avx, _interleave
+%endif
+INIT_XMM
 DECL_FFT 5, _sse
 DECL_FFT 5, _sse, _interleave
+INIT_MMX
 DECL_FFT 4, _3dn
 DECL_FFT 4, _3dn, _interleave
 DECL_FFT 4, _3dn2
@@ -741,7 +750,7 @@ INIT_XMM
 
 %macro DECL_IMDCT 2
 cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *input
-%ifdef ARCH_X86_64
+%if ARCH_X86_64
 %define rrevtab r10
 %define rtcos   r11
 %define rtsin   r12
@@ -760,24 +769,24 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *
     mov   rtsin, [r0+FFTContext.tsin]
     add   rtcos, r3
     add   rtsin, r3
-%ifndef ARCH_X86_64
+%if ARCH_X86_64 == 0
     push  rtcos
     push  rtsin
 %endif
     shr   r3, 1
     mov   rrevtab, [r0+FFTContext.revtab]
     add   rrevtab, r3
-%ifndef ARCH_X86_64
+%if ARCH_X86_64 == 0
     push  rrevtab
 %endif
 
     sub   r3, 4
-%ifdef ARCH_X86_64
+%if ARCH_X86_64
     xor   r4, r4
     sub   r4, r3
 %endif
 .pre:
-%ifndef ARCH_X86_64
+%if ARCH_X86_64 == 0
 ;unspill
     xor   r4, r4
     sub   r4, r3
@@ -786,7 +795,7 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *
 %endif
 
     PREROTATER r4, r3, r2, rtcos, rtsin
-%ifdef ARCH_X86_64
+%if ARCH_X86_64
     movzx  r5,  word [rrevtab+r4-4]
     movzx  r6,  word [rrevtab+r4-2]
     movzx  r13, word [rrevtab+r3]
@@ -820,7 +829,7 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *
     mov  r0d, [r5+FFTContext.mdctsize]
     add  r6, r0
     shr  r0, 1
-%ifndef ARCH_X86_64
+%if ARCH_X86_64 == 0
 %define rtcos r2
 %define rtsin r3
     mov  rtcos, [esp+8]
@@ -830,7 +839,7 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *
     mov  r1, -mmsize
     sub  r1, r0
     %2 r0, r1, r6, rtcos, rtsin
-%ifdef ARCH_X86_64
+%if ARCH_X86_64
     pop  r14
     pop  r13
     pop  r12
@@ -847,4 +856,6 @@ DECL_IMDCT _sse, POSROTATESHUF
 
 INIT_YMM
 
+%if HAVE_AVX
 DECL_IMDCT _avx, POSROTATESHUF_AVX
+%endif