changeset 6523:3d520cf84f50

yvu9 support
author alex
date Sun, 23 Jun 2002 14:23:21 +0000
parents ed8a717a423e
children 05cd2cf758e4
files libmpcodecs/vf.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Sun Jun 23 13:17:03 2002 +0000
+++ b/libmpcodecs/vf.c	Sun Jun 23 14:23:21 2002 +0000
@@ -72,18 +72,19 @@
 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){
     int y;
     if(mpi->flags&MP_IMGFLAG_PLANAR){
+	int div = (mpi->imgfmt == IMGFMT_YVU9) ? 2 : 1;
 	y0&=~1;h+=h&1;
 	if(x0==0 && w==mpi->width){
 	    // full width clear:
 	    memset(mpi->planes[0]+mpi->stride[0]*y0,0,mpi->stride[0]*h);
-	    memset(mpi->planes[1]+mpi->stride[1]*(y0>>1),128,mpi->stride[1]*(h>>1));
-	    memset(mpi->planes[2]+mpi->stride[2]*(y0>>1),128,mpi->stride[2]*(h>>1));
+	    memset(mpi->planes[1]+mpi->stride[1]*(y0>>div),128,mpi->stride[1]*(h>>div));
+	    memset(mpi->planes[2]+mpi->stride[2]*(y0>>div),128,mpi->stride[2]*(h>>div));
 	} else
 	for(y=y0;y<y0+h;y+=2){
 	    memset(mpi->planes[0]+x0+mpi->stride[0]*y,0,w);
 	    memset(mpi->planes[0]+x0+mpi->stride[0]*(y+1),0,w);
-	    memset(mpi->planes[1]+(x0>>1)+mpi->stride[1]*(y>>1),128,(w>>1));
-	    memset(mpi->planes[2]+(x0>>1)+mpi->stride[2]*(y>>1),128,(w>>1));
+	    memset(mpi->planes[1]+(x0>>div)+mpi->stride[1]*(y>>div),128,(w>>div));
+	    memset(mpi->planes[2]+(x0>>div)+mpi->stride[2]*(y>>div),128,(w>>div));
 	}
 	return;
     }