Introduce av_clip_uint16().
Originally committed as revision 19636 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		@@ -189,6 +189,17 @@ static inline av_const uint8_t av_clip_uint8(int a)
 | 
			
		||||
    else          return a;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clips a signed integer value into the 0-65535 range.
 | 
			
		||||
 * @param a value to clip
 | 
			
		||||
 * @return clipped value
 | 
			
		||||
 */
 | 
			
		||||
static inline av_const uint16_t av_clip_uint16(int a)
 | 
			
		||||
{
 | 
			
		||||
    if (a&(~65535)) return (-a)>>31;
 | 
			
		||||
    else            return a;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clips a signed integer value into the -32768,32767 range.
 | 
			
		||||
 * @param a value to clip
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user