changeset 11237:c975efe95584 libavcodec

Add zero_extend() function
author mru
date Sun, 21 Feb 2010 21:48:37 +0000
parents 9df548187a80
children 5401fc245167
files mathops.h
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mathops.h	Sun Feb 21 19:32:47 2010 +0000
+++ b/mathops.h	Sun Feb 21 21:48:37 2010 +0000
@@ -122,6 +122,13 @@
 }
 #endif
 
+#ifndef zero_extend
+static inline av_const unsigned zero_extend(unsigned val, unsigned bits)
+{
+    return (val << (INT_BIT - bits)) >> (INT_BIT - bits);
+}
+#endif
+
 #ifndef COPY3_IF_LT
 #define COPY3_IF_LT(x, y, a, b, c, d)\
 if ((y) < (x)) {\