[FFmpeg-cvslog] r22719 - trunk/libavcodec/wmaprodec.c

rbultje subversion
Mon Mar 29 19:37:03 CEST 2010


Author: rbultje
Date: Mon Mar 29 19:37:03 2010
New Revision: 22719

Log:
Simplify interleaving code.

Modified:
   trunk/libavcodec/wmaprodec.c

Modified: trunk/libavcodec/wmaprodec.c
==============================================================================
--- trunk/libavcodec/wmaprodec.c	Mon Mar 29 19:36:08 2010	(r22718)
+++ trunk/libavcodec/wmaprodec.c	Mon Mar 29 19:37:03 2010	(r22719)
@@ -1346,14 +1346,12 @@ static int decode_frame(WMAProDecodeCtx 
 
     /** interleave samples and write them to the output buffer */
     for (i = 0; i < s->num_channels; i++) {
-        float* ptr;
+        float* ptr  = s->samples + i;
         int incr = s->num_channels;
         float* iptr = s->channel[i].out;
-        int x;
-
-        ptr = s->samples + i;
+        float* iend = iptr + s->samples_per_frame;
 
-        for (x = 0; x < s->samples_per_frame; x++) {
+        while (iptr < iend) {
             *ptr = av_clipf(*iptr++, -1.0, 32767.0 / 32768.0);
             ptr += incr;
         }



More information about the ffmpeg-cvslog mailing list