diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2008-07-16 00:50:12 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2008-07-16 00:50:12 +0000 |
commit | 5eb0f2a425b6e1e0f821b52972b7af75de3480e2 (patch) | |
tree | c9c2a4f69dbb2b5c37e887cbc55e3c6479af108d /libavcodec/dsputil.c | |
parent | 633d9def9d53de2ccc1116936f6b1d250b8fd055 (diff) | |
download | ffmpeg-streaming-5eb0f2a425b6e1e0f821b52972b7af75de3480e2.zip ffmpeg-streaming-5eb0f2a425b6e1e0f821b52972b7af75de3480e2.tar.gz |
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/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 212e241..a9661eb 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -3962,17 +3962,17 @@ void ff_float_to_int16_c(int16_t *dst, const float *src, long len){ dst[i] = float_to_int16_one(src+i); } -void ff_float_to_int16_interleave_c(int16_t *dst, const float *src, long len, int channels){ +void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels){ int i,j,c; if(channels==2){ for(i=0; i<len; i++){ - dst[2*i] = float_to_int16_one(src+i); - dst[2*i+1] = float_to_int16_one(src+i+len); + dst[2*i] = float_to_int16_one(src[0]+i); + dst[2*i+1] = float_to_int16_one(src[1]+i); } }else{ - for(c=0; c<channels; c++, src+=len) + for(c=0; c<channels; c++) for(i=0, j=c; i<len; i++, j+=channels) - dst[j] = float_to_int16_one(src+i); + dst[j] = float_to_int16_one(src[c]+i); } } |