[FFmpeg-devel] [PATCH] lavfi: add curves filter.

Paul B Mahol onemda at gmail.com
Tue Mar 5 19:12:16 CET 2013


On 3/5/13, Clement Boesch <ubitux at gmail.com> wrote:
> On Tue, Mar 05, 2013 at 05:53:14PM +0000, Paul B Mahol wrote:
>> On 3/5/13, Clement Boesch <ubitux at gmail.com> wrote:
>> > TODO: bump minor
>> > ---
>> > pseudo-vintage/matrix effect: http://imgur.com/w8sQ4gw
>> > Obtained with:
>> >   mp=eq2=1:1.2,
>> >   hue=h=20,
>> >   curves=r='0.4/0.2 0.9/1':g='0.75/0.8':b='0/0.1 1/0.9'
>> > ---
>> >  doc/filters.texi         |  64 +++++++++
>> >  libavfilter/Makefile     |   1 +
>> >  libavfilter/allfilters.c |   1 +
>> >  libavfilter/vf_curves.c  | 345
>> > +++++++++++++++++++++++++++++++++++++++++++++++
>> >  4 files changed, 411 insertions(+)
>> >  create mode 100644 libavfilter/vf_curves.c
>> >
>> > diff --git a/doc/filters.texi b/doc/filters.texi
>> > index f4c1d03..e97e974 100644
>> > --- a/doc/filters.texi
>> > +++ b/doc/filters.texi
>> > @@ -2187,6 +2187,70 @@ indicates never reset and return the largest
>> > area
>> > encountered during
>> >  playback.
>> >  @end table
>> >
>> > + at section curves
>> > +
>> > +Apply color adjustments using curves.
>> > +
>> > +This filter is similar to the Adobe Photoshop and GIMP curves tools.
>> > Each
>>
>> Mentioning those two does not explain in simple terms what filter actually
>> does.
>>
>
> Yeah, consider it an introduction sentence. Is the following explanation
> unclear?

It does not explain relation between curve and color components in image.

How hard would it be to support rgb48?

>
>> > +component (red, green and blue) has its values defined by @var{N} key
>> > points
>> > +tied from each other using a smooth curve.
>> > +
>> > +By default, a component curve is defined by the two points @var{(0;0)}
>> > and
>> > + at var{(1;1)}. This creates a straight line where each original pixel
>> > value
>> > is
>> > +"adjusted" to its own value, which means no change to the image.
>> > +
>> > +The filter allows you to redefine these two points and add some more. A
>> > new
>> > +curve (using a natural cubic spline interpolation) will be define to
>> > pass
>> > +smoothly through all these new coordinates. The new defined points
>> > needs to
>> > be
>> > +strictly increasing over the x-axis, and their @var{x} and @var{y}
>> > values
>> > must
>> > +be in the @var{[0;1]} interval.  If the computed curves happened to go
>> > outside
>> > +the vector spaces, the values will be clipped accordingly.
>> > +
>> > +If there is no key point defined in @code{x=0}, the filter will
>> > automatically
>> > +insert a @var{(0;0)} point. In the same way, if there is no key point
>> > defined
>> > +in @code{x=1}, the filter will automatically insert a @var{(1;1)}
>> > point.
>> > +
>> > +The filter accepts parameters as a list of @var{key}=@var{value}
>> > pairs,
>> > +separated by ":".
>> > +
>> > +A description of the accepted parameters follows.
>> > +
>> > + at table @option
>> > + at item r, red
>> > +Set the key points for the red components.
>> > + at item g, green
>> > +Set the key points for the green components.
>> > + at item b, blue
>> > +Set the key points for the red components.
>>
>> typo: s/red/blue.
>>
>
> Fixed locally.
>
>> nit+++++++++++++: Isn't it more logical to put shorter name after longer
>> one?
>>
>
> Sure, whatever. Guess what, I even switched the order in the AVOption
> locally :-)
>
> [...]
>
> --
> Clement B.
>


More information about the ffmpeg-devel mailing list