Skip to content
Snippets Groups Projects
Commit 7a62e94a authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

optimization

Originally committed as revision 2720 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 83f8c0c3
No related branches found
No related tags found
No related merge requests found
...@@ -1012,23 +1012,31 @@ static inline int av_log2_16bit(unsigned int v) ...@@ -1012,23 +1012,31 @@ static inline int av_log2_16bit(unsigned int v)
return n; return n;
} }
/* median of 3 */ /* median of 3 */
static inline int mid_pred(int a, int b, int c) static inline int mid_pred(int a, int b, int c)
{ {
int vmin, vmax; #if 0
vmax = vmin = a; int t= (a-b)&((a-b)>>31);
if (b < vmin) a-=t;
vmin = b; b+=t;
else b-= (b-c)&((b-c)>>31);
vmax = b; b+= (a-b)&((a-b)>>31);
if (c < vmin) return b;
vmin = c; #else
else if (c > vmax) if(a>b){
vmax = c; if(c>b){
if(c>a) b=a;
return a + b + c - vmin - vmax; 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) static inline int clip(int a, int amin, int amax)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment