summaryrefslogtreecommitdiff
path: root/libavcodec/xan.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-17 19:56:50 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-17 19:56:50 +0000
commit977d813447a023b508e148b990445756faf3e393 (patch)
treeb1c2b84642f864aaecdb9fcfbbabddb98647b499 /libavcodec/xan.c
parentb1e309865f6b4f67841c811faa5022e492095906 (diff)
Use / and % operators instead of reimplementing them with a loop.
Originally committed as revision 18597 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r--libavcodec/xan.c12
1 files changed, 2 insertions, 10 deletions
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;
}
}