[FFmpeg-devel] [RFC] libswscale palette output implementation

Kostya kostya.shishkov
Sat Jan 2 08:48:48 CET 2010

On Fri, Jan 01, 2010 at 11:17:59PM +0100, Michael Niedermayer wrote:
> On Fri, Jan 01, 2010 at 11:00:08PM +0100, Stefano Sabatini wrote:
> > 
> > Mmh OK, do you already have some ideas about how to make sws_scale()
> > manage such a thing?
> > 
> > I mean: sws_scale() is passed in input a slice, it needs the whole
> > image in order to be able to compute the quantization palette, but
> > it is supposed to immediately draw in output the scaled slice.
> it is supposed to draw as much as it can, this could be 0 lines already
> now

So, did you give a hint that it may store everything to some internal
buffer and perform conversion after last slice is called? 
> > 
> > Also how would be possible to request the filter/sws_scale() to keep
> > the same palette, and/or to use a palette provided by the user rather
> > than compute it for each frame?
> by setting it in the data[1] of the output frame and maybe setting a flag
> there may be other ways but it certainly does not seem a big issue
> > 
> > In attachment a lazy implementation of a quantization filter using
> > ELFG.
> LFG? like in lagged fibonacci generator?

Like in ELBG with a typo. Random-generator solution with flling palette
and output with random entries would be even faster but produces images
with worse quality.
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

More information about the ffmpeg-devel mailing list