[FFmpeg-devel] [PATCH] lavfi/alphaextract: drop cur_linesize = out_linesize branch in draw_slice()

Clément Bœsch ubitux at gmail.com
Fri Dec 7 18:44:29 CET 2012


On Fri, Dec 07, 2012 at 06:39:15PM +0100, Stefano Sabatini wrote:
> The code causes uninitialized data copy, and may be actually slower than
> a loop over each line in case the padding is big.
> ---
>  libavfilter/vf_alphaextract.c |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/libavfilter/vf_alphaextract.c b/libavfilter/vf_alphaextract.c
> index 35402f6..e779c98 100644
> --- a/libavfilter/vf_alphaextract.c
> +++ b/libavfilter/vf_alphaextract.c
> @@ -77,11 +77,6 @@ static int draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)
>                  pin += 4;
>              }
>          }
> -    } else if (cur_buf->linesize[A] == out_buf->linesize[Y]) {
> -        const int linesize = cur_buf->linesize[A];
> -        memcpy(out_buf->data[Y] + y0 * linesize,
> -               cur_buf->data[A] + y0 * linesize,
> -               linesize * h);
>      } else {
>          const int linesize = FFMIN(out_buf->linesize[Y], cur_buf->linesize[A]);
>          int y;

LGTM, thanks

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121207/7fdc41b7/attachment.asc>


More information about the ffmpeg-devel mailing list