[Ffmpeg-devel] libswscale questions

Michael Niedermayer michaelni
Tue Oct 31 01:32:48 CET 2006


On Tue, Oct 31, 2006 at 09:25:23AM +1100, Steven Johnson wrote:
> Hi,
> I have some questions about libswscale.
> 1. There are pal8to* format converters in the code, but nothing calls
> them that I can find.  is that correct?

mplayer calls them

> 1.1 If yes to 1, Is it acceptable for them to be activated?


> 1.2 If yes to 1, If I was to activate pal8to* conversion in libswscale,
> Should I put the code into rgb2rgbWrapper, OR should I create a
> pal8torgbWrapper. (The 2nd option seems cleaner).

are you asking about the name? pal8torgbWrapper sound better yes

> 2. I also want to add rgb??topal8 conversion. Would this be acceptable?


> 2.1 If yes to 2, would it be acceptable to just have rgb24topal8
> conversion, and to implement the other rgb??topal8 conversions by going
> from rgb?? to rgb24 and then rgb24topal8?

the swscaler internally uses yuv so your conversation will have to be
from that or you will have to add internal rgb support (very welcome too), 
also note that X->pal support where X -> scaling -> pal fails is not 
acceptable (note to thouse who complain now about crap design and lost 
precission in rgb->rgb, the internal yuv is 15bit per sample)

> 2.2 If yes to 2, should I put the rgb??topal8 code in rgb2rgb.* or
> should I make rgb2pal.* and put the code in there? (The 2nd option seems
> cleaner).

yes new file is better

> 4. Decent RGB to PAL8 conversion requires parameters to the converter
> such as (method of conversion, quality vs speed, max colours to use,
> etc).  Would it be acceptable for these options to be passed in as part
> of SwsContext? AND as SwsContext is opaque outside libswswcale, would it
> be acceptable to have a function to set these parameters inside
> SwsContext?  Something like:
>    int sws_setPaletteGenerationControl(struct SwsContext *c, int mode,
> int quality, etc) ??

hmm how hard/messy would it be to use AVOption for 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