# HG changeset patch # User arpi # Date 1014942011 0 # Node ID c84d841ef43b4dae4a95316a040622c19f7bcb5d # Parent a6b9c1fc6ee9c337c623926faf8cf7d8285610af fixed stride for packed formats, more detailed printf at image allocation diff -r a6b9c1fc6ee9 -r c84d841ef43b libmpcodecs/vd.c --- a/libmpcodecs/vd.c Thu Feb 28 21:59:14 2002 +0000 +++ b/libmpcodecs/vd.c Fri Mar 01 00:20:11 2002 +0000 @@ -80,14 +80,20 @@ if(!(mpi->flags&(MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_DIRECT)) && mpi->type>MP_IMGTYPE_EXPORT){ // non-direct and not yet allocaed image. allocate it! - printf("*** Allocating mp_image_t, %d bytes\n",mpi->bpp*mpi->width*mpi->height/8); + printf("*** Allocating mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n", + mpi->width,mpi->height,mpi->bpp, + (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB", + (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed", + mpi->bpp*mpi->width*mpi->height/8); mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*mpi->height/8); - if(!mpi->stride[0]) mpi->stride[0]=mpi->width; if(mpi->flags&MP_IMGFLAG_PLANAR){ // YV12/I420. feel free to add other planar formats here... + if(!mpi->stride[0]) mpi->stride[0]=mpi->width; if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->width/2; mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; mpi->planes[2]=mpi->planes[1]+mpi->width*mpi->height/4; + } else { + if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; } mpi->flags|=MP_IMGFLAG_ALLOCATED; }