[MPlayer-dev-eng] [PATCH] yuv 4:4:4 scaling bug

Michael Niedermayer michaelni at gmx.at
Tue Aug 22 20:25:06 CEST 2006


Hi

On Tue, Aug 22, 2006 at 12:37:08AM -0700, Loren Merritt wrote:
> bug #1: swscaler from rgb to yuv 4:4:4 (or vice versa) goes through 4:2:2
> 
> mencoder in_rgb.avi -ovc raw -vf format=444p -o a_444.avi # line1
> mencoder in_rgb.avi -ovc raw -vf format=422p -o b_422.avi
> mencoder b_422.avi  -ovc raw -vf format=444p -o c_444.avi
> # a_444.avi and c_444.avi are identical
> 
> line1 outputs,
>  SwScaler: reducing / aligning filtersize 1 -> 4
>  SwScaler: reducing / aligning filtersize 5 -> 4
>  SwScaler: reducing / aligning filtersize 1 -> 1
>  SwScaler: reducing / aligning filtersize 1 -> 1
>  SwScaler: BICUBIC scaler, from 0x42475220 (BGR ) to 0x50343434 (P444) 
>  using MMX2
>  SwScaler: using 4-tap MMX scaler for horizontal luminance scaling
>  SwScaler: using 4-tap MMX scaler for horizontal chrominance scaling
>  SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV12 like)
>  SwScaler: 640x360 -> 640x360
>  SwScaler:Lum srcW=640 srcH=360 dstW=640 dstH=360 xInc=65536 yInc=65536
>  SwScaler:Chr srcW=320 srcH=360 dstW=640 dstH=360 xInc=32768 yInc=65536
> 
> The attached patch fixes this. Since swscaler provides flags to disable 
> this behavior, I just used them. 

i dont think that setting these flags is enough to fix the downsampling
problem, see *ToUV()


> But is there really any situation in 
> which you would want intermediate downsampling? If not, it would be better 
> to modify swscaler instead.

the problem is that the not downsampled stuff isnt supported for some formats
and downsampling might be faster, furthermore noone ever noticed it so the
quality loss probably isnt that bad ;)
of course should it be fixed and it should be fully supported and maybe
default ...


> 
> 
> bug #2: swscaler from 4:4:4 to any other format produces chroma artifacts. 
> The artifacts are independent of what the destination format is.
> The above patch fixes this for 4:4:4->rgb, but not to subsampled yuv 
> formats. I don't know where to look for the cause of this.

i dunno either, maybe chrSrcW or chrDstW are set incorrectly if not maybe
theres somethin wrong in hScale() or its surroundings 

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-dev-eng mailing list