---
libavresample/x86/audio_convert.asm | 40 ++++++++++++++++++++++++++++++++
libavresample/x86/audio_convert_init.c | 11 ++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/libavresample/x86/audio_convert.asm
b/libavresample/x86/audio_convert.asm
index 34449c9..5f7f2d6 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -721,3 +721,43 @@ 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,4, 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
+ pshufd m0, m0, q3120
+ pshuflw m1, m1, q3120
+ pshufhw m1, m1, q3120
+ pshufd m1, m1, q3120
+ punpcklqdq m2, m0, m1
+ punpckhqdq m3, m0, m1
+ mova [dst0q+lenq], m2
+ mova [dst1q+lenq], m3
+ 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 6544678..13215d8 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -74,6 +74,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
@@ -118,6 +125,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,
@@ -134,6 +143,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
2, 32, 16, "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
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel