[FFmpeg-devel] [PATCH] lavfi/kerndeint: use aligned linesizes for the temporary buffer.

Stefano Sabatini stefasab at gmail.com
Sat Feb 16 00:23:13 CET 2013


On date Friday 2013-02-15 19:10:48 +0000, Paul B Mahol encoded:
> On 2/15/13, Stefano Sabatini <stefasab at gmail.com> wrote:
> > On date Sunday 2013-01-06 19:39:20 +0100, Stefano Sabatini encoded:
> >> On date Sunday 2013-01-06 19:34:16 +0100, Clement Boesch encoded:
> >> > This improves the performances just enough to match mp=kerndeint.
> >> > ---
> >> >  libavfilter/vf_kerndeint.c | 4 ++--
> >> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
> >> > index 382b8a7..a929714 100644
> >> > --- a/libavfilter/vf_kerndeint.c
> >> > +++ b/libavfilter/vf_kerndeint.c
> >> > @@ -102,7 +102,7 @@ static int config_props(AVFilterLink *inlink)
> >> >      kerndeint->vsub = desc->log2_chroma_h;
> >> >
> >> >      ret = av_image_alloc(kerndeint->tmp_data, kerndeint->tmp_bwidth,
> >> > -                          inlink->w, inlink->h, inlink->format, 1);
> >> > +                          inlink->w, inlink->h, inlink->format, 16);
> >>
> >> so now you should rename tmp_bwidth to tmp_linesize.
> >>
> >> >      if (ret < 0)
> >> >          return ret;
> >> >      memset(kerndeint->tmp_data[0], 0, ret);
> >> > @@ -157,7 +157,7 @@ static int filter_frame(AVFilterLink *inlink,
> >> > AVFilterBufferRef *inpic)
> >> >
> >> >      for (plane = 0; inpic->data[plane] && plane < 4; plane++) {
> >> >          h = plane == 0 ? inlink->h : inlink->h >> kerndeint->vsub;
> >> > -        bwidth = kerndeint->tmp_bwidth[plane];
> >> > +        bwidth = av_image_get_linesize(inlink->format, inlink->w,
> >> > plane);
> >>
> >> Alternatively, compute bwidth in config_props and store it in the
> >> kerndeint context, so you don't have to do it at each iteration.
> >
> > Updated, with some times obtained with the command:
> > ffmpeg -f lavfi -i testsrc=d=1000,format=yuv420p -vf kerndeint -f null -
> > -nostats

Pushed, waiting for more benchmarks.
-- 
FFmpeg = Fierce Fierce Mythic Pure Enlightened Geisha


More information about the ffmpeg-devel mailing list