diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-06-14 15:03:08 +0100 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-06-30 19:10:36 +0300 |
commit | 66a02159ea9a09965dfa3e06ea55f41e5f615f90 (patch) | |
tree | b63b5e33ae77e19bc029fd09246bd9a275172a09 /libavcodec/x86/fmtconvert_mmx.c | |
parent | 4f2c846d9644640cd881b7a7a48d1785a52f5c25 (diff) | |
download | ffmpeg-66a02159ea9a09965dfa3e06ea55f41e5f615f90.tar.gz |
x86: fmtconvert: add special asm for float_to_int16_interleave_misc_*
This gets rid of a variable-length array and a for loop in C code.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/x86/fmtconvert_mmx.c')
-rw-r--r-- | libavcodec/x86/fmtconvert_mmx.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/x86/fmtconvert_mmx.c b/libavcodec/x86/fmtconvert_mmx.c index 42cb0bc85b..aaf634d37f 100644 --- a/libavcodec/x86/fmtconvert_mmx.c +++ b/libavcodec/x86/fmtconvert_mmx.c @@ -25,6 +25,7 @@ #include "libavutil/cpu.h" #include "libavutil/x86_cpu.h" #include "libavcodec/fmtconvert.h" +#include "libavcodec/dsputil.h" #if HAVE_YASM @@ -35,6 +36,10 @@ void ff_float_to_int16_3dnow(int16_t *dst, const float *src, long len); void ff_float_to_int16_sse (int16_t *dst, const float *src, long len); void ff_float_to_int16_sse2 (int16_t *dst, const float *src, long len); +void ff_float_to_int16_step_3dnow(int16_t *dst, const float *src, long len, long step); +void ff_float_to_int16_step_sse (int16_t *dst, const float *src, long len, long step); +void ff_float_to_int16_step_sse2 (int16_t *dst, const float *src, long len, long step); + void ff_float_to_int16_interleave2_3dnow(int16_t *dst, const float **src, long len); void ff_float_to_int16_interleave2_sse (int16_t *dst, const float **src, long len); void ff_float_to_int16_interleave2_sse2 (int16_t *dst, const float **src, long len); @@ -48,12 +53,9 @@ void ff_float_to_int16_interleave6_3dn2(int16_t *dst, const float **src, int len #define FLOAT_TO_INT16_INTERLEAVE(cpu) \ /* gcc pessimizes register allocation if this is in the same function as float_to_int16_interleave_sse2*/\ static av_noinline void float_to_int16_interleave_misc_##cpu(int16_t *dst, const float **src, long len, int channels){\ - DECLARE_ALIGNED(16, int16_t, tmp)[len];\ - int i,j,c;\ + int c;\ for(c=0; c<channels; c++){\ - ff_float_to_int16_##cpu(tmp, src[c], len);\ - for(i=0, j=c; i<len; i++, j+=channels)\ - dst[j] = tmp[i];\ + ff_float_to_int16_step_##cpu(dst+c, src[c], len, channels);\ }\ }\ \ |