[FFmpeg-cvslog] avcodec/jpeg2000: Avoid one shift in ff_jpeg2000_ceildivpow2()

Michael Niedermayer git at videolan.org
Sun Jun 28 02:57:29 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 28 02:27:43 2015 +0200| [f01028bf58b89a80132bda409167e39779de8835] | committer: Michael Niedermayer

avcodec/jpeg2000: Avoid one shift in ff_jpeg2000_ceildivpow2()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f01028bf58b89a80132bda409167e39779de8835
---

 libavcodec/jpeg2000.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h
index 9bf6186..a99c210 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)



More information about the ffmpeg-cvslog mailing list