we should consider moving this and https://github.com/xbmc/xbmc/blob/master/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp#L220 to utils