[MPlayer-dev-eng] [PATCH] af_scaletempo

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Sep 14 11:10:49 CEST 2007


Hello,
On Fri, Sep 14, 2007 at 01:02:30AM -0400, Robert Juliano wrote:
> On Thu, Sep 13, 2007 at 10:50:31AM +0200, Reimar D?ffinger wrote:
> > > +#ifdef USE_INT
> > > +      corr += ( *pc * *pw ) / s->sloping_divider;
> > 
> > No wonder the int version is slower. Divisions in an inner loop are
> > horrible.
> > And since you are doing a sum I don't really see why you have to do the
> > division here and not outside the loop? It should still be faster and
> > more precise to do it outside, even if you had to make corr 64 bit to
> > avoid an overflow.
> 
> There are many ways to optimize this.  The best I've found
> is to convert to float, do all floating-point calculations,
> and then convert back to int.  With the division, the int
> version is 2-4x slower, 20% slower without it, even against
> two format conversions.

Only as long as nobody does a SIMD-version of it, which will be
harder with floats.
And there are probably more ways to optimize it than what I pointed out.
And lastly there are still systems like old Athlons that have rather
poor floating point performance.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list