comparison mathops.h @ 11237:c975efe95584 libavcodec

Add zero_extend() function
author mru
date Sun, 21 Feb 2010 21:48:37 +0000
parents cd8a77473dd1
children 969a7d792b79
comparison
equal deleted inserted replaced
11236:9df548187a80 11237:c975efe95584
120 { 120 {
121 return (val << (INT_BIT - bits)) >> (INT_BIT - bits); 121 return (val << (INT_BIT - bits)) >> (INT_BIT - bits);
122 } 122 }
123 #endif 123 #endif
124 124
125 #ifndef zero_extend
126 static inline av_const unsigned zero_extend(unsigned val, unsigned bits)
127 {
128 return (val << (INT_BIT - bits)) >> (INT_BIT - bits);
129 }
130 #endif
131
125 #ifndef COPY3_IF_LT 132 #ifndef COPY3_IF_LT
126 #define COPY3_IF_LT(x, y, a, b, c, d)\ 133 #define COPY3_IF_LT(x, y, a, b, c, d)\
127 if ((y) < (x)) {\ 134 if ((y) < (x)) {\
128 (x) = (y);\ 135 (x) = (y);\
129 (a) = (b);\ 136 (a) = (b);\