yvu9 support

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6524 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2002-06-23 14:23:21 +00:00
parent 812b86ae81
commit 939db66beb
1 changed files with 5 additions and 4 deletions

View File

@ -72,18 +72,19 @@ static vf_info_t* filter_list[]={
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;
}