mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=1074765 move const periodicWaveSize multiplier out of loop r=rillian
--HG-- extra : rebase_source : f09104d4df99cf36dd03c883eec2980d503b0c06
This commit is contained in:
parent
0c31695917
commit
7b2e924b39
@ -376,16 +376,18 @@ public:
|
||||
float* higherWaveData = nullptr;
|
||||
float* lowerWaveData = nullptr;
|
||||
float tableInterpolationFactor;
|
||||
float rate = 1.0 / mSource->SampleRate();
|
||||
|
||||
// Phase increment at frequency of 1 Hz.
|
||||
// mPhase runs [0,periodicWaveSize) here instead of [0,2*M_PI).
|
||||
float basePhaseIncrement =
|
||||
static_cast<float>(periodicWaveSize) / mSource->SampleRate();
|
||||
|
||||
for (uint32_t i = aStart; i < aEnd; ++i) {
|
||||
UpdateParametersIfNeeded(ticks, i);
|
||||
mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency,
|
||||
lowerWaveData,
|
||||
higherWaveData,
|
||||
tableInterpolationFactor);
|
||||
// mPhase runs 0..periodicWaveSize here instead of 0..2*M_PI.
|
||||
mPhase += periodicWaveSize * mFinalFrequency * rate;
|
||||
mPhase += basePhaseIncrement * mFinalFrequency;
|
||||
mPhase = fmod(mPhase, periodicWaveSize);
|
||||
// Bilinear interpolation between adjacent samples in each table.
|
||||
uint32_t j1 = floor(mPhase);
|
||||
|
Loading…
Reference in New Issue
Block a user