Mercurial > libavcodec.hg
diff mathops.h @ 11237:c975efe95584 libavcodec
Add zero_extend() function
author | mru |
---|---|
date | Sun, 21 Feb 2010 21:48:37 +0000 |
parents | cd8a77473dd1 |
children | 969a7d792b79 |
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)) {\