[FFmpeg-cvslog] yuv4mpeg: correctly handle chroma for odd luma sizes.

Ronald S. Bultje git at videolan.org
Tue Jun 25 01:27:56 CEST 2013


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Mon Jun 24 19:13:58 2013 -0400| [cea8a0077fc597a11838f2f7242c01722d577b44] | committer: Derek Buitenhuis

yuv4mpeg: correctly handle chroma for odd luma sizes.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

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

 libavformat/yuv4mpeg.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index bf48230..a6d8346 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -217,8 +217,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
         // Adjust for smaller Cb and Cr planes
         av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
                                          &v_chroma_shift);
-        width  >>= h_chroma_shift;
-        height >>= v_chroma_shift;
+        width  = FF_CEIL_RSHIFT(width,  h_chroma_shift);
+        height = FF_CEIL_RSHIFT(height, v_chroma_shift);
 
         ptr1 = picture->data[1];
         ptr2 = picture->data[2];



More information about the ffmpeg-cvslog mailing list