aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_cavlc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-24 18:17:01 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-24 18:17:01 +0000
commitc78295ad1b528be05cc66f42af1e935c9ca87072 (patch)
tree6348b261b249dd6136e8846105ded6197040c244 /libavcodec/h264_cavlc.c
parentf1d2b5728caa39172898043e05e2ade6f224056f (diff)
downloadffmpeg-c78295ad1b528be05cc66f42af1e935c9ca87072.tar.gz
Optimize level_code computation, 6cpu cycles speedup.
Originally committed as revision 21428 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_cavlc.c')
-rw-r--r--libavcodec/h264_cavlc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index c248137248..9440ce03eb 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -441,7 +441,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
mask= -(level_code&1);
level[trailing_ones]= (((2+level_code)>>1) ^ mask) - mask;
}else{
- if(trailing_ones < 3) level_code += (level_code>>31)|1;
+ level_code += ((level_code>>31)|1) & -(trailing_ones < 3);
suffix_length = 1;
if(level_code + 3U > 6U)