[MPlayer-users] [BUG] swscaler conversion of yv12 to nv12 broken

Guennadi Liakhovetski g.liakhovetski at gmx.de
Thu Jul 30 08:56:12 CEST 2009


Hi

I'm using mplayer on a SuperH platform with the sh_veu vidix driver, which 
takes nv12 as an input format. It used to work at least with a version 
from August 2008, a recent (21.07) SVN snapshot doesn't work any more. 
Doesn't work means, that with the clean SVN version the image appears 
black-and-white on the LCD. Tested by playing back per

mplayer -vo fbdev:vidix:sh_veu stream.yuv

a yv12 encoded video file, recorded from a camera per

mplayer tv:// -tv \
driver=v4l2:width=320:height=240:device=/dev/video0:outfmt=bgr16 \
-vo yuv4mpeg -frames 100

The file is fine, as verified by playing it back without the vidix driver. 
The vidix driver is also working, as verified by capturing video from the 
camera in nv12 directly to the vidix driver. Notice, that to do this you 
have to use a modified codecs.conf file to bypass the hmblck decoder, 
which is normally assigned to handle nv12, and using the raw driver 
instead.

I traced the problem down to the swscaler and there to the planarCopy() 
function. At least a part of the problem lies in this line:

        // ignore palette for GRAY8
        if (plane == 1 && !dst[2]) continue;

which disables processing of the UV plane completely. Verified by 
instrumenting the code and dumping actual data. But even removing this 
line doesn't fix the problem completely. I can see that the data gets 
written to the destination buffer, but it only produces some "random" 
colour spots.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/


More information about the MPlayer-users mailing list