summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-11-03 23:26:43 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-11-03 23:35:50 +0100
commitaa48446c9a42fc29ae46ea98717f29edc7fec27d (patch)
tree6be31827acab3b331e9ce557ba6844481a14a02a
parent33d54af427f73ec926b78d7f4e43571b48bc8ea0 (diff)
downloadffmpeg-streaming-aa48446c9a42fc29ae46ea98717f29edc7fec27d.zip
ffmpeg-streaming-aa48446c9a42fc29ae46ea98717f29edc7fec27d.tar.gz
lavc/xfaceenc: prefer do{}while() over for(){} construct in xface_encode_frame() loop
Slightly simplify readability, since the initial check is unnecessary.
-rw-r--r--libavcodec/xfaceenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c
index db63f59..5206afd 100644
--- a/libavcodec/xfaceenc.c
+++ b/libavcodec/xfaceenc.c
@@ -167,14 +167,15 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* convert image from MONOWHITE to 1=black 0=white bitmap */
buf = frame->data[0];
- for (i = 0, j = 0; i < XFACE_PIXELS; ) {
+ i = j = 0;
+ do {
for (k = 0; k < 8; k++)
xface->bitmap[i++] = (buf[j]>>(7-k))&1;
if (++j == XFACE_WIDTH/8) {
buf += frame->linesize[0];
j = 0;
}
- }
+ } while (i < XFACE_PIXELS);
/* create a copy of bitmap */
memcpy(bitmap_copy, xface->bitmap, XFACE_PIXELS);
OpenPOWER on IntegriCloud