comparison interplayvideo.c @ 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 5d20b2610662
comparison
equal deleted inserted replaced
9306:7a546836b61b 9307:851ca5db8327
210 210
211 /* need 8 more bytes from the stream */ 211 /* need 8 more bytes from the stream */
212 CHECK_STREAM_PTR(8); 212 CHECK_STREAM_PTR(8);
213 213
214 for (y = 0; y < 8; y++) { 214 for (y = 0; y < 8; y++) {
215 flags = *s->stream_ptr++; 215 flags = *s->stream_ptr++ | 0x100;
216 for (x = 0x01; x <= 0x80; x <<= 1) { 216 for (; flags != 1; flags >>= 1) {
217 *s->pixel_ptr++ = P[!!(flags & x)]; 217 *s->pixel_ptr++ = P[flags & 1];
218 } 218 }
219 s->pixel_ptr += s->line_inc; 219 s->pixel_ptr += s->line_inc;
220 } 220 }
221 221
222 } else { 222 } else {
352 } else { 352 } else {
353 353
354 /* horizontal split; top & bottom halves are 2-color encoded */ 354 /* horizontal split; top & bottom halves are 2-color encoded */
355 355
356 for (y = 0; y < 8; y++) { 356 for (y = 0; y < 8; y++) {
357 int bitmask;
358
359 if (y == 4) { 357 if (y == 4) {
360 P[0] = *s->stream_ptr++; 358 P[0] = *s->stream_ptr++;
361 P[1] = *s->stream_ptr++; 359 P[1] = *s->stream_ptr++;
362 } 360 }
363 flags = *s->stream_ptr++; 361 flags = *s->stream_ptr++ | 0x100;
364 362
365 for (bitmask = 0x01; bitmask <= 0x80; bitmask <<= 1) { 363 for (; flags != 1; flags >>= 1) {
366 364
367 *s->pixel_ptr++ = P[!!(flags & bitmask)]; 365 *s->pixel_ptr++ = P[flags & 1];
368 } 366 }
369 s->pixel_ptr += s->line_inc; 367 s->pixel_ptr += s->line_inc;
370 } 368 }
371 } 369 }
372 } 370 }