mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
use MA_ASSUME for channel counts before loops
The range of the value isn't obvious to any compiler, as it could go for one iteration or 4 billion iterations. Adding MA_ASSUME in these places helps the compiler understand the range of possible values, and know how heavily to vectorize (or not vectorize) these loops. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
This commit is contained in:
@@ -9323,6 +9323,9 @@ MA_API ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer,
|
||||
const ma_uint32 channelsOut = pSpatializer->config.channelsOut;
|
||||
const ma_uint32 channelsIn = pSpatializer->config.channelsIn;
|
||||
|
||||
MA_ASSUME(channelsOut >= MA_MIN_CHANNELS && channelsOut <= MA_MAX_CHANNELS);
|
||||
MA_ASSUME(channelsIn >= MA_MIN_CHANNELS && channelsIn <= MA_MAX_CHANNELS);
|
||||
|
||||
/*
|
||||
We'll need the listener velocity for doppler pitch calculations. The speed of sound is
|
||||
defined by the listener, so we'll grab that here too.
|
||||
|
||||
Reference in New Issue
Block a user