changeset 5528:39d4e6b03bcf

really black yv12/rgb images (todo: packed yuv)
author arpi
date Mon, 08 Apr 2002 01:26:20 +0000
parents 04c5047ead0c
children 1b301c326c3b
files libmpcodecs/vf.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Mon Apr 08 00:06:03 2002 +0000
+++ b/libmpcodecs/vf.c	Mon Apr 08 01:26:20 2002 +0000
@@ -98,8 +98,16 @@
 	          mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
 	          mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1);
 	      }
+	      // clear!
+	      memset(mpi->planes[0],0,mpi->stride[0]*mpi->height);
+	      memset(mpi->planes[1],128,mpi->stride[1]*(mpi->height>>1));
+	      memset(mpi->planes[2],128,mpi->stride[2]*(mpi->height>>1));
 	  } else {
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8;
+	      if(mpi->flags&MP_IMGFLAG_YUV){
+	          // TODO: clear packed yuv plane
+	      } else
+	          memset(mpi->planes[0],0,mpi->bpp*mpi->width*mpi->height/8);
 	  }
 	  mpi->flags|=MP_IMGFLAG_ALLOCATED;
         }