[FFmpeg-cvslog] r19636 - trunk/libavutil/common.h

ramiro subversion
Thu Aug 13 20:47:13 CEST 2009


Author: ramiro
Date: Thu Aug 13 20:47:13 2009
New Revision: 19636

Log:
Introduce av_clip_uint16().

Modified:
   trunk/libavutil/common.h

Modified: trunk/libavutil/common.h
==============================================================================
--- trunk/libavutil/common.h	Thu Aug 13 11:42:04 2009	(r19635)
+++ trunk/libavutil/common.h	Thu Aug 13 20:47:13 2009	(r19636)
@@ -190,6 +190,17 @@ static inline av_const uint8_t av_clip_u
 }
 
 /**
+ * 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
  * @return clipped value



More information about the ffmpeg-cvslog mailing list