From 48960b8f2496c03600e9d139521a1cf8f4a07e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Sun, 21 Feb 2010 21:48:37 +0000 Subject: [PATCH] Add zero_extend() function Originally committed as revision 21947 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mathops.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 85eac484e0..149910bb1d 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)) {\