diff options
author | Chris Robinson <[email protected]> | 2017-06-27 07:25:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-06-27 07:25:08 -0700 |
commit | e9a7218a06e268afcedf8207e5a5d79991e21356 (patch) | |
tree | 987d2bbf3f1c80d9ebe0247b4205e644d5db7caa | |
parent | 8f2bbc434c91b5d402de0e44b862a272928667a9 (diff) |
Remove the fastf2u conversion function
-rw-r--r-- | Alc/ALu.c | 4 | ||||
-rw-r--r-- | Alc/effects/chorus.c | 2 | ||||
-rw-r--r-- | Alc/effects/modulator.c | 2 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 14 | ||||
-rw-r--r-- | Alc/helpers.c | 1 | ||||
-rw-r--r-- | Alc/mastering.c | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 5 |
7 files changed, 12 insertions, 18 deletions
@@ -231,7 +231,7 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state) { 24, 24, 24, 24, 24, 24, 24, 20, 20, 20, 16, 16, 16, 12, 12, 0 } }; ALfloat sf; - ALuint si, pi; + ALsizei si, pi; ALboolean uncut = AL_TRUE; if(increment > FRACTIONONE) @@ -249,7 +249,7 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state) else { sf = (BSINC_SCALE_COUNT - 1) * (sf - scaleBase) * scaleRange; - si = fastf2u(sf); + si = fastf2i(sf); /* The interpolation factor is fit to this diagonally-symmetric * curve to reduce the transition ripple caused by interpolating * different scales of the sinc function. diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index 5ef82cb4..f4383aa5 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -91,7 +91,7 @@ static ALboolean ALchorusState_deviceUpdate(ALchorusState *state, ALCdevice *Dev ALsizei maxlen; ALsizei it; - maxlen = fastf2u(AL_CHORUS_MAX_DELAY * 2.0f * Device->Frequency) + 1; + maxlen = fastf2i(AL_CHORUS_MAX_DELAY * 2.0f * Device->Frequency) + 1; maxlen = NextPowerOf2(maxlen); if(maxlen != state->BufferLength) diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index e9026a62..5de88fcd 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -127,7 +127,7 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice * else /*if(Slot->Params.EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SQUARE)*/ state->Process = ModulateSquare; - state->step = fastf2u(props->Modulator.Frequency*WAVEFORM_FRACONE / + state->step = fastf2i(props->Modulator.Frequency*WAVEFORM_FRACONE / Device->Frequency); if(state->step == 0) state->step = 1; diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index e0c0831a..44174b75 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -511,7 +511,7 @@ static ALuint CalcLineLength(const ALfloat length, const ptrdiff_t offset, const /* All line lengths are powers of 2, calculated from their lengths in * seconds, rounded up. */ - samples = fastf2u(ceilf(length*frequency)); + samples = fastf2i(ceilf(length*frequency)); samples = NextPowerOf2(samples + extra); /* All lines share a single sample buffer. */ @@ -627,7 +627,7 @@ static ALboolean ALreverbState_deviceUpdate(ALreverbState *State, ALCdevice *Dev /* The late feed taps are set a fixed position past the latest delay tap. */ for(i = 0;i < 4;i++) - State->LateFeedTap = fastf2u((AL_EAXREVERB_MAX_REFLECTIONS_DELAY + + State->LateFeedTap = fastf2i((AL_EAXREVERB_MAX_REFLECTIONS_DELAY + EARLY_TAP_LENGTHS[3]*multiplier) * frequency); @@ -1055,7 +1055,7 @@ static ALvoid UpdateModulator(const ALfloat modTime, const ALfloat modDepth, * (1 sample) and when the timing changes, the index is rescaled to the new * range to keep the sinus consistent. */ - range = maxu(fastf2u(modTime*frequency), 1); + range = maxi(fastf2i(modTime*frequency), 1); State->Mod.Index = (ALuint)(State->Mod.Index * (ALuint64)range / State->Mod.Range); State->Mod.Range = range; @@ -1094,13 +1094,13 @@ static ALvoid UpdateDelayLine(const ALfloat earlyDelay, const ALfloat lateDelay, for(i = 0;i < 4;i++) { length = earlyDelay + EARLY_TAP_LENGTHS[i]*multiplier; - State->EarlyDelayTap[i][1] = fastf2u(length * frequency); + State->EarlyDelayTap[i][1] = fastf2i(length * frequency); length = EARLY_TAP_LENGTHS[i]*multiplier; State->EarlyDelayCoeff[i] = CalcDecayCoeff(length, decayTime); length = lateDelay + (LATE_LINE_LENGTHS[i] - LATE_LINE_LENGTHS[0])*0.25f*multiplier; - State->LateDelayTap[i][1] = State->LateFeedTap + fastf2u(length * frequency); + State->LateDelayTap[i][1] = State->LateFeedTap + fastf2i(length * frequency); } } @@ -1124,7 +1124,7 @@ static ALvoid UpdateEarlyLines(const ALfloat density, const ALfloat decayTime, c length = EARLY_LINE_LENGTHS[i] * multiplier; /* Calculate the delay offset for each delay line. */ - State->Early.Offset[i][1] = fastf2u(length * frequency); + State->Early.Offset[i][1] = fastf2i(length * frequency); /* Calculate the gain (coefficient) for each line. */ State->Early.Coeff[i] = CalcDecayCoeff(length, decayTime); @@ -1181,7 +1181,7 @@ static ALvoid UpdateLateLines(const ALfloat density, const ALfloat diffusion, co length = lerp(LATE_LINE_LENGTHS[i] * multiplier, echoTime, echoDepth); /* Calculate the delay offset for each delay line. */ - State->Late.Offset[i][1] = fastf2u(length * frequency); + State->Late.Offset[i][1] = fastf2i(length * frequency); /* Approximate the absorption that the vector all-pass would exhibit * given the current diffusion so we don't have to process a full T60 diff --git a/Alc/helpers.c b/Alc/helpers.c index 53623d85..8e6306ae 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -121,7 +121,6 @@ extern inline ALuint64 ScaleRound(ALuint64 val, ALuint64 new_scale, ALuint64 old extern inline ALuint64 ScaleFloor(ALuint64 val, ALuint64 new_scale, ALuint64 old_scale); extern inline ALuint64 ScaleCeil(ALuint64 val, ALuint64 new_scale, ALuint64 old_scale); extern inline ALint fastf2i(ALfloat f); -extern inline ALuint fastf2u(ALfloat f); ALuint CPUCapFlags = 0; diff --git a/Alc/mastering.c b/Alc/mastering.c index c9f5bebd..9de5fd5f 100644 --- a/Alc/mastering.c +++ b/Alc/mastering.c @@ -89,7 +89,7 @@ static void RmsDetection(Compressor *Comp, const ALsizei SamplesToDo) ALfloat sig = Comp->Envelope[i]; sum -= window[index]; - window[index] = fastf2u(minf(sig * sig * 65536.0f, RMS_VALUE_MAX)); + window[index] = fastf2i(minf(sig * sig * 65536.0f, RMS_VALUE_MAX)); sum += window[index]; index = (index + 1) & RMS_WINDOW_MASK; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 9460a3f1..be80020b 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -443,11 +443,6 @@ inline ALint fastf2i(ALfloat f) #endif } -/* Fast float-to-uint conversion. Assumes the FPU is already in round-to-zero - * mode. */ -inline ALuint fastf2u(ALfloat f) -{ return fastf2i(f); } - enum DevProbe { ALL_DEVICE_PROBE, |