# HG changeset patch # User aurel # Date 1232319460 0 # Node ID f0e1ca6528d2f517435ba353800223dc7e4e2f20 # Parent 70367460f323747913167edc1884ada13ed84c21 moves mid_pred() into mathops.h (with arch specific code split by directory) diff -r 70367460f323 -r f0e1ca6528d2 common.h --- a/common.h Sun Jan 18 22:50:57 2009 +0000 +++ b/common.h Sun Jan 18 22:57:40 2009 +0000 @@ -151,47 +151,6 @@ return n; } -/* median of 3 */ -static inline av_const int mid_pred(int a, int b, int c) -{ -#if HAVE_CMOV - int i=b; - __asm__ volatile( - "cmp %2, %1 \n\t" - "cmovg %1, %0 \n\t" - "cmovg %2, %1 \n\t" - "cmp %3, %1 \n\t" - "cmovl %3, %1 \n\t" - "cmp %1, %0 \n\t" - "cmovg %1, %0 \n\t" - :"+&r"(i), "+&r"(a) - :"r"(b), "r"(c) - ); - return i; -#elif 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 -} - /** * clip a signed integer value into the amin-amax range * @param a value to clip