mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
Add av_clip_int8(), used in the upcoming VP8 decoder.
Originally committed as revision 23713 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
890fe85f26
commit
45a1b86a05
@ -122,6 +122,17 @@ static inline av_const uint8_t av_clip_uint8(int a)
|
|||||||
else return a;
|
else return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clips a signed integer value into the -128,127 range.
|
||||||
|
* @param a value to clip
|
||||||
|
* @return clipped value
|
||||||
|
*/
|
||||||
|
static inline av_const int8_t av_clip_int8(int a)
|
||||||
|
{
|
||||||
|
if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
|
||||||
|
else return a;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clips a signed integer value into the 0-65535 range.
|
* Clips a signed integer value into the 0-65535 range.
|
||||||
* @param a value to clip
|
* @param a value to clip
|
||||||
|
Loading…
Reference in New Issue
Block a user