Mercurial > libavcodec.hg
comparison common.h @ 823:5344ecb2c677 libavcodec
put MIN/MAX under ifndef MAX/MIN
author | michaelni |
---|---|
date | Fri, 01 Nov 2002 20:37:10 +0000 |
parents | 8e1f0939d15d |
children | 4c22dcf3ba65 |
comparison
equal
deleted
inserted
replaced
822:21d400c67fc5 | 823:5344ecb2c677 |
---|---|
160 //rounded divison & shift | 160 //rounded divison & shift |
161 #define RSHIFT(a,b) ((a) > 0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b)) | 161 #define RSHIFT(a,b) ((a) > 0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b)) |
162 /* assume b>0 */ | 162 /* assume b>0 */ |
163 #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) | 163 #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) |
164 #define ABS(a) ((a) >= 0 ? (a) : (-(a))) | 164 #define ABS(a) ((a) >= 0 ? (a) : (-(a))) |
165 #define MAX(a,b) ((a) > (b) ? (a) : (b)) | 165 |
166 #define MIN(a,b) ((a) > (b) ? (b) : (a)) | 166 #ifndef MAX |
167 # define MAX(a,b) ((a) > (b) ? (a) : (b)) | |
168 #endif | |
169 | |
170 #ifndef MIN | |
171 # define MIN(a,b) ((a) > (b) ? (b) : (a)) | |
172 #endif | |
167 | 173 |
168 #ifdef ARCH_X86 | 174 #ifdef ARCH_X86 |
169 // avoid +32 for shift optimization (gcc should do that ...) | 175 // avoid +32 for shift optimization (gcc should do that ...) |
170 static inline int32_t NEG_SSR32( int32_t a, int8_t s){ | 176 static inline int32_t NEG_SSR32( int32_t a, int8_t s){ |
171 asm ("sarl %1, %0\n\t" | 177 asm ("sarl %1, %0\n\t" |