changeset 10993:3932fd1a1c25 libavcodec

Optimize level_code computation, 6cpu cycles speedup.
author michael
date Sun, 24 Jan 2010 18:17:01 +0000
parents 9aae10c862f7
children 2179ea01df62
files h264_cavlc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264_cavlc.c	Sun Jan 24 18:07:29 2010 +0000
+++ b/h264_cavlc.c	Sun Jan 24 18:17:01 2010 +0000
@@ -441,7 +441,7 @@
             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)