[Ffmpeg-devel] libswscale 8 bit decoding

Michael Niedermayer michaelni
Thu Nov 16 00:44:57 CET 2006


Hi

On Thu, Nov 16, 2006 at 08:32:24AM +1100, Steven Johnson wrote:
[...]
> [snip]
> >
> >the palette8tobgr (or palette8torgb) are redundant and should be removed
> >and the pal should be R<->B, actually your code halfway does that but
> >its totally broken (dont submit untested code!)
> >  
> Sorry, it wasn't a submission.  I was trying to see if I was on the 
> right track and it is difficult to do that without showing the code I am 
> working on.  I apologise for not making that clear in my original post. 
> 
> How did you exercise this code?  The reason I haven't tested it is I 
> haven't come up with a way to get the code path to execute.

hmm, maybe mplayer -vf scale with some -vf format and a paletted codec
will help


[...]
> >also the downscaling of chroma is wrong (discarding 3/4 of the samples is
> >not ok)
> >  
> The code is exactly the same as the C code in rgb24toyv12, with the 
> exception of palette expansion.  I noticed the image quality was 
> significantly reduced using libswscale over imgresample, and mentioned 
> that in my original post, that is the probably cause.  Any pointers to a 
> reference for converting RGB to YV12 I can look at?

a simple variant is to average the 4 rgb values before rgb->yuv (or
do rgb->yuv on them and then average the 4 u and 4 v, the result is the
same) (note this is not entirely correct but its ok while the current
code in rgb24toyv12 and your code is not)
btw see bgr32ToUV and the similar functions in libswscale/swscale_template.c
they also still use hardcoded rgb2yuv coeffs but except that they look
more sane


> 
> And following the thread "moving non-SIMD parts of libswscale to LGPL" I 
> am confused about libswscale, imgresample and the future.  As it stands, 
> imgresample does more than libswscale does (it handles palletised 
> formats), and (at least for me) produces a nicer result, but it seems is 
> probably slower in certain cases where the functionality overlaps.  But 
> is imgresample deprecated in favour of libswscale? 

yes


> Can I submit patches 
> improving imgresample and ignore libswscale? 

yes, but dont expect me to review them


> Or is the focus of future 
> development going to be on libswscale with an eventual aim to using it 
> by default (if not actually completely obsoleting imgresample), and so 
> patches to imgresample to add functionality will be unlikely to be 
> accepted because that diverges its functionality further from that 
> provided by libswscale?

i will svn remove imgresample/convert soon (basically iam just waiting
for the LGPL relicense thing to be finished)

feel free to port any better code to swscale before or after that

[...]

-- 
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 ffmpeg-devel mailing list