From bdb156c7b1d9e6899b915c355c547009c54e6e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 19 Sep 2009 11:36:51 +0000 Subject: [PATCH] Simplify color_flags calculation, remove a pointless initialization and use AV_RB16 where possible. Originally committed as revision 19925 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/smc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 0153f0c71b..f63dc1e6ac 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -366,16 +366,11 @@ static void smc_decode_stream(SmcContext *s) flags_a = xx012456, flags_b = xx89A37B */ /* build the color flags */ - color_flags_a = color_flags_b = 0; color_flags_a = - (s->buf[stream_ptr + 0] << 16) | - ((s->buf[stream_ptr + 1] & 0xF0) << 8) | - ((s->buf[stream_ptr + 2] & 0xF0) << 4) | - ((s->buf[stream_ptr + 2] & 0x0F) << 4) | - ((s->buf[stream_ptr + 3] & 0xF0) >> 4); + ((AV_RB16(s->buf + stream_ptr ) & 0xFFF0) << 8) | + (AV_RB16(s->buf + stream_ptr + 2) >> 4); color_flags_b = - (s->buf[stream_ptr + 4] << 16) | - ((s->buf[stream_ptr + 5] & 0xF0) << 8) | + ((AV_RB16(s->buf + stream_ptr + 4) & 0xFFF0) << 8) | ((s->buf[stream_ptr + 1] & 0x0F) << 8) | ((s->buf[stream_ptr + 3] & 0x0F) << 4) | (s->buf[stream_ptr + 5] & 0x0F);