33 #ifndef _AKSPEAKERVOLUMES_GENERIC_H_
34 #define _AKSPEAKERVOLUMES_GENERIC_H_
36 #include <AK/SoundEngine/Common/AkTypes.h>
38 #if defined( AK_CPU_ARM_NEON ) || ( ( defined( AK_CPU_X86 ) || defined( AK_CPU_X86_64 ) ) && !defined(AK_IOS) )
40 #define AKSIMD_SPEAKER_VOLUME
44 #ifdef AKSIMD_SPEAKER_VOLUME
51 namespace SpeakerVolumes
55 #ifdef AKSIMD_V4F32_SUPPORTED
56 #define SIZEOF_AKSIMD_V4F32 16
57 #define SIZEOF_AKSIMD_F32 4
59 AkForceInline AkUInt32 GetNumV4F32( AkUInt32 in_uNumChannels )
61 return (in_uNumChannels + SIZEOF_AKSIMD_F32 - 1) >> 2;
67 return GetNumV4F32( in_uNumChannels ) * 4;
73 return GetNumV4F32( in_uNumChannels ) * SIZEOF_AKSIMD_V4F32;
76 #elif defined (AKSIMD_V2F32_SUPPORTED)
77 #define SIZEOF_AKSIMD_V2F32 8
80 AkForceInline AkUInt32 GetNumV2F32( AkUInt32 in_uNumChannels )
82 return ( in_uNumChannels + ( SIZEOF_AKSIMD_V2F32 / 2 ) - 1 ) >> 1;
88 return GetNumV2F32( in_uNumChannels ) * 2;
94 return GetNumV2F32( in_uNumChannels ) * SIZEOF_AKSIMD_V2F32;
98 #error Should use scalar implementation.
109 namespace SpeakerVolumes
116 return in_uNumChannels *
sizeof( AkReal32 );
121 return in_uNumChannels;
127 #endif // AKSIMD_SPEAKER_VOLUME
129 #endif //_AKSPEAKERVOLUMES_GENERIC_H_
AkForceInline AkUInt32 GetRequiredSize(AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Compute size (in bytes) required for given channel configurations.
AkForceInline AkUInt32 GetNumElements(AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Compute size (in number of elements) required for given channel configurations.
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise