summaryrefslogtreecommitdiffstats
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-02-21 21:48:37 +0000
committerMåns Rullgård <mans@mansr.com>2010-02-21 21:48:37 +0000
commit48960b8f2496c03600e9d139521a1cf8f4a07e55 (patch)
treef71da47410876f4a9c16e1e6c0c7ef1d857907c4 /libavcodec/mathops.h
parent94a5218c108d078491aa69db72433f2918bdab5d (diff)
downloadffmpeg-streaming-48960b8f2496c03600e9d139521a1cf8f4a07e55.zip
ffmpeg-streaming-48960b8f2496c03600e9d139521a1cf8f4a07e55.tar.gz
Add zero_extend() function
Originally committed as revision 21947 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r--libavcodec/mathops.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 85eac48..149910b 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -122,6 +122,13 @@ static inline av_const int sign_extend(int val, unsigned bits)
}
#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)) {\
OpenPOWER on IntegriCloud