comparison libmpcodecs/vf.c @ 6523:3d520cf84f50

yvu9 support
author alex
date Sun, 23 Jun 2002 14:23:21 +0000
parents c0d84f46d349
children 05cd2cf758e4
comparison
equal deleted inserted replaced
6522:ed8a717a423e 6523:3d520cf84f50
70 // mpi stuff: 70 // mpi stuff:
71 71
72 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){ 72 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){
73 int y; 73 int y;
74 if(mpi->flags&MP_IMGFLAG_PLANAR){ 74 if(mpi->flags&MP_IMGFLAG_PLANAR){
75 int div = (mpi->imgfmt == IMGFMT_YVU9) ? 2 : 1;
75 y0&=~1;h+=h&1; 76 y0&=~1;h+=h&1;
76 if(x0==0 && w==mpi->width){ 77 if(x0==0 && w==mpi->width){
77 // full width clear: 78 // full width clear:
78 memset(mpi->planes[0]+mpi->stride[0]*y0,0,mpi->stride[0]*h); 79 memset(mpi->planes[0]+mpi->stride[0]*y0,0,mpi->stride[0]*h);
79 memset(mpi->planes[1]+mpi->stride[1]*(y0>>1),128,mpi->stride[1]*(h>>1)); 80 memset(mpi->planes[1]+mpi->stride[1]*(y0>>div),128,mpi->stride[1]*(h>>div));
80 memset(mpi->planes[2]+mpi->stride[2]*(y0>>1),128,mpi->stride[2]*(h>>1)); 81 memset(mpi->planes[2]+mpi->stride[2]*(y0>>div),128,mpi->stride[2]*(h>>div));
81 } else 82 } else
82 for(y=y0;y<y0+h;y+=2){ 83 for(y=y0;y<y0+h;y+=2){
83 memset(mpi->planes[0]+x0+mpi->stride[0]*y,0,w); 84 memset(mpi->planes[0]+x0+mpi->stride[0]*y,0,w);
84 memset(mpi->planes[0]+x0+mpi->stride[0]*(y+1),0,w); 85 memset(mpi->planes[0]+x0+mpi->stride[0]*(y+1),0,w);
85 memset(mpi->planes[1]+(x0>>1)+mpi->stride[1]*(y>>1),128,(w>>1)); 86 memset(mpi->planes[1]+(x0>>div)+mpi->stride[1]*(y>>div),128,(w>>div));
86 memset(mpi->planes[2]+(x0>>1)+mpi->stride[2]*(y>>1),128,(w>>1)); 87 memset(mpi->planes[2]+(x0>>div)+mpi->stride[2]*(y>>div),128,(w>>div));
87 } 88 }
88 return; 89 return;
89 } 90 }
90 // packed: 91 // packed:
91 for(y=y0;y<y0+h;y++){ 92 for(y=y0;y<y0+h;y++){