comparison smc.c @ 10193:ee31a41c5062 libavcodec

Simplify color_flags calculation, remove a pointless initialization and use AV_RB16 where possible.
author reimar
date Sat, 19 Sep 2009 11:36:51 +0000
parents 5da84f0d0a55
children 8a4984c5cacc
comparison
equal deleted inserted replaced
10192:272cac6de8ce 10193:ee31a41c5062
364 01 23 45 67 89 AB 364 01 23 45 67 89 AB
365 Mangle it to this output: 365 Mangle it to this output:
366 flags_a = xx012456, flags_b = xx89A37B 366 flags_a = xx012456, flags_b = xx89A37B
367 */ 367 */
368 /* build the color flags */ 368 /* build the color flags */
369 color_flags_a = color_flags_b = 0;
370 color_flags_a = 369 color_flags_a =
371 (s->buf[stream_ptr + 0] << 16) | 370 ((AV_RB16(s->buf + stream_ptr ) & 0xFFF0) << 8) |
372 ((s->buf[stream_ptr + 1] & 0xF0) << 8) | 371 (AV_RB16(s->buf + stream_ptr + 2) >> 4);
373 ((s->buf[stream_ptr + 2] & 0xF0) << 4) |
374 ((s->buf[stream_ptr + 2] & 0x0F) << 4) |
375 ((s->buf[stream_ptr + 3] & 0xF0) >> 4);
376 color_flags_b = 372 color_flags_b =
377 (s->buf[stream_ptr + 4] << 16) | 373 ((AV_RB16(s->buf + stream_ptr + 4) & 0xFFF0) << 8) |
378 ((s->buf[stream_ptr + 5] & 0xF0) << 8) |
379 ((s->buf[stream_ptr + 1] & 0x0F) << 8) | 374 ((s->buf[stream_ptr + 1] & 0x0F) << 8) |
380 ((s->buf[stream_ptr + 3] & 0x0F) << 4) | 375 ((s->buf[stream_ptr + 3] & 0x0F) << 4) |
381 (s->buf[stream_ptr + 5] & 0x0F); 376 (s->buf[stream_ptr + 5] & 0x0F);
382 stream_ptr += 6; 377 stream_ptr += 6;
383 378