[FFmpeg-devel] [PATCH] Add lut filter.

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Jun 6 21:42:05 CEST 2011


On date Monday 2011-06-06 19:32:04 +0200, Michael Niedermayer encoded:
> On Mon, Jun 06, 2011 at 03:31:47PM +0200, Stefano Sabatini wrote:
> > On date Monday 2011-06-06 15:07:35 +0200, Stefano Sabatini encoded:
> > > On date Monday 2011-06-06 12:25:12 +0200, Stefano Sabatini encoded:
> > > > On date Sunday 2011-06-05 22:31:43 +0200, Michael Niedermayer encoded:
> > > > > On Sat, May 28, 2011 at 11:04:07PM +0200, Stefano Sabatini wrote:
> > > > [...]
> > > > > > > From ecda1bb4846754d2a651d2c80414563d7a9e19a7 Mon Sep 17 00:00:00 2001
> > > > > > > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > > > > > > Date: Fri, 3 Dec 2010 12:45:29 +0100
> > > > > > > Subject: [PATCH] Implement lut filter.
> > > > > > 
> > > > > > Updated with RGB support and an example negate filter.
> > > > > > 
> > > > > > Still missing documentation.
> > > > > 
> > > > > patches look good except what has been already mentioned.
> > > > 
> > > > Fixed the YUV range issue spotted by Mark, and added documentation.
> > > > 
> > > > I'll apply in a few days if I see no more comments.
> > > > 
> > > > > Also support for 9/10/...bit could be added later
> > > > > 
> > > > > and great work!
> > > > 
> > > > :)
> > > 
> > > Updated with a few fixes, now that I understood why pow was not
> > > working I'm trying to see how I can implement a gamma correction
> > > filter with it...
> > 
> > lutyuv="y=pow((val-minval)/(maxval-minval)\,gamma)*(maxval-minval)+minval"
> > 
> > ?
> 
> gamma correction should be done in rgb space. doing it in yuv with a
> 8bit lut is a approximation

Implemented more ideas, check attachments.

The idea of the lut(yuv+rgb) filter comes from the consideration that
a negate filter applies the same map to each component independently
of the colorspace, so a colorspace conversion should be avoided.

For the same reasons it could be useful to define a lut filter on the
alpha component without forcing a conversion.

I also developed the idea of the gamma correction, which is
implemented through an eval function.
-- 
FFmpeg = Fascinating and Furious Monstrous Pure Extreme Goblin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lavfi-add-LUT-LookUp-Table-generic-filters.patch
Type: text/x-diff
Size: 17974 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110606/dde3198a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-lavfi-add-negate-filter.patch
Type: text/x-diff
Size: 3896 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110606/dde3198a/attachment-0001.bin>


More information about the ffmpeg-devel mailing list