---
libavresample/x86/audio_convert.asm | 55 ++++++++++++++++++++++++++++++++
libavresample/x86/audio_convert_init.c | 5 +++
2 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/libavresample/x86/audio_convert.asm
b/libavresample/x86/audio_convert.asm
index c14f4ef..8159188 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -261,6 +261,61 @@ cglobal conv_s16p_to_s16_2ch, 3,4,5, dst, src, len, src1
jg .loop
REP_RET
+;------------------------------------------------------------------------------
+; void ff_conv_s16p_to_s16_6ch(int16_t *dst, int16_t *const *src, int len,
+; int channels);
+;------------------------------------------------------------------------------
+
+INIT_XMM sse2
+cglobal conv_s16p_to_s16_6ch, 2,8,6, dst, src, src1, src2, src3, src4, src5,
len
+%if ARCH_X86_64
+ mov lend, r2d
+%else
+ %define lend dword r2m
+%endif
+ mov src1q, [srcq+1*gprsize]
+ mov src2q, [srcq+2*gprsize]
+ mov src3q, [srcq+3*gprsize]
+ mov src4q, [srcq+4*gprsize]
+ mov src5q, [srcq+5*gprsize]
+ mov srcq, [srcq]
+ sub src1q, srcq
+ sub src2q, srcq
+ sub src3q, srcq
+ sub src4q, srcq
+ sub src5q, srcq
+.loop:
+ movlpd m0, [srcq ]
+ movlpd m1, [srcq+src1q]
+ movlpd m2, [srcq+src2q]
+ movhpd m0, [srcq+src3q] ; m0 = 0, 6, 12, 18, 3, 9, 15, 21
+ movhpd m1, [srcq+src4q] ; m1 = 1, 7, 13, 19, 4, 10, 16, 22
+ movhpd m2, [srcq+src5q] ; m2 = 2, 8, 14, 20, 5, 11, 17, 23
+ ; unpack words:
+ movhlps m3, m0 ; m3 = 3, 9, 15, 21, x, x, x, x
+ punpcklwd m0, m1 ; m0 = 0, 1, 6, 7, 12, 13, 18, 19
+ punpckhwd m1, m2 ; m1 = 4, 5, 10, 11, 16, 17, 22, 23
+ punpcklwd m2, m3 ; m2 = 2, 3, 8, 9, 14, 15, 20, 21
+ ; unpack dwords:
+ punpckhdq m3, m0, m2 ; m3 = 12, 13, 14, 15, 18, 19, 20, 21
+ punpckldq m2, m1 ; m2 = 2, 3, 4, 5, 8, 9, 10, 11
+ ; shuffle qwords:
+ movhlps m4, m2 ; m4 = 8, 9, 10, 11, x, x, x, x
+ movlhps m4, m3 ; m4 = 8, 9, 10, 11, 12, 13, 14, 15 (final)
+ movlhps m2, m0 ; m2 = 2, 3, 4, 5, 0, 1, 6, 7
+ movhlps m3, m1 ; m3 = 16, 17, 22, 23, 18, 19, 20, 21
+ ; shuffle dwords:
+ pshufd m2, m2, q3102 ; m2 = 0, 1, 2, 3, 4, 5, 6, 7 (final)
+ pshufd m3, m3, q1320 ; m3 = 16, 17, 18, 19, 20, 21, 22, 23 (final)
+ mova [dstq ], m2
+ mova [dstq+16], m4
+ mova [dstq+32], m3
+ add srcq, mmsize/2
+ add dstq, mmsize*3
+ sub lend, mmsize/4
+ jg .loop
+ REP_RET
+
;-----------------------------------------------------------------------------
; void ff_conv_fltp_to_flt_6ch(float *dst, float *const *src, int len,
; int channels);
diff --git a/libavresample/x86/audio_convert_init.c
b/libavresample/x86/audio_convert_init.c
index 8c75f74..e4708de 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -45,6 +45,9 @@ extern void ff_conv_flt_to_s32_avx (int32_t *dst, const float
*src, int len);
extern void ff_conv_s16p_to_s16_2ch_sse2(int16_t *dst, int16_t *const *src,
int len, int channels);
+extern void ff_conv_s16p_to_s16_6ch_sse2(int16_t *dst, int16_t *const *src,
+ int len, int channels);
+
extern void ff_conv_fltp_to_flt_6ch_mmx (float *dst, float *const *src, int
len,
int channels);
extern void ff_conv_fltp_to_flt_6ch_sse4(float *dst, float *const *src, int
len,
@@ -80,6 +83,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
0, 16, 16, "SSE2", ff_conv_flt_to_s32_sse2);
ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
2, 16, 16, "SSE2",
ff_conv_s16p_to_s16_2ch_sse2);
+ ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
+ 6, 16, 8, "SSE2",
ff_conv_s16p_to_s16_6ch_sse2);
}
if (mm_flags & AV_CPU_FLAG_SSE4 && HAVE_SSE) {
ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16,
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel