[FFmpeg-cvslog] r18597 - trunk/libavcodec/xan.c

reimar subversion
Fri Apr 17 21:56:50 CEST 2009


Author: reimar
Date: Fri Apr 17 21:56:50 2009
New Revision: 18597

Log:
Use / and % operators instead of reimplementing them with a loop.

Modified:
   trunk/libavcodec/xan.c

Modified: trunk/libavcodec/xan.c
==============================================================================
--- trunk/libavcodec/xan.c	Fri Apr 17 21:49:55 2009	(r18596)
+++ trunk/libavcodec/xan.c	Fri Apr 17 21:56:50 2009	(r18597)
@@ -351,16 +351,8 @@ static void xan_wc3_decode_frame(XanCont
 
         /* coordinate accounting */
         total_pixels -= size;
-        while (size) {
-            if (x + size >= width) {
-                y++;
-                size -= (width - x);
-                x = 0;
-            } else {
-                x += size;
-                size = 0;
-            }
-        }
+        y += (x + size) / width;
+        x  = (x + size) % width;
     }
 }
 



More information about the ffmpeg-cvslog mailing list