Mercurial > libavcodec.hg
changeset 9307:851ca5db8327 libavcodec
Avoid the last two uses of bitmasks in interplayvideo
author | reimar |
---|---|
date | Tue, 31 Mar 2009 14:48:14 +0000 |
parents | 7a546836b61b |
children | aad816bc3d54 |
files | interplayvideo.c |
diffstat | 1 files changed, 6 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/interplayvideo.c Tue Mar 31 14:44:46 2009 +0000 +++ b/interplayvideo.c Tue Mar 31 14:48:14 2009 +0000 @@ -212,9 +212,9 @@ CHECK_STREAM_PTR(8); for (y = 0; y < 8; y++) { - flags = *s->stream_ptr++; - for (x = 0x01; x <= 0x80; x <<= 1) { - *s->pixel_ptr++ = P[!!(flags & x)]; + flags = *s->stream_ptr++ | 0x100; + for (; flags != 1; flags >>= 1) { + *s->pixel_ptr++ = P[flags & 1]; } s->pixel_ptr += s->line_inc; } @@ -354,17 +354,15 @@ /* horizontal split; top & bottom halves are 2-color encoded */ for (y = 0; y < 8; y++) { - int bitmask; - if (y == 4) { P[0] = *s->stream_ptr++; P[1] = *s->stream_ptr++; } - flags = *s->stream_ptr++; + flags = *s->stream_ptr++ | 0x100; - for (bitmask = 0x01; bitmask <= 0x80; bitmask <<= 1) { + for (; flags != 1; flags >>= 1) { - *s->pixel_ptr++ = P[!!(flags & bitmask)]; + *s->pixel_ptr++ = P[flags & 1]; } s->pixel_ptr += s->line_inc; }