# HG changeset patch # User mru # Date 1236038635 0 # Node ID 005cf8ba225f34688398101411cf96509d0d0b03 # Parent 50e847b72cdd4e35d8120fd79c46ca12b23f8bd0 Add sign_extend() function to mathops.h diff -r 50e847b72cdd -r 005cf8ba225f mathops.h --- a/mathops.h Mon Mar 02 19:42:31 2009 +0000 +++ b/mathops.h Tue Mar 03 00:03:55 2009 +0000 @@ -113,5 +113,12 @@ } #endif +#ifndef sign_extend +static inline av_const int sign_extend(int val, unsigned bits) +{ + return (val << (INT_BIT - bits)) >> (INT_BIT - bits); +} +#endif + #endif /* AVCODEC_MATHOPS_H */