From 977d813447a023b508e148b990445756faf3e393 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Fri, 17 Apr 2009 19:56:50 +0000 Subject: Use / and % operators instead of reimplementing them with a loop. Originally committed as revision 18597 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/xan.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'libavcodec/xan.c') diff --git a/libavcodec/xan.c b/libavcodec/xan.c index b5303eb38b..4152ff4540 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -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; } } -- cgit v1.2.3