diff dsputil.c @ 7286:e267f2519248 libavcodec

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.
author lorenm
date Wed, 16 Jul 2008 00:50:12 +0000
parents fc843d00867c
children 8390efaa0c03
line wrap: on
line diff
--- a/dsputil.c	Tue Jul 15 23:04:28 2008 +0000
+++ b/dsputil.c	Wed Jul 16 00:50:12 2008 +0000
@@ -3962,17 +3962,17 @@
         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);
     }
 }