# HG changeset patch # User alex # Date 1024681086 0 # Node ID c0d84f46d349bd1f01d030a46660e00e43c70cae # Parent 52563321dc780f6688ff11643e072d0b91c6527a yvu9 support diff -r 52563321dc78 -r c0d84f46d349 libmpcodecs/vf.c --- a/libmpcodecs/vf.c Fri Jun 21 17:37:30 2002 +0000 +++ b/libmpcodecs/vf.c Fri Jun 21 17:38:06 2002 +0000 @@ -33,6 +33,7 @@ extern vf_info_t vf_info_cropdetect; extern vf_info_t vf_info_test; extern vf_info_t vf_info_noise; +extern vf_info_t vf_info_yvu9; char** vo_plugin_args=(char**) NULL; @@ -61,6 +62,7 @@ &vf_info_cropdetect, &vf_info_test, &vf_info_noise, + &vf_info_yvu9, NULL }; @@ -164,9 +166,15 @@ // non-direct and not yet allocaed image. allocate it! mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); if(mpi->flags&MP_IMGFLAG_PLANAR){ - // YV12/I420. feel free to add other planar formats here... + // YV12/I420/YVU9. feel free to add other planar formats here... if(!mpi->stride[0]) mpi->stride[0]=mpi->width; - if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->width/2; + if (!mpi->stride[1]) + { + if (mpi->imgfmt == IMGFMT_YVU9) + mpi->stride[1]=mpi->stride[2]=mpi->width/4; + else + mpi->stride[1]=mpi->stride[2]=mpi->width/2; + } if(mpi->flags&MP_IMGFLAG_SWAPPED){ // I420/IYUV (Y,U,V) mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; @@ -174,7 +182,10 @@ } else { // YV12,YVU9 (Y,V,U) mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; - mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1); + if (mpi->imgfmt == IMGFMT_YVU9) + mpi->planes[1]=mpi->planes[2]+(mpi->width>>2)*(mpi->height>>2); + else + mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1); } } else { if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; @@ -192,6 +203,9 @@ (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB", (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed", mpi->bpp*mpi->width*mpi->height/8); + mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"(imgfmt: %x, planes: %x,%x,%x strides: %d,%d,%d)\n", + mpi->imgfmt, mpi->planes[0], mpi->planes[1], mpi->planes[2], + mpi->stride[0], mpi->stride[1], mpi->stride[2]); mpi->flags|=MP_IMGFLAG_TYPE_DISPLAYED; }