[SCM] libav/experimental: optimization

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:39:01 UTC 2013


The following commit has been merged in the experimental branch:
commit 7a62e94a269d9b8993f5987d1a0895bc348c52a8
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Sat Jan 24 22:22:42 2004 +0000

    optimization
    
    Originally committed as revision 2720 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/common.h b/libavcodec/common.h
index e0e9022..2440e5f 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -1012,23 +1012,31 @@ static inline int av_log2_16bit(unsigned int v)
     return n;
 }
 
-
 /* median of 3 */
 static inline int mid_pred(int a, int b, int c)
 {
-    int vmin, vmax;
-    vmax = vmin = a;
-    if (b < vmin)
-        vmin = b;
-    else
-	vmax = b;
-
-    if (c < vmin)
-        vmin = c;
-    else if (c > vmax)
-        vmax = c;
-
-    return a + b + c - vmin - vmax;
+#if 0
+    int t= (a-b)&((a-b)>>31);
+    a-=t;
+    b+=t;
+    b-= (b-c)&((b-c)>>31);
+    b+= (a-b)&((a-b)>>31);
+
+    return b;
+#else
+    if(a>b){
+        if(c>b){
+            if(c>a) b=a;
+            else    b=c;
+        }
+    }else{
+        if(b>c){
+            if(c>a) b=c;
+            else    b=a;
+        }
+    }
+    return b;
+#endif
 }
 
 static inline int clip(int a, int amin, int amax)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list