mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
avutil: add divide & modulo that round like unsigned ones do that is down.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
5deedf3552
commit
5192788321
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user