summaryrefslogtreecommitdiff
path: root/libswresample/resample.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-03-20 01:40:56 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-03-20 06:01:06 +0100
commit32291ba6eaacc9d4230322361b7bfee052e72040 (patch)
tree273ea82c722ee553a30d1bd4d030c0a94d0105cc /libswresample/resample.c
parente555e1bc39ea71d46a07d0bb847fb426c2dd4d80 (diff)
swresample: add swri_resample_float_sse
At least two times faster than the C version. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/resample.c')
-rw-r--r--libswresample/resample.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 034b47ae59..581382faa6 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -302,6 +302,12 @@ static int set_compensation(ResampleContext *c, int sample_delta, int compensati
#include "resample_template.c"
#undef TEMPLATE_RESAMPLE_S16_MMX2
+#if HAVE_SSE_INLINE
+#define TEMPLATE_RESAMPLE_FLT_SSE
+#include "resample_template.c"
+#undef TEMPLATE_RESAMPLE_FLT_SSE
+#endif
+
#if HAVE_SSE2_INLINE
#define TEMPLATE_RESAMPLE_S16_SSE2
#include "resample_template.c"
@@ -328,6 +334,10 @@ static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, A
#endif
if(c->format == AV_SAMPLE_FMT_S16P) ret= swri_resample_int16(c, (int16_t*)dst->ch[i], (const int16_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
else if(c->format == AV_SAMPLE_FMT_S32P) ret= swri_resample_int32(c, (int32_t*)dst->ch[i], (const int32_t*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#if HAVE_SSE_INLINE
+ else if(c->format == AV_SAMPLE_FMT_FLTP && (mm_flags&AV_CPU_FLAG_SSE))
+ ret= swri_resample_float_sse (c, (float*)dst->ch[i], (const float*)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
+#endif
else if(c->format == AV_SAMPLE_FMT_FLTP) ret= swri_resample_float(c, (float *)dst->ch[i], (const float *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
else if(c->format == AV_SAMPLE_FMT_DBLP) ret= swri_resample_double(c,(double *)dst->ch[i], (const double *)src->ch[i], consumed, src_size, dst_size, i+1==dst->ch_count);
}