|
From: Christian S. <chr...@ep...> - 2004-05-28 13:30:05
|
Es geschah am Donnerstag, 27. Mai 2004 23:36 als St=E9phane LETZ schrieb:
> On 27 mai 04, at 23:08, be...@ga... wrote:
> > The offending code (probably due to a cut'n paste error)
> > is in line 199 of Voice.h
> >
> > pOutputLeft[i++] +=3D this->FilterRight.Apply(&bq_base, &bq_main,
> > effective_volume * ((((a * pos_fract) + b) * pos_fract + c) *
> > pos_fract + x0));
> >
> > It should be
> > pOutputRight[i++] +=3D ....
> >
> > Stephane spotted this problem and told me about it on IRC, he said
> > tried a patch that speeds up things a bit
> > (reading pSrc[0]..pSrc[7] in one rush in variables and then
> > use these variable for the stereo cubic interpolator.
> > He said on PPC its faster.
> >
> > Perhaps it makes sense to commit it ? Christian ?
> > (I sent a copy of the diff to Christian).
>
> What really speedup is the use of float instead of double (3.0f instead
> of 3.0 and so on..) *if* computing in double is not required of course.
> But this must be tested on X86 before committing.
What do you mean with "if" computing?
The patch looks ok, except:
inline void InterpolateOneStep_Mono(sample_t* pSrc, int& i,
[snip]
=2D float a =3D (3 * (x0 - x1) - xm1 + x2) / 2;
=2D float b =3D 2 * x1 + xm1 - (5 * x0 + x2) / 2;
=2D float c =3D (x1 - xm1) / 2;
+ float a =3D (3.0 * (x0 - x1) - xm1 + x2) * 0.5f;
+ float b =3D 2.0 * x1 + xm1 - (5.0 * x0 + x2) * 0.5f;
+ float c =3D (x1 - xm1) * 0.5f;
Intended? Why not:
+ float a =3D (3.0f * (x0 - x1) - xm1 + x2) * 0.5f;
+ float b =3D 2.0f * x1 + xm1 - (5.0f * x0 + x2) * 0.5=
f;
+ float c =3D (x1 - xm1) * 0.5f;
And the patch works of course for x86 and also fixes the 'only left channel=
'=20
bug.
CU
Christian
|