[MPlayer-dev-eng] more on -vop halfpack and conversion to yuy2

Anders Johansson ajh at atri.curtin.edu.au
Thu Aug 22 03:31:54 CEST 2002


Hi,

I would like to have it in cvs, I am using a TV as screen, and I have
a quite slow computer. An other option would be to enable external
loading of video filters and distribute is as a dll type module I guess.

Cheers,
//Anders

> A while back I posted a video filter called halfpack, which converted
> planar YUV 4:2:0 formats to half-height YUY2, keeping all the chroma
> info but averaging every pair of luma lines. At the time I was told by
> Arpi it would be better to use the existing stuff in the postproc dir
> for this. I've been trying to follow that advice, and now that 4:2:2
> planar formats are supported, I've sorta found a way, but the relevant
> code seems to be broken.
> 
> The idea is to use -vop yuy2,format=422p,scale=[X]:[Y/2] to accomplish
> the same thing. I've modified the yuy2 filter (see attached patch) to
> support 4:2:2 input by calling yuv422ptoyuy2 instead of yv12toyuy2.
> However, the code doesn't seem to be working; every other line lacks
> chroma info completely. Has yuv422ptoyuy2 ever been tested?
> 
> Anyway, the other conclusion I've come to is that this method is slow.
> Using the -vop yuy2,format=422p,scale filter chain takes 2-3 times the
> cpu time as my (very naive, slow, unoptimized) -vop halfpack did, and
> the quality in the luma plane downscaling is not terribly different
> imo. So, I'm wondering if perhaps it would be preferable or at least
> acceptable to improve vf_halfpack.c and place it in CVS. Opinions,
> Arpi?
> 
> To anyone interested in reading vf_halfpack.c and/or the reasons why
> it's useful -- search the archives for my original post.
> 
> Rich
> 
> 

> Index: libmpcodecs/vf_yuy2.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_yuy2.c,v
> retrieving revision 1.3
> diff -u -r1.3 vf_yuy2.c
> +++ libmpcodecs/vf_yuy2.c	21 Aug 2002 23:55:50 -0000
> @@ -35,6 +35,10 @@
>  	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
>  	mpi->w, mpi->h);
>  
> +    if (mpi->imgfmt == IMGFMT_422P)
> +    yuv422ptoyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0],
> +	    mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]);
> +    else
>      yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0],
>  	    mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]);
>      
> @@ -51,6 +55,7 @@
>      case IMGFMT_YV12:
>      case IMGFMT_I420:
>      case IMGFMT_IYUV:
> +    case IMGFMT_422P:
>  	return vf_next_query_format(vf,IMGFMT_YUY2) & (~VFCAP_CSP_SUPPORTED_BY_HW);
>      }
>      return 0;


-- 
______________________________________________________________________
Anders Johansson    Room 314,113  Australian Telecommunications .-_|\
Visiting Research Associate       Research Institute (ATRI)    /     \
telephone:  +61 8 9266 3268       Curtin Uni of Technology     P_.-._/
e-mail: ajh at atri.curtin.edu.au            Bentley WA, 6102.         o
______________________________________________________________________






More information about the MPlayer-dev-eng mailing list