Mercurial > libavcodec.hg
comparison mathops.h @ 9096:005cf8ba225f libavcodec
Add sign_extend() function to mathops.h
author | mru |
---|---|
date | Tue, 03 Mar 2009 00:03:55 +0000 |
parents | 4cea2f47219a |
children | f1f95c604b56 |
comparison
equal
deleted
inserted
replaced
9095:50e847b72cdd | 9096:005cf8ba225f |
---|---|
111 return b; | 111 return b; |
112 #endif | 112 #endif |
113 } | 113 } |
114 #endif | 114 #endif |
115 | 115 |
116 #ifndef sign_extend | |
117 static inline av_const int sign_extend(int val, unsigned bits) | |
118 { | |
119 return (val << (INT_BIT - bits)) >> (INT_BIT - bits); | |
120 } | |
121 #endif | |
122 | |
116 #endif /* AVCODEC_MATHOPS_H */ | 123 #endif /* AVCODEC_MATHOPS_H */ |
117 | 124 |