diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2006-05-01 04:27:24 +0400 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2006-05-01 04:27:24 +0400 |
commit | 77177335f041c622df5afae79ae8670529c3341a (patch) | |
tree | 19250d8f3f9e529332fc39c937ba38887f44c4ab /libavutil/common.h | |
parent | 89ddb72aa1adb2e393c593cc6a96c04ca9867b32 (diff) |
document clip functions
Originally committed as revision 5338 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/common.h')
-rw-r--r-- | libavutil/common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 92c0d08552..ae325122a5 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -427,6 +427,13 @@ static inline int mid_pred(int a, int b, int c) #endif } +/** + * clip a signed integer value into the amin-amax range + * @param a value to clip + * @param amin minimum value of the clip range + * @param amax maximum value of the clip range + * @return cliped value + */ static inline int clip(int a, int amin, int amax) { if (a < amin) @@ -437,6 +444,11 @@ static inline int clip(int a, int amin, int amax) return a; } +/** + * clip a signed integer value into the 0-255 range + * @param a value to clip + * @return cliped value + */ static inline uint8_t clip_uint8(int a) { if (a&(~255)) return (-a)>>31; |