[FFmpeg-cvslog] libswresample-simd: add ff_pack_6ch_int32_to_float_a_avx and ff_pack_6ch_int32_to_float_a_sse4

Michael Niedermayer git at videolan.org
Sun May 13 21:21:32 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 13 20:53:30 2012 +0200| [ca986a06ad1ad81bf4c16720aec608c70f958ef4] | committer: Michael Niedermayer

libswresample-simd: add ff_pack_6ch_int32_to_float_a_avx and ff_pack_6ch_int32_to_float_a_sse4

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca986a06ad1ad81bf4c16720aec608c70f958ef4
---

 libswresample/x86/audio_convert.asm |   25 ++++++++++++++++++-------
 libswresample/x86/swresample_x86.c  |    4 ++++
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm
index 6f33575..19e3e04 100644
--- a/libswresample/x86/audio_convert.asm
+++ b/libswresample/x86/audio_convert.asm
@@ -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
@@ -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,19 @@ 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
 
 %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
 
 INIT_YMM avx
 CONV float, int32, u, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
diff --git a/libswresample/x86/swresample_x86.c b/libswresample/x86/swresample_x86.c
index f2349b5..3a91d36 100644
--- a/libswresample/x86/swresample_x86.c
+++ b/libswresample/x86/swresample_x86.c
@@ -123,6 +123,8 @@ MULTI_CAPS_FUNC(AV_CPU_FLAG_SSE, sse)
         if(channels == 6) {
             if(   out_fmt == AV_SAMPLE_FMT_FLT  && in_fmt == AV_SAMPLE_FMT_FLTP || out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_S32P)
                 ac->simd_f =  ff_pack_6ch_float_to_float_a_sse4;
+            if(   out_fmt == AV_SAMPLE_FMT_FLT  && in_fmt == AV_SAMPLE_FMT_S32P)
+                ac->simd_f =  ff_pack_6ch_int32_to_float_a_sse4;
         }
     }
     if(HAVE_AVX && mm_flags & AV_CPU_FLAG_AVX) {
@@ -131,6 +133,8 @@ MULTI_CAPS_FUNC(AV_CPU_FLAG_SSE, sse)
         if(channels == 6) {
             if(   out_fmt == AV_SAMPLE_FMT_FLT  && in_fmt == AV_SAMPLE_FMT_FLTP || out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_S32P)
                 ac->simd_f =  ff_pack_6ch_float_to_float_a_avx;
+            if(   out_fmt == AV_SAMPLE_FMT_FLT  && in_fmt == AV_SAMPLE_FMT_S32P)
+                ac->simd_f =  ff_pack_6ch_int32_to_float_a_avx;
         }
     }
 }



More information about the ffmpeg-cvslog mailing list