mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavu/common: make FF_CEIL_RSHIFT faster when shift is constant.
See "[PATCH] lavfi/lut: use FF_CEIL_RSHIFT for chroma w/h rounding." thread for more information.
This commit is contained in:
parent
45150f90e7
commit
b3c263e209
@ -49,7 +49,8 @@
|
|||||||
/* assume b>0 */
|
/* assume b>0 */
|
||||||
#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
|
#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
|
||||||
/* assume a>0 and b>0 */
|
/* assume a>0 and b>0 */
|
||||||
#define FF_CEIL_RSHIFT(a,b) (-((-(a)) >> (b)))
|
#define FF_CEIL_RSHIFT(a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \
|
||||||
|
: ((a) + (1<<(b)) - 1) >> (b))
|
||||||
#define FFUDIV(a,b) (((a)>0 ?(a):(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 FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
|
||||||
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
|
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
|
||||||
|
Loading…
Reference in New Issue
Block a user