diff options
author | Chris Robinson <[email protected]> | 2018-05-04 02:05:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-05-04 02:09:32 -0700 |
commit | 75e2cb97f74aeed2e50e4355607f041414a43976 (patch) | |
tree | 70d5957e9616fccc65b81a1dc4ff62babf1b6b36 /Alc/ALu.c | |
parent | ac8dbd7a56e4ca0ccfbef61b89bdb55775abea6a (diff) |
Don't assume round-to-zero for fastf2i
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1092,7 +1092,7 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *p if(Pitch > (ALfloat)MAX_PITCH) voice->Step = MAX_PITCH<<FRACTIONBITS; else - voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1); + voice->Step = maxi(fastf2i(Pitch * FRACTIONONE), 1); if(props->Resampler == BSinc24Resampler) BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24); else if(props->Resampler == BSinc12Resampler) @@ -1453,7 +1453,7 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *prop if(Pitch > (ALfloat)MAX_PITCH) voice->Step = MAX_PITCH<<FRACTIONBITS; else - voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1); + voice->Step = maxi(fastf2i(Pitch * FRACTIONONE), 1); if(props->Resampler == BSinc24Resampler) BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24); else if(props->Resampler == BSinc12Resampler) @@ -1663,7 +1663,7 @@ static void ApplyDither(ALfloat (*restrict Samples)[BUFFERSIZE], ALuint *dither_ ALuint rng0 = dither_rng(&seed); ALuint rng1 = dither_rng(&seed); val += (ALfloat)(rng0*(1.0/UINT_MAX) - rng1*(1.0/UINT_MAX)); - samples[i] = roundf(val) * invscale; + samples[i] = fastf2i(val) * invscale; } } *dither_seed = seed; |