---
 libavresample/x86/audio_convert.asm    |   33 ++++++++++++++++++++++++++++++++
 libavresample/x86/audio_convert_init.c |    9 ++++++++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/libavresample/x86/audio_convert.asm 
b/libavresample/x86/audio_convert.asm
index bc79f65..16cfcff 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -1172,3 +1172,36 @@ CONV_FLT_TO_S16P_6CH
 INIT_XMM avx
 CONV_FLT_TO_S16P_6CH
 %endif
+
+;------------------------------------------------------------------------------
+; void ff_conv_flt_to_fltp_2ch(float *const *dst, float *src, int len,
+;                              int channels);
+;------------------------------------------------------------------------------
+
+%macro CONV_FLT_TO_FLTP_2CH 0
+cglobal conv_flt_to_fltp_2ch, 3,4,3, dst0, src, len, dst1
+    lea    lenq, [4*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]
+    DEINT2_PS 0, 1, 2
+    mova  [dst0q+lenq], m0
+    mova  [dst1q+lenq], m1
+    add    lenq, mmsize
+    jl .loop
+    REP_RET
+%endmacro
+
+INIT_XMM sse
+CONV_FLT_TO_FLTP_2CH
+%if HAVE_AVX
+INIT_XMM avx
+CONV_FLT_TO_FLTP_2CH
+%endif
diff --git a/libavresample/x86/audio_convert_init.c 
b/libavresample/x86/audio_convert_init.c
index 66a5056..5ac12dc 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -128,6 +128,11 @@ extern void ff_conv_flt_to_s16p_6ch_sse2(int16_t *const 
*dst, float *src,
 extern void ff_conv_flt_to_s16p_6ch_avx (int16_t *const *dst, float *src,
                                          int len, int channels);
 
+extern void ff_conv_flt_to_fltp_2ch_sse(float *const *dst, float *src, int len,
+                                        int channels);
+extern void ff_conv_flt_to_fltp_2ch_avx(float *const *dst, float *src, int len,
+                                        int channels);
+
 av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
 {
 #if HAVE_YASM
@@ -144,6 +149,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   6, 1, 2, "SSE", ff_conv_fltp_to_s16_6ch_sse);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
                                   2, 16, 8, "SSE", 
ff_conv_fltp_to_flt_2ch_sse);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
+                                  2, 16, 4, "SSE", 
ff_conv_flt_to_fltp_2ch_sse);
     }
     if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) {
         if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW)) {
@@ -235,6 +242,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
                                   2, 16, 8, "AVX", 
ff_conv_flt_to_s16p_2ch_avx);
         ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
                                   6, 16, 4, "AVX", 
ff_conv_flt_to_s16p_6ch_avx);
+        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
+                                  2, 16, 4, "AVX", 
ff_conv_flt_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