[FFmpeg-devel] [PATCH] lavfi: add erosion, dilation, deflate & inflate filter

James Darnley james.darnley at gmail.com
Wed Jul 15 00:39:42 CEST 2015


On 2015-07-15 00:15, Paul B Mahol wrote:
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 9f7b976..d4d8bad 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -3718,6 +3718,24 @@ Set whether or not chroma is considered in the metric calculations. Default is
>  @code{1}.
>  @end table
>  
> + at section deflate
> +
> +Apply deflate effect to the video.
> +
> +This filter replaces the pixel by the local(3x3) average by taking into account
> +only values lower than the pixel.
> +
> +It accepts the following options:
> +
> + at table @option
> + at item threshold
> +Allows to limit the maximum change, default is 65535.

Strange phrasing.  Why not just "Limits the maximum change, default is
65535"

> + at item planes
> +Flag which specifies which planes to filter. Default is 15 i.e. all four
> +planes.
> + at end table

While this was probably the existing behaviour (assuming this is the
patch from ubitux), do many other filters use a bit mask for controlling
which planes are processed?  But to be honest, I don't have a suggestion
for how else you should do it.  4 separate threshold options, similar to
removegrain and its modes?

> @@ -3904,6 +3922,27 @@ A number representing position of the first frame with respect to the telecine
>  pattern. This is to be used if the stream is cut. The default value is @code{0}.
>  @end table
>  
> + at section dilation
> +
> +Apply dilation effect to the video.
> +
> +This filter replaces the pixel by the local(3x3) maximum.
> +
> +It accepts the following options:
> +
> + at table @option
> + at item threshold
> +Allows to limit the maximum change, default is 65535.

As above.

> + at item coordinates
> +Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
> +pixels are used.

You should probably explain which values represent which pixel, i.e.
tha1 1 is the top left pixel.

> @@ -4759,6 +4798,27 @@ value.
>  
>  @end table
>  
> + at section erosion
> +
> +Apply erosion effect to the video.
> +
> +This filter replaces the pixel by the local(3x3) minimum.
> +
> +It accepts the following options:
> +
> + at table @option
> + at item threshold
> +Allows to limit the maximum change, default is 65535.

...

> + at item coordinates
> +Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
> +pixels are used.

...

> @@ -6356,6 +6416,24 @@ Default value is @code{none}.
>  Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is @code{0}.
>  @end table
>  
> + at section inflate
> +
> +Apply inflate effect to the video.
> +
> +This filter replaces the pixel by the local(3x3) average by taking into account
> +only values higher than the pixel.
> +
> +It accepts the following options:
> +
> + at table @option
> + at item threshold
> +Allows to limit the maximum change, default is 65535.
> +
> + at item planes
> +Flag which specifies which planes to filter. Default is 15 i.e. all four
> +planes.
> + at end table
> +

Same comments.

> ...

Despite my comments above I get the feeling that this might be intended
for programmatic use by other future filters.  If that's the case then I
guess the options don't have to be user friendly.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150715/22eef1ce/attachment.sig>


More information about the ffmpeg-devel mailing list