comparison mathops.h @ 8627:d6bab465b82c libavcodec

moves mid_pred() into mathops.h (with arch specific code split by directory)
author aurel
date Sun, 18 Jan 2009 22:57:40 +0000
parents 7a463923ecd1
children 04423b2f6e0b
comparison
equal deleted inserted replaced
8626:8d425ee85ddb 8627:d6bab465b82c
81 81
82 #ifndef MLS16 82 #ifndef MLS16
83 # define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb)) 83 # define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb))
84 #endif 84 #endif
85 85
86 /* median of 3 */
87 #ifndef mid_pred
88 #define mid_pred mid_pred
89 static inline av_const int mid_pred(int a, int b, int c)
90 {
91 #if 0
92 int t= (a-b)&((a-b)>>31);
93 a-=t;
94 b+=t;
95 b-= (b-c)&((b-c)>>31);
96 b+= (a-b)&((a-b)>>31);
97
98 return b;
99 #else
100 if(a>b){
101 if(c>b){
102 if(c>a) b=a;
103 else b=c;
104 }
105 }else{
106 if(b>c){
107 if(c>a) b=c;
108 else b=a;
109 }
110 }
111 return b;
112 #endif
113 }
114 #endif
115
86 #endif /* AVCODEC_MATHOPS_H */ 116 #endif /* AVCODEC_MATHOPS_H */
87 117