[FFmpeg-cvslog] lavf/img2enc: use FF_CEIL_RSHIFT().

Clément Bœsch git at videolan.org
Thu May 16 23:24:53 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu May 16 19:04:36 2013 +0200| [3da726f18853262203fb050d971a6a4859ef0175] | committer: Clément Bœsch

lavf/img2enc: use FF_CEIL_RSHIFT().

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

 libavformat/img2enc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 551d880..11e5801 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -101,7 +101,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 
     if (img->split_planes) {
         int ysize = codec->width * codec->height;
-        int usize = ((-codec->width)>>desc->log2_chroma_w) * ((-codec->height)>>desc->log2_chroma_h);
+        int usize = FF_CEIL_RSHIFT(codec->width, desc->log2_chroma_w) * FF_CEIL_RSHIFT(codec->height, desc->log2_chroma_h);
         if (desc->comp[0].depth_minus1 >= 8) {
             ysize *= 2;
             usize *= 2;



More information about the ffmpeg-cvslog mailing list