aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-05-02 18:27:30 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-08-23 20:10:57 -0400
commit06e751a40f327ce89eae91b808eb41463f98da66 (patch)
tree126696afd49d3503de7ce762568dbd1c9c838e12
parente07c9705c82e031bd5fb5013822cd34d571897ff (diff)
downloadffmpeg-06e751a40f327ce89eae91b808eb41463f98da66.tar.gz
lavr: x86: optimized 6-channel flt to fltp conversion
-rw-r--r--libavresample/x86/audio_convert.asm63
-rw-r--r--libavresample/x86/audio_convert_init.c9
2 files changed, 72 insertions, 0 deletions
diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm
index 98bd06b4aa..3db64d2f9b 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -1197,3 +1197,66 @@ CONV_FLT_TO_FLTP_2CH
INIT_XMM avx
CONV_FLT_TO_FLTP_2CH
%endif
+
+;------------------------------------------------------------------------------
+; void ff_conv_flt_to_fltp_6ch(float *const *dst, float *src, int len,
+; int channels);
+;------------------------------------------------------------------------------
+
+%macro CONV_FLT_TO_FLTP_6CH 0
+%if ARCH_X86_64
+cglobal conv_flt_to_fltp_6ch, 3,8,7, dst, src, len, dst1, dst2, dst3, dst4, dst5
+%else
+cglobal conv_flt_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
+%define lend dword r2m
+%endif
+ mov dst1q, [dstq+ gprsize]
+ mov dst2q, [dstq+2*gprsize]
+ mov dst3q, [dstq+3*gprsize]
+ mov dst4q, [dstq+4*gprsize]
+ mov dst5q, [dstq+5*gprsize]
+ mov dstq, [dstq ]
+ sub dst1q, dstq
+ sub dst2q, dstq
+ sub dst3q, dstq
+ sub dst4q, dstq
+ sub dst5q, dstq
+.loop:
+ mova m0, [srcq+0*mmsize] ; m0 = 0, 1, 2, 3
+ mova m1, [srcq+1*mmsize] ; m1 = 4, 5, 6, 7
+ mova m2, [srcq+2*mmsize] ; m2 = 8, 9, 10, 11
+ mova m3, [srcq+3*mmsize] ; m3 = 12, 13, 14, 15
+ mova m4, [srcq+4*mmsize] ; m4 = 16, 17, 18, 19
+ mova m5, [srcq+5*mmsize] ; m5 = 20, 21, 22, 23
+
+ SBUTTERFLY2 dq, 0, 3, 6 ; m0 = 0, 12, 1, 13
+ ; m3 = 2, 14, 3, 15
+ SBUTTERFLY2 dq, 1, 4, 6 ; m1 = 4, 16, 5, 17
+ ; m4 = 6, 18, 7, 19
+ SBUTTERFLY2 dq, 2, 5, 6 ; m2 = 8, 20, 9, 21
+ ; m5 = 10, 22, 11, 23
+ SBUTTERFLY2 dq, 0, 4, 6 ; m0 = 0, 6, 12, 18
+ ; m4 = 1, 7, 13, 19
+ SBUTTERFLY2 dq, 3, 2, 6 ; m3 = 2, 8, 14, 20
+ ; m2 = 3, 9, 15, 21
+ SBUTTERFLY2 dq, 1, 5, 6 ; m1 = 4, 10, 16, 22
+ ; m5 = 5, 11, 17, 23
+ mova [dstq ], m0
+ mova [dstq+dst1q], m4
+ mova [dstq+dst2q], m3
+ mova [dstq+dst3q], m2
+ mova [dstq+dst4q], m1
+ mova [dstq+dst5q], m5
+ add srcq, mmsize*6
+ add dstq, mmsize
+ sub lend, mmsize/4
+ jg .loop
+ REP_RET
+%endmacro
+
+INIT_XMM sse2
+CONV_FLT_TO_FLTP_6CH
+%if HAVE_AVX
+INIT_XMM avx
+CONV_FLT_TO_FLTP_6CH
+%endif
diff --git a/libavresample/x86/audio_convert_init.c b/libavresample/x86/audio_convert_init.c
index a9fd63074a..a3589c6957 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -137,6 +137,11 @@ extern void ff_conv_flt_to_fltp_2ch_sse(float *const *dst, float *src, int len,
extern void ff_conv_flt_to_fltp_2ch_avx(float *const *dst, float *src, int len,
int channels);
+extern void ff_conv_flt_to_fltp_6ch_sse2(float *const *dst, float *src, int len,
+ int channels);
+extern void ff_conv_flt_to_fltp_6ch_avx (float *const *dst, float *src, int len,
+ int channels);
+
av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
{
#if HAVE_YASM
@@ -198,6 +203,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
2, 16, 8, "SSE2", ff_conv_flt_to_s16p_2ch_sse2);
ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
6, 16, 4, "SSE2", ff_conv_flt_to_s16p_6ch_sse2);
+ ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
+ 6, 16, 4, "SSE2", ff_conv_flt_to_fltp_6ch_sse2);
}
if (mm_flags & AV_CPU_FLAG_SSSE3 && HAVE_SSE) {
ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
@@ -250,6 +257,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
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);
+ ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
+ 6, 16, 4, "AVX", ff_conv_flt_to_fltp_6ch_avx);
}
#endif
}