---
 libavresample/x86/audio_convert.asm    |   38 ++++++++++++++++++++++++++++++++
 libavresample/x86/audio_convert_init.c |   11 +++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/libavresample/x86/audio_convert.asm 
b/libavresample/x86/audio_convert.asm
index 9ba7251..70519e1 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -734,3 +734,41 @@ CONV_FLTP_TO_FLT_6CH
 INIT_XMM avx
 CONV_FLTP_TO_FLT_6CH
 %endif
+
+;------------------------------------------------------------------------------
+; void ff_conv_s16_to_s16p_2ch(int16_t *const *dst, int16_t *src, int len,
+;                              int channels);
+;------------------------------------------------------------------------------
+
+%macro CONV_S16_TO_S16P_2CH 0
+cglobal conv_s16_to_s16p_2ch, 3,4,3, dst0, src, len, dst1
+    lea       lenq, [2*lend]
+    mov      dst1q, [dst0q+gprsize]
+    mov      dst0q, [dst0q        ]
+    lea       srcq, [srcq+2*lenq]
+    add      dst0q, lenq
+    add      dst1q, lenq
+    neg       lenq
+    ALIGN 16
+.loop:
+    mova        m0, [srcq+2*lenq       ]
+    mova        m1, [srcq+2*lenq+mmsize]
+    pshuflw     m0, m0, q3120
+    pshufhw     m0, m0, q3120
+    pshuflw     m1, m1, q3120
+    pshufhw     m1, m1, q3120
+    shufps      m2, m0, m1, q2020
+    shufps      m0, m1, q3131
+    mova  [dst0q+lenq], m2
+    mova  [dst1q+lenq], m0
+    add       lenq, mmsize
+    jl .loop
+    REP_RET
+%endmacro
+
+INIT_XMM sse2
+CONV_S16_TO_S16P_2CH
+%if HAVE_AVX
+INIT_XMM avx
+CONV_S16_TO_S16P_2CH
+%endif
diff --git a/libavresample/x86/audio_convert_init.c 
b/libavresample/x86/audio_convert_init.c
index e13b5b8..65c6e10 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -86,6 +86,13 @@ extern void ff_conv_fltp_to_flt_6ch_sse4(float *dst, float 
*const *src, int len,
 extern void ff_conv_fltp_to_flt_6ch_avx (float *dst, float *const *src, int 
len,
                                          int channels);
 
+/* deinterleave conversions */
+
+extern void ff_conv_s16_to_s16p_2ch_sse2(int16_t *const *dst, int16_t *src,
+                                         int len, int channels);
+extern void ff_conv_s16_to_s16p_2ch_avx (int16_t *const *dst, int16_t *src,
+                                         int len, int channels);
+
 av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
 {
 #if HAVE_YASM
@@ -130,6 +137,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   2, 16, 4, "SSE2", 
ff_conv_fltp_to_s16_2ch_sse2);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
                                   6, 16, 4, "SSE2", 
ff_conv_fltp_to_s16_6ch_sse2);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
+                                  2, 16, 8, "SSE2", 
ff_conv_s16_to_s16p_2ch_sse2);
     }
     if (mm_flags & AV_CPU_FLAG_SSE4 && HAVE_SSE) {
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16,
@@ -158,6 +167,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   2, 16, 8, "AVX", 
ff_conv_fltp_to_flt_2ch_avx);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
                                   6, 16, 4, "AVX", 
ff_conv_fltp_to_flt_6ch_avx);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
+                                  2, 16, 8, "AVX", 
ff_conv_s16_to_s16p_2ch_avx);
     }
 #endif
 }
-- 
1.7.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to