changeset 4899:c84d841ef43b

fixed stride for packed formats, more detailed printf at image allocation
author arpi
date Fri, 01 Mar 2002 00:20:11 +0000
parents a6b9c1fc6ee9
children 260edd600949
files libmpcodecs/vd.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
       }