summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-01-24 22:22:42 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-01-24 22:22:42 +0000
commit7a62e94a269d9b8993f5987d1a0895bc348c52a8 (patch)
tree3311a90cb4c1779281e56f56a9b9aba0e7b757e5 /libavcodec
parent83f8c0c3c83b8739187c226fea5e59a07e08a7b6 (diff)
optimization
Originally committed as revision 2720 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/common.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index e0e90225c0..2440e5f095 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)