]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Use / and % operators instead of reimplementing them with a loop.
authorreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 17 Apr 2009 19:56:50 +0000 (19:56 +0000)
committerreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 17 Apr 2009 19:56:50 +0000 (19:56 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18597 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/xan.c

index b5303eb38bf1dfd039de880c8906e7e79d68befb..4152ff4540e3836b9b07c9650d5d6a6ee13fd684 100644 (file)
@@ -351,16 +351,8 @@ static void xan_wc3_decode_frame(XanContext *s) {
 
         /* 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;
     }
 }