mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
lavc/xfaceenc: prefer do{}while() over for(){} construct in xface_encode_frame() loop
Slightly simplify readability, since the initial check is unnecessary.
This commit is contained in:
parent
33d54af427
commit
aa48446c9a
@ -167,14 +167,15 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
|
|
||||||
/* convert image from MONOWHITE to 1=black 0=white bitmap */
|
/* convert image from MONOWHITE to 1=black 0=white bitmap */
|
||||||
buf = frame->data[0];
|
buf = frame->data[0];
|
||||||
for (i = 0, j = 0; i < XFACE_PIXELS; ) {
|
i = j = 0;
|
||||||
|
do {
|
||||||
for (k = 0; k < 8; k++)
|
for (k = 0; k < 8; k++)
|
||||||
xface->bitmap[i++] = (buf[j]>>(7-k))&1;
|
xface->bitmap[i++] = (buf[j]>>(7-k))&1;
|
||||||
if (++j == XFACE_WIDTH/8) {
|
if (++j == XFACE_WIDTH/8) {
|
||||||
buf += frame->linesize[0];
|
buf += frame->linesize[0];
|
||||||
j = 0;
|
j = 0;
|
||||||
}
|
}
|
||||||
}
|
} while (i < XFACE_PIXELS);
|
||||||
|
|
||||||
/* create a copy of bitmap */
|
/* create a copy of bitmap */
|
||||||
memcpy(bitmap_copy, xface->bitmap, XFACE_PIXELS);
|
memcpy(bitmap_copy, xface->bitmap, XFACE_PIXELS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user