From: Måns Rullgård Date: Sun, 21 Feb 2010 21:48:37 +0000 (+0000) Subject: Add zero_extend() function X-Git-Tag: v0.6~1180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48960b8f2496c03600e9d139521a1cf8f4a07e55;p=platform%2Fupstream%2Flibav.git Add zero_extend() function Originally committed as revision 21947 to svn://svn.ffmpeg.org/ffmpeg/trunk --- 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)) {\