[FFmpeg-cvslog] r18672 - in trunk/libavcodec: ffv1.c snow.c

michael subversion
Fri Apr 24 02:26:49 CEST 2009


Author: michael
Date: Fri Apr 24 02:26:49 2009
New Revision: 18672

Log:
Optimize sign handling in get_symbol().

Modified:
   trunk/libavcodec/ffv1.c
   trunk/libavcodec/snow.c

Modified: trunk/libavcodec/ffv1.c
==============================================================================
--- trunk/libavcodec/ffv1.c	Fri Apr 24 01:30:16 2009	(r18671)
+++ trunk/libavcodec/ffv1.c	Fri Apr 24 02:26:49 2009	(r18672)
@@ -258,10 +258,8 @@ static inline int get_symbol(RangeCoder 
             a += a + get_rac(c, state+22 + i); //22..31
         }
 
-        if(is_signed && get_rac(c, state+11 + e)) //11..21
-            return -a;
-        else
-            return a;
+        e= -(is_signed && get_rac(c, state+11 + e)); //11..21
+        return (a^e)-e;
     }
 }
 

Modified: trunk/libavcodec/snow.c
==============================================================================
--- trunk/libavcodec/snow.c	Fri Apr 24 01:30:16 2009	(r18671)
+++ trunk/libavcodec/snow.c	Fri Apr 24 02:26:49 2009	(r18672)
@@ -665,10 +665,8 @@ static inline int get_symbol(RangeCoder 
             a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
         }
 
-        if(is_signed && get_rac(c, state+11 + FFMIN(e,10))) //11..21
-            return -a;
-        else
-            return a;
+        e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21
+        return (a^e)-e;
     }
 }
 



More information about the ffmpeg-cvslog mailing list