---
 libavresample/x86/audio_convert.asm    |   39 ++++++++++++++++++++++++++++++++
 libavresample/x86/audio_convert_init.c |   13 ++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/libavresample/x86/audio_convert.asm 
b/libavresample/x86/audio_convert.asm
index 09c4e7f..ea0debf 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -923,3 +923,42 @@ CONV_S16_TO_S16P_6CH
 INIT_XMM avx
 CONV_S16_TO_S16P_6CH
 %endif
+
+;------------------------------------------------------------------------------
+; void ff_conv_s16_to_fltp_2ch(float *const *dst, int16_t *src, int len,
+;                              int channels);
+;------------------------------------------------------------------------------
+
+%macro CONV_S16_TO_FLTP_2CH 0
+cglobal conv_s16_to_fltp_2ch, 3,4,4, dst0, src, len, dst1
+    lea       lenq, [4*lend]
+    mov      dst1q, [dst0q+gprsize]
+    mov      dst0q, [dst0q        ]
+    add       srcq, lenq
+    add      dst0q, lenq
+    add      dst1q, lenq
+    neg       lenq
+    mova        m3, [pf_s16_inv_scale]
+.loop:
+    mova       m0, [srcq+lenq]
+    S16_TO_S32_SX 0, 1
+    cvtdq2ps   m0, m0
+    cvtdq2ps   m1, m1
+    mulps      m0, m0, m3
+    mulps      m1, m1, m3
+    DEINT2_PS   0, 1, 2
+    mova  [dst0q+lenq], m0
+    mova  [dst1q+lenq], m1
+    add      lenq, mmsize
+    jl .loop
+    REP_RET
+%endmacro
+
+INIT_XMM sse2
+CONV_S16_TO_FLTP_2CH
+INIT_XMM sse4
+CONV_S16_TO_FLTP_2CH
+%if HAVE_AVX
+INIT_XMM avx
+CONV_S16_TO_FLTP_2CH
+%endif
diff --git a/libavresample/x86/audio_convert_init.c 
b/libavresample/x86/audio_convert_init.c
index adb63f6..db4d3f3 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -106,6 +106,13 @@ extern void ff_conv_s16_to_s16p_6ch_ssse3(int16_t *const 
*dst, int16_t *src,
 extern void ff_conv_s16_to_s16p_6ch_avx  (int16_t *const *dst, int16_t *src,
                                           int len, int channels);
 
+extern void ff_conv_s16_to_fltp_2ch_sse2(float *const *dst, int16_t *src,
+                                         int len, int channels);
+extern void ff_conv_s16_to_fltp_2ch_sse4(float *const *dst, int16_t *src,
+                                         int len, int channels);
+extern void ff_conv_s16_to_fltp_2ch_avx (float *const *dst, int16_t *src,
+                                         int len, int channels);
+
 av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
 {
 #if HAVE_YASM
@@ -157,6 +164,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   2, 16, 8, "SSE2", 
ff_conv_s16_to_s16p_2ch_sse2);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
                                   6, 16, 4, "SSE2", 
ff_conv_s16_to_s16p_6ch_sse2);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
+                                  2, 16, 8, "SSE2", 
ff_conv_s16_to_fltp_2ch_sse2);
     }
     if (mm_flags & AV_CPU_FLAG_SSSE3 && HAVE_SSE) {
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
@@ -173,6 +182,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   0, 16, 8, "SSE4", ff_conv_s16_to_flt_sse4);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
                                   6, 16, 4, "SSE4", 
ff_conv_fltp_to_flt_6ch_sse4);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
+                                  2, 16, 8, "SSE4", 
ff_conv_s16_to_fltp_2ch_sse4);
     }
     if (mm_flags & AV_CPU_FLAG_AVX && HAVE_AVX) {
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32,
@@ -195,6 +206,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   2, 16, 8, "AVX", 
ff_conv_s16_to_s16p_2ch_avx);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
                                   6, 16, 4, "AVX", 
ff_conv_s16_to_s16p_6ch_avx);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
+                                  2, 16, 8, "AVX", 
ff_conv_s16_to_fltp_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