diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-03-31 14:48:14 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-03-31 14:48:14 +0000 |
commit | f02bd7e49c163564d7955b3c8b0bc2c907ec7fd7 (patch) | |
tree | 6f4cc1afa4696e656d9dae44d11fcbe7cac23a03 | |
parent | 3f300d7e25e2cd9153995b7b2101bc06abb72152 (diff) | |
download | ffmpeg-f02bd7e49c163564d7955b3c8b0bc2c907ec7fd7.tar.gz |
Avoid the last two uses of bitmasks in interplayvideo
Originally committed as revision 18272 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/interplayvideo.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 07f73bb4d2..3062339d00 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -212,9 +212,9 @@ static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s) 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 @@ static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s) /* 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; } |