From 3a633f9c40e9c1be702c7ba80e2a2c05832d10a7 Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 1 Mar 2002 00:20:11 +0000 Subject: fixed stride for packed formats, more detailed printf at image allocation git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4900 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libmpcodecs/vd.c') diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 3eb21c0aac..bacc32b664 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -80,14 +80,20 @@ mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, i 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; } -- cgit v1.2.3