From eeb1e92feb67f95af32ab1dea01208200aa981b9 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 24 Jan 2010 18:18:08 +0000 Subject: [PATCH] Simplify suffix_length computation, same speed. Originally committed as revision 21430 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264_cavlc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index 9440ce03eb..e4181603fa 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -443,9 +443,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in }else{ level_code += ((level_code>>31)|1) & -(trailing_ones < 3); - suffix_length = 1; - if(level_code + 3U > 6U) - suffix_length++; + suffix_length = 1 + (level_code + 3U > 6U); level[trailing_ones]= level_code; }