[MPlayer-dev-eng] Where to add a colorspace conversion function for fbdev

Gregoire Gentil gregoire at gentil.com
Wed Sep 24 07:59:52 CEST 2008


> ------------------------------
> 
> Message: 2
> Date: Tue, 23 Sep 2008 12:47:41 +0200
> From: Diego Biurrun <diego at biurrun.de>
> Subject: Re: [MPlayer-dev-eng] Where to add a colorspace conversion
> 	function	for fbdev
> To: mplayer-dev-eng at mplayerhq.hu
> Message-ID: <20080923104741.GD2273 at biurrun.de>
> Content-Type: text/plain; charset=utf-8
> 
> On Tue, Sep 23, 2008 at 03:45:11AM -0700, Gregoire Gentil wrote:
> > 
> > I would like to optimize mplayer for an embedded platform which prefered
> > color space is yuv422. Here is the current output of mplayer:
> > http://pastebin.com/d3dd90aec ?I have the assembly colorspace conversion
> > function yuv420_to_yuv422. Where should I patch to add this conversion?
> > Should I do it directly in libvo/vo_fbdev.c or is there a better place
> > to add colorspace conversion?
> 
> Look in libswscale/, you should add the converter there.
Thanks Diego. I have done some work but it's not successful so far. Some
hints would be appreciated. Here is what I've done:

I have added in /libswscale/swscale.c @ sws_getContext

        if ((srcFormat==PIX_FMT_YUV420P) &&
(dstFormat==PIX_FMT_YUYV422))
            c->swScale= MyOptimizedFunction;

I have then discovered that dstFormat == BGR565 in this function. So I
investigated the parent caller, config of libmpcodecs/vf_scale.c. The
destination format is returned by find_best_out
in libmpcodecs/vf_scale.c which only returns BGR565 in my case. I have
parsed the loop and only BGR565 has VFCAP_CSP_SUPPORTED_BY_HW. None
other format have VFCAP_CSP_SUPPORTED or VFCAP_CSP_SUPPORTED_BY_HW,
though my hardware can accept BGR565 and YUYV422 as input. I have then
tried to force dstFormat=YUY2 in config but it was not successful.

On top of this investigation, I also discovered that there is a C yv12
to yuy2 conversion function (not assembly-optimized like mine) but I
can't manage to make use it.

Note that "mplayer -vo fbdev -vf format=fmt=help" includes yuy2 on the
embedded device even on my x86/nvidia machine.

Bottom-line, I'm lost. I thought that a good first step was to force
yuy2 (with the C mplayer conversion function) but I can't manage to do
this. Any advice?

Grégoire






More information about the MPlayer-dev-eng mailing list