[MPlayer-dev-eng] [PATCH] faster lavcresample

Dan Oscarsson Dan.Oscarsson at tieto.com
Wed Jun 16 19:23:02 CEST 2010


tis 2010-06-15 klockan 08:01 +0200 skrev Michael Niedermayer:
> On Sun, Jun 13, 2010 at 02:16:05PM +0200, Dan Oscarsson wrote:
> > While writing my patches to make a-v-sync use pts and vsyncs, I found
> > that changing speed disrupts normal processing quite a lot. Changing
> > speed takes a lot of CPU. Analysing I found that lavcresample is about a
> > 1000 times slower than scaletempo to initialise. While lavcresample is
> > complex and I have not spent much time on it, I found that af_init calls
> > af_reinit twice. To reduce CPU time needed to initialise a speed change
> > using lavcresample by half, the attached patch makes lavcresample on
> > recalculate its tables each time its parameters change. So calling it
> > twice with same parameters only results in one table calculation.
> 
> why is af_reinit() called twice?
> 
> Iam not against your change to af_lavcresample.c, it actually looks ok
> but maybe we could fix the root of the 2x call.

As I am working on other parts I have not done a deep study. It might
need a change in how filters are initialised and chained together which
might be easier to do for somebody who have worked with the design of
the audio filters.

> 
> Also making av_resample_init() faster is welcome, the problem likely
> is the speed of bessel() and the number of calls to it.
> init is likely also a much bigger issue for fpu-less systems

Yes, I am sure there are several places in the audio filters that could
be changed, but as I wanted to work on a-v-sync this was the best quick
enhancement I had time for.

   Dan




More information about the MPlayer-dev-eng mailing list