changeset 5529:1b301c326c3b

relaly black packed yuv images
author arpi
date Mon, 08 Apr 2002 01:33:29 +0000
parents 39d4e6b03bcf
children e974e82be748
files libmpcodecs/vf.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Mon Apr 08 01:26:20 2002 +0000
+++ b/libmpcodecs/vf.c	Mon Apr 08 01:33:29 2002 +0000
@@ -105,7 +105,13 @@
 	  } else {
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8;
 	      if(mpi->flags&MP_IMGFLAG_YUV){
-	          // TODO: clear packed yuv plane
+		  int size=mpi->bpp*mpi->width*mpi->height/8/4;
+		  unsigned int* p=mpi->planes[0];
+		  int i;
+		  if(mpi->flags&MP_IMGFLAG_SWAPPED)
+		      for(i=0;i<size;i+=4) p[i]=p[i+1]=p[i+2]=p[i+3]=0x00800080;
+		  else
+		      for(i=0;i<size;i+=4) p[i]=p[i+1]=p[i+2]=p[i+3]=0x80008000;
 	      } else
 	          memset(mpi->planes[0],0,mpi->bpp*mpi->width*mpi->height/8);
 	  }