History

Avoid the last two uses of bitmasks in interplayvideo

Originally committed as revision 18272 to svn://svn.ffmpeg.org/ffmpeg/trunk

Reimar Döffinger committed 17 years ago

Commit f02bd7e1 parent 3f300d71 file · +6 −8Browse files

Unified · Split

libavcodec/interplayvideo.c+6−8
@@ -212,9 +212,9 @@ static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s) · 211 unmodified lines
212212 CHECK_STREAM_PTR(8);
213213
214214 for (y = 0; y < 8; y++) {
215− flags = *s->stream_ptr++;
216− for (x = 0x01; x <= 0x80; x <<= 1) {
217− *s->pixel_ptr++ = P[!!(flags & x)];
215+ flags = *s->stream_ptr++ | 0x100;
216+ for (; flags != 1; flags >>= 1) {
217+ *s->pixel_ptr++ = P[flags & 1];
218218 }
219219 s->pixel_ptr += s->line_inc;
220220 }
@@ -354,17 +354,15 @@ static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s) · 133 unmodified lines
354354 /* horizontal split; top & bottom halves are 2-color encoded */
355355
356356 for (y = 0; y < 8; y++) {
357− int bitmask;
358−
359357 if (y == 4) {
360358 P[0] = *s->stream_ptr++;
361359 P[1] = *s->stream_ptr++;
362360 }
363− flags = *s->stream_ptr++;
361+ flags = *s->stream_ptr++ | 0x100;
364362
365− for (bitmask = 0x01; bitmask <= 0x80; bitmask <<= 1) {
363+ for (; flags != 1; flags >>= 1) {
366364
367− *s->pixel_ptr++ = P[!!(flags & bitmask)];
365+ *s->pixel_ptr++ = P[flags & 1];
368366 }
369367 s->pixel_ptr += s->line_inc;
370368 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t