summaryrefslogtreecommitdiff
path: root/libavcodec/i386
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2008-07-16 00:50:12 +0000
committerLoren Merritt <lorenm@u.washington.edu>2008-07-16 00:50:12 +0000
commit5eb0f2a425b6e1e0f821b52972b7af75de3480e2 (patch)
treec9c2a4f69dbb2b5c37e887cbc55e3c6479af108d /libavcodec/i386
parent633d9def9d53de2ccc1116936f6b1d250b8fd055 (diff)
float_to_int16_interleave: change src to an array of pointers instead of assuming it's contiguous.
this has no immediate effect, but will allow it to be used in more codecs. Originally committed as revision 14252 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/i386')
-rw-r--r--libavcodec/i386/dsputil_mmx.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c
index c507023936..90865e80c7 100644
--- a/libavcodec/i386/dsputil_mmx.c
+++ b/libavcodec/i386/dsputil_mmx.c
@@ -2156,32 +2156,32 @@ static void float_to_int16_sse2(int16_t *dst, const float *src, long len){
#define FLOAT_TO_INT16_INTERLEAVE(cpu, body) \
/* gcc pessimizes register allocation if this is in the same function as float_to_int16_interleave_sse2*/\
-static av_noinline void float_to_int16_interleave2_##cpu(int16_t *dst, const float *src, long len, int channels){\
- DECLARE_ALIGNED_16(int16_t, tmp[len*channels]);\
+static av_noinline void float_to_int16_interleave2_##cpu(int16_t *dst, const float **src, long len, int channels){\
+ DECLARE_ALIGNED_16(int16_t, tmp[len]);\
int i,j,c;\
- float_to_int16_##cpu(tmp, src, len*channels);\
for(c=0; c<channels; c++){\
- int16_t *ptmp = tmp+c*len;\
+ float_to_int16_##cpu(tmp, src[c], len);\
for(i=0, j=c; i<len; i++, j+=channels)\
- dst[j] = ptmp[i];\
+ dst[j] = tmp[i];\
}\
}\
\
-static void float_to_int16_interleave_##cpu(int16_t *dst, const float *src, long len, int channels){\
+static void float_to_int16_interleave_##cpu(int16_t *dst, const float **src, long len, int channels){\
if(channels==1)\
- float_to_int16_##cpu(dst, src, len);\
+ float_to_int16_##cpu(dst, src[0], len);\
else if(channels>2)\
float_to_int16_interleave2_##cpu(dst, src, len, channels);\
else{\
- float *src1;\
+ const float *src0 = src[0];\
+ const float *src1 = src[1];\
asm volatile(\
"shl $2, %0 \n"\
"add %0, %1 \n"\
"add %0, %2 \n"\
- "lea (%2,%0), %3 \n"\
+ "add %0, %3 \n"\
"neg %0 \n"\
body\
- :"+r"(len), "+r"(dst), "+r"(src), "=r"(src1)\
+ :"+r"(len), "+r"(dst), "+r"(src0), "+r"(src1)\
);\
}\
}