Revision 77177335 libavutil/common.h

View differences:

libavutil/common.h
427 427
#endif
428 428
}
429 429

  
430
/**
431
 * clip a signed integer value into the amin-amax range
432
 * @param a value to clip
433
 * @param amin minimum value of the clip range
434
 * @param amax maximum value of the clip range
435
 * @return cliped value
436
 */
430 437
static inline int clip(int a, int amin, int amax)
431 438
{
432 439
    if (a < amin)
......
437 444
        return a;
438 445
}
439 446

  
447
/**
448
 * clip a signed integer value into the 0-255 range
449
 * @param a value to clip
450
 * @return cliped value
451
 */
440 452
static inline uint8_t clip_uint8(int a)
441 453
{
442 454
    if (a&(~255)) return (-a)>>31;

Also available in: Unified diff