1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavr: x86: optimized 2-channel fltp to flt conversion

This commit is contained in:
Justin Ruggles 2012-05-02 16:32:08 -04:00
parent d5b4e50c47
commit b66e20d2aa
2 changed files with 44 additions and 0 deletions

View File

@ -695,6 +695,43 @@ INIT_XMM avx
CONV_FLTP_TO_S16_6CH
%endif
;------------------------------------------------------------------------------
; void ff_conv_fltp_to_flt_2ch(float *dst, float *const *src, int len,
; int channels);
;------------------------------------------------------------------------------
%macro CONV_FLTP_TO_FLT_2CH 0
cglobal conv_fltp_to_flt_2ch, 3,4,5, dst, src0, len, src1
mov src1q, [src0q+gprsize]
mov src0q, [src0q]
lea lenq, [4*lend]
add src0q, lenq
add src1q, lenq
lea dstq, [dstq+2*lenq]
neg lenq
.loop
mova m0, [src0q+lenq ]
mova m1, [src1q+lenq ]
mova m2, [src0q+lenq+mmsize]
mova m3, [src1q+lenq+mmsize]
SBUTTERFLYPS 0, 1, 4
SBUTTERFLYPS 2, 3, 4
mova [dstq+2*lenq+0*mmsize], m0
mova [dstq+2*lenq+1*mmsize], m1
mova [dstq+2*lenq+2*mmsize], m2
mova [dstq+2*lenq+3*mmsize], m3
add lenq, 2*mmsize
jl .loop
REP_RET
%endmacro
INIT_XMM sse
CONV_FLTP_TO_FLT_2CH
%if HAVE_AVX
INIT_XMM avx
CONV_FLTP_TO_FLT_2CH
%endif
;-----------------------------------------------------------------------------
; void ff_conv_fltp_to_flt_6ch(float *dst, float *const *src, int len,
; int channels);

View File

@ -78,6 +78,11 @@ extern void ff_conv_fltp_to_s16_6ch_sse2(int16_t *dst, float *const *src,
extern void ff_conv_fltp_to_s16_6ch_avx (int16_t *dst, float *const *src,
int len, int channels);
extern void ff_conv_fltp_to_flt_2ch_sse(float *dst, float *const *src, int len,
int channels);
extern void ff_conv_fltp_to_flt_2ch_avx(float *dst, float *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,
@ -99,6 +104,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) {
ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
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);
}
if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) {
if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW)) {