comparison imgconvert.c @ 8083:1fe764a5c33e libavcodec

Fix av_picture_copy missing pixels on packed planar AVPictures with odd size. patch by Art Clarke, aclarke vlideshow com
author diego
date Wed, 29 Oct 2008 23:07:49 +0000
parents 915bc657348f
children 661cd381d996
comparison
equal deleted inserted replaced
8082:75d40b4b28ed 8083:1fe764a5c33e
868 } 868 }
869 return (width * bits + 7) >> 3; 869 return (width * bits + 7) >> 3;
870 break; 870 break;
871 case FF_PIXEL_PLANAR: 871 case FF_PIXEL_PLANAR:
872 if (plane == 1 || plane == 2) 872 if (plane == 1 || plane == 2)
873 width >>= pf->x_chroma_shift; 873 width= -((-width)>>pf->x_chroma_shift);
874 874
875 return (width * pf->depth + 7) >> 3; 875 return (width * pf->depth + 7) >> 3;
876 break; 876 break;
877 case FF_PIXEL_PALETTE: 877 case FF_PIXEL_PALETTE:
878 if (plane == 0) 878 if (plane == 0)
898 int bwidth = ff_get_plane_bytewidth(pix_fmt, width, i); 898 int bwidth = ff_get_plane_bytewidth(pix_fmt, width, i);
899 w = width; 899 w = width;
900 h = height; 900 h = height;
901 if (i == 1 || i == 2) { 901 if (i == 1 || i == 2) {
902 w >>= pf->x_chroma_shift; 902 w >>= pf->x_chroma_shift;
903 h >>= pf->y_chroma_shift; 903 h= -((-height)>>pf->y_chroma_shift);
904 } 904 }
905 ff_img_copy_plane(dst->data[i], dst->linesize[i], 905 ff_img_copy_plane(dst->data[i], dst->linesize[i],
906 src->data[i], src->linesize[i], 906 src->data[i], src->linesize[i],
907 bwidth, h); 907 bwidth, h);
908 } 908 }