[FFmpeg-devel] [PATCH] lavfi: port decimate libmpcodecs filter

Nicolas George nicolas.george at normalesup.org
Tue Aug 28 15:36:57 CEST 2012

Le primidi 11 fructidor, an CCXX, Stefano Sabatini a écrit :
> Are you suggesting to change the filter to accept an int rather than a
> float? That would break compatibility with the previous filter.

It would not be practical for the user. I am just suggesting to immediately
multiply it by 1<<20 and store it as an integer. Testing would work better.

> diff --git a/libavfilter/libmpcodecs/vf_decimate.c b/libavfilter/libmpcodecs/vf_decimate.c
> index 1fd7bce..e9a03f1 100644
> --- a/libavfilter/libmpcodecs/vf_decimate.c
> +++ b/libavfilter/libmpcodecs/vf_decimate.c

This part looks strange. Are those changes made for testing that crept to
the patch?

> +typedef struct {
> +    int lo, hi;                    ///< lower and higher threshold number of differences
> +                                   ///< values for 8x8 blocks

Does it work with multiple lines like that?

> +/**
> + * Return 1 in case the two frames are different, 0 otherwise.
> + */

s/in case/if/?

> +/**
> + * Tell if the frame should be decimated, that is if it is no much
> + * different with respect to the reference frame ref.
> + */
> +static int decimate_frame(AVFilterContext *ctx,
> +                          AVFilterBufferRef *cur, AVFilterBufferRef *ref)

If I read things correctly, the return values of diff_planes and
decimate_frame are in the opposite directions: diff_planes = 1 -> the planes
are different, decimate_frame = 1 -> the frames are not different.

These are very minor nits, feel free to push if no one else objects. Thanks
for the great work!


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120828/87ce21cf/attachment.asc>

More information about the ffmpeg-devel mailing list