diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h index 9bf6186176..a99c210bc8 100644 --- a/libavcodec/jpeg2000.h +++ b/libavcodec/jpeg2000.h @@ -215,7 +215,7 @@ typedef struct Jpeg2000Component { /* misc tools */ static inline int ff_jpeg2000_ceildivpow2(int a, int b) { - return (a + (1 << b) - 1) >> b; + return -((-a) >> b); } static inline int ff_jpeg2000_ceildiv(int a, int b)