[FFmpeg-cvslog] r15744 - trunk/libavcodec/imgconvert.c

diego subversion
Thu Oct 30 00:07:49 CET 2008


Author: diego
Date: Thu Oct 30 00:07:49 2008
New Revision: 15744

Log:
Fix av_picture_copy missing pixels on packed planar AVPictures with odd size.
patch by Art Clarke, aclarke vlideshow com


Modified:
   trunk/libavcodec/imgconvert.c

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	(original)
+++ trunk/libavcodec/imgconvert.c	Thu Oct 30 00:07:49 2008
@@ -870,7 +870,7 @@ int ff_get_plane_bytewidth(enum PixelFor
         break;
     case FF_PIXEL_PLANAR:
             if (plane == 1 || plane == 2)
-                width >>= pf->x_chroma_shift;
+                width= -((-width)>>pf->x_chroma_shift);
 
             return (width * pf->depth + 7) >> 3;
         break;
@@ -900,7 +900,7 @@ void av_picture_copy(AVPicture *dst, con
             h = height;
             if (i == 1 || i == 2) {
                 w >>= pf->x_chroma_shift;
-                h >>= pf->y_chroma_shift;
+                h= -((-height)>>pf->y_chroma_shift);
             }
             ff_img_copy_plane(dst->data[i], dst->linesize[i],
                            src->data[i], src->linesize[i],




More information about the ffmpeg-cvslog mailing list