From 199436b952c198e14d53a389438e232ef60f1982 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Sun, 18 Jan 2009 22:57:40 +0000 Subject: moves mid_pred() into mathops.h (with arch specific code split by directory) Originally committed as revision 16681 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mathops.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'libavcodec/mathops.h') diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 9ef62cfb31..33e8cd6aec 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -83,5 +83,35 @@ static av_always_inline int MULH(int a, int b){ # define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb)) #endif +/* median of 3 */ +#ifndef mid_pred +#define mid_pred mid_pred +static inline av_const int mid_pred(int a, int b, int c) +{ +#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 +} +#endif + #endif /* AVCODEC_MATHOPS_H */ -- cgit v1.2.3