diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-09 19:47:22 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-09 19:47:22 +0400 |
commit | 51927883213dfe9e8469f5d3c21ef041eb1f7236 (patch) | |
tree | 35df5da74098439d7c840a417d21013c2bd43d9f /libavutil | |
parent | 5deedf3552819e5bea3327a450155bb57643a999 (diff) |
avutil: add divide & modulo that round like unsigned ones do that is down.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 5814297cf2..493c3139aa 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -47,6 +47,8 @@ #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) /* assume b>0 */ #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) +#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b)) +#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b)) #define FFABS(a) ((a) >= 0 ? (a) : (-(a))) #define FFSIGN(a) ((a) > 0 ? 1 : -1) |