comparison common.h @ 519:5cdb952bd09a libavutil

Add av_clipf() function to common.h and use it in ra288.c
author vitor
date Sun, 13 Jul 2008 19:59:44 +0000
parents 80cd26ba5c7c
children bd4052d9050c
comparison
equal deleted inserted replaced
518:2ad28cd57bf5 519:5cdb952bd09a
223 { 223 {
224 if ((a+32768) & ~65535) return (a>>31) ^ 32767; 224 if ((a+32768) & ~65535) return (a>>31) ^ 32767;
225 else return a; 225 else return a;
226 } 226 }
227 227
228 /**
229 * clip a float value into the amin-amax range
230 * @param a value to clip
231 * @param amin minimum value of the clip range
232 * @param amax maximum value of the clip range
233 * @return clipped value
234 */
235 static inline av_const float av_clipf(float a, float amin, float amax)
236 {
237 if (a < amin) return amin;
238 else if (a > amax) return amax;
239 else return a;
240 }
241
228 /* math */ 242 /* math */
229 int64_t av_const ff_gcd(int64_t a, int64_t b); 243 int64_t av_const ff_gcd(int64_t a, int64_t b);
230 244
231 /** 245 /**
232 * converts fourcc string to int 246 * converts fourcc string to int