]> git.sesse.net Git - ffmpeg/blobdiff - libswresample/x86/audio_convert.asm
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libswresample / x86 / audio_convert.asm
index fcf7ac108a9e476bca241dcec610e03a3f951dec..6fc86f07488f4c25c47b87a8914338d7ecc6b743 100644 (file)
@@ -199,7 +199,7 @@ cglobal %2_to_%1_%3, 3, 3, 6, dst, src, len
     REP_RET
 %endmacro
 
-%macro PACK_6CH 3
+%macro PACK_6CH 5-7
 cglobal pack_6ch_%2_to_%1_%3, 2,8,7, dst, src, src1, src2, src3, src4, src5, len
 %if ARCH_X86_64
     mov     lend, r2d
@@ -241,6 +241,7 @@ pack_6ch_%2_to_%1_u_int %+ SUFFIX
     mov%3     m3, [srcq+src3q]
     mov%3     m4, [srcq+src4q]
     mov%3     m5, [srcq+src5q]
+    %7 x,x,x,x,m7,x
 %if cpuflag(sse4)
     SBUTTERFLYPS 0, 1, 6
     SBUTTERFLYPS 2, 3, 6
@@ -253,6 +254,10 @@ pack_6ch_%2_to_%1_u_int %+ SUFFIX
     movlhps   m1, m3
     movhlps   m5, m3
 
+    %6 m0,m6,x,x,m7,m3
+    %6 m4,m1,x,x,m7,m3
+    %6 m2,m5,x,x,m7,m3
+
     mov %+ %3 %+ ps [dstq   ], m0
     mov %+ %3 %+ ps [dstq+16], m6
     mov %+ %3 %+ ps [dstq+32], m4
@@ -321,12 +326,12 @@ pack_6ch_%2_to_%1_u_int %+ SUFFIX
 %macro FLOAT_TO_INT32_N 6
     mulps %1, %5
     mulps %2, %5
-    cvtps2dq  %3, %1
-    cvtps2dq  %4, %2
+    cvtps2dq  %6, %1
     cmpnltps %1, %5
+    paddd %1, %6
+    cvtps2dq  %6, %2
     cmpnltps %2, %5
-    paddd %1, %3
-    paddd %2, %4
+    paddd %2, %6
 %endmacro
 
 %macro INT16_TO_FLOAT_INIT 6
@@ -360,7 +365,7 @@ pack_6ch_%2_to_%1_u_int %+ SUFFIX
     packssdw  m1, m3
 %endmacro
 
-%macro NOP_N 6
+%macro NOP_N 0-6
 %endmacro
 
 INIT_MMX mmx
@@ -369,8 +374,8 @@ CONV int32, int16, a, 2, 1, INT16_TO_INT32_N, NOP_N
 CONV int16, int32, u, 1, 2, INT32_TO_INT16_N, NOP_N
 CONV int16, int32, a, 1, 2, INT32_TO_INT16_N, NOP_N
 
-PACK_6CH float,float,u
-PACK_6CH float,float,a
+PACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
+PACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
 
 INIT_XMM sse
 CONV int32, int16, u, 2, 1, INT16_TO_INT32_N, NOP_N
@@ -434,13 +439,23 @@ UNPACK_2CH float, int16, u, 2, 1, INT16_TO_FLOAT_N, INT16_TO_FLOAT_INIT
 UNPACK_2CH float, int16, a, 2, 1, INT16_TO_FLOAT_N, INT16_TO_FLOAT_INIT
 
 INIT_XMM sse4
-PACK_6CH float,float,u
-PACK_6CH float,float,a
+PACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
+PACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
+
+PACK_6CH float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+PACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+PACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
+PACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 
 %if HAVE_AVX
 INIT_XMM avx
-PACK_6CH float,float,u
-PACK_6CH float,float,a
+PACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
+PACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
+
+PACK_6CH float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+PACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
+PACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
+PACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 
 INIT_YMM avx
 CONV float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT