[FFmpeg-cvslog] r21510 - trunk/libavcodec/acelp_vectors.c

rbultje subversion
Thu Jan 28 15:29:53 CET 2010


Author: rbultje
Date: Thu Jan 28 15:29:53 2010
New Revision: 21510

Log:
Simplify. See "[PATCH] simplify ff_set_fixed_vector()" thread on mailinglist.

Modified:
   trunk/libavcodec/acelp_vectors.c

Modified: trunk/libavcodec/acelp_vectors.c
==============================================================================
--- trunk/libavcodec/acelp_vectors.c	Thu Jan 28 14:06:31 2010	(r21509)
+++ trunk/libavcodec/acelp_vectors.c	Thu Jan 28 15:29:53 2010	(r21510)
@@ -245,14 +245,12 @@ void ff_set_fixed_vector(float *out, con
     for (i=0; i < in->n; i++) {
         int x   = in->x[i];
         float y = in->y[i] * scale;
-        out[x] += y;
 
-        x += in->pitch_lag;
-        while (x < size) {
-            y *= in->pitch_fac;
+        do {
             out[x] += y;
+            y *= in->pitch_fac;
             x += in->pitch_lag;
-        }
+        } while (x < size);
     }
 }
 
@@ -262,12 +260,10 @@ void ff_clear_fixed_vector(float *out, c
 
     for (i=0; i < in->n; i++) {
         int x  = in->x[i];
-        out[x] = 0.0;
 
-        x += in->pitch_lag;
-        while (x < size) {
+        do {
             out[x] = 0.0;
             x += in->pitch_lag;
-        }
+        } while (x < size);
     }
 }



More information about the ffmpeg-cvslog mailing list