| # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) |
| 6 | #endif |
| 7 |
| 8 | #ifndef NEG_SSR32 |
| 9 | # define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) |
| 10 | #endif |
| 11 |
| 12 | #ifndef sign_extend |
| 13 | static inline av_const int sign_extend(int val, unsigned bits) |
| 14 | { |
| 15 | unsigned shift = 8 * sizeof(int) - bits; |
| 16 | union { unsigned u; int s; } v = { (unsigned) val << shift }; |
| 17 | return v.s >> shift; |
| 18 | } |
| 19 | #endif |
| 20 |
| 21 | #ifndef zero_extend |
| 22 | static inline av_const unsigned zero_extend(unsigned val, unsigned bits) |
| 23 | { |
| 24 | return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); |
| 25 | } |
| 26 | #endif |
| 27 |
| 28 | #ifndef SUINT |
| 29 | #define SUINT unsigned |
| 30 | #endif |
| 31 |
| 32 | #endif |