[FFmpeg-devel] [PATCH] lavfi/gradfun: fix direct writing in buffer.

Nicolas George nicolas.george at normalesup.org
Sun Dec 2 11:48:03 CET 2012


Le duodi 12 frimaire, an CCXXI, Clément Bœsch a écrit :
>  - first, the use of AV_PERM_PRESERVE looks inappropriate, so we can remove it.

I confirm.

>  - then it seems assumed that gradfun can do filtering in-place (see the direct
>    flag). Though, that direct flag isn't passed to the filtering functions, and

The direct flag is there to check whether the input buffer must be freed.

>    the filter doesn't seem to assume/support dst=src, so we need to get a new
>    temporary buffer (allocated with ff_get_video_buffer) all the time.

If the filter did not work when direct is set, I believe we would probably
have noticed it. Right now, a quick glance seems to show that it does work.

This kind of construct seems typical of filters ported from MPlayer, where
the permissions and buffer allocation system is different. That explains why
you find the same thing in hqdn3d.

Some benchmark would probably help to know whether this kind of complexity
is useful, compared to requiring PERM_WRITE or always allocating a new
buffer.

>  - the out->video->w=outlink->w, out->video->h=outlink->h look uneeded since
>    avfilter_copy_buffer_ref_props handle this (and the filter doesn't change
>    the video size).

I confirm.

Regards,

-- 
  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/20121202/d5d66e0d/attachment.asc>


More information about the ffmpeg-devel mailing list