---
libavresample/x86/audio_convert.asm | 49 ++++++++++++++++++++++++++++++++
libavresample/x86/audio_convert_init.c | 13 ++++++++
2 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/libavresample/x86/audio_convert.asm
b/libavresample/x86/audio_convert.asm
index dc34bd0..a773183 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -822,3 +822,52 @@ 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,5, 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 m4, [pf_s16_inv_scale]
+ ALIGN 16
+.loop:
+%if cpuflag(sse4)
+ pmovsxwd m0, [srcq+lenq ]
+ pmovsxwd m1, [srcq+lenq+mmsize/2]
+%else
+ mova m1, [srcq+lenq]
+ punpcklwd m0, m1
+ punpckhwd m1, m1
+ psrad m0, 16
+ psrad m1, 16
+%endif
+ cvtdq2ps m0, m0
+ cvtdq2ps m1, m1
+ mulps m0, m0, m4
+ mulps m1, m1, m4
+ shufps m2, m0, m1, q2020
+ shufps m3, m0, m1, q3131
+ mova [dst0q+lenq], m2
+ mova [dst1q+lenq], m3
+ 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 c03e2cb..3cf8da9 100644
--- a/libavresample/x86/audio_convert_init.c
+++ b/libavresample/x86/audio_convert_init.c
@@ -86,6 +86,13 @@ extern void ff_conv_s16_to_s16p_6ch_sse2(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
@@ -134,12 +141,16 @@ 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_SSE4 && HAVE_SSE) {
ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16,
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,
@@ -154,6 +165,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
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel