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

Stefano Sabatini stefano.sabatini-lala
Fri Jan 1 14:15:05 CET 2010

On date Thursday 2009-12-31 19:41:44 +0200, Kostya encoded:
> On Thu, Dec 31, 2009 at 05:28:24PM +0100, Stefano Sabatini wrote:
> > Hi,
> > 
> > related thread:
> > http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/80845/focus=82531
> > 
> > Kostya's idea is to use Vitor's ELBG implementation in
> > libavcodec/elbg.{h,c}, first step would be to move it to lavu where it
> > can be used by lsws. This shouldn't comport any ABI / API issues,
> > since the API is only internal (it would only require a dependancy
> > change of lavc on lavu, but I may be wrong here).
> Just don't forget one point (I may be wrong here though): scale code may
> be called on slice or single line, so you need somehow to ensure it
> processes the whole picture. Maybe just having single filter for that is
> better. Also it may be improved to produce palette with minimum
> differences for consequent frames, etc.

Michael what about the filter option? I'm not even sure if the
libswscale solution would be viable, since the usage required here
conflicts with the slice API.

On the other hand a lavfi quantization filter may processes the frame
only when all the slices of each single image have been passed, and
issue in output an image using a paletted format.

Something like this:

..., elbg_quant=pal8, slicify, ...
> > Now I'm not sure if Michael would approve such an implementation as he
> > has some reservations on that idea, also now I'm reading the paper and
> > since I don't have a good background on it it would require some time if
> > I'll go for it.
> You can alternatively borrow code from pnmquant.

I'll check that also.

FFmpeg = Faithless & Funny Magnificient Peaceful Ecumenical Genius

More information about the ffmpeg-devel mailing list