이 파일의 문서화 페이지로 가기
36 #ifndef _AK_SPEAKER_VOLUMES_H_
37 #define _AK_SPEAKER_VOLUMES_H_
40 #include <AK/SoundEngine/Platforms/Generic/AkSpeakerVolumes.h>
46 namespace SpeakerVolumes
59 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || in_uNumChannels == 0 );
60 if ( in_uNumChannels )
61 memcpy( in_pVolumesDst, in_pVolumesSrc, in_uNumChannels *
sizeof(
AkReal32 ) );
67 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || in_uNumChannels == 0 );
68 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++ )
70 in_pVolumesDst[uChan] = in_pVolumesSrc[uChan] * in_fGain;
77 AKASSERT( in_pVolumes || in_uNumChannels == 0 );
78 if ( in_uNumChannels )
79 memset( in_pVolumes, 0, in_uNumChannels *
sizeof(
AkReal32 ) );
85 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || in_uNumChannels == 0 );
86 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++ )
88 in_pVolumesDst[uChan] += in_pVolumesSrc[uChan];
96 AKASSERT((io_pVolumes) || in_uNumChannels == 0);
97 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++)
99 total += io_pVolumes[uChan];
108 AKASSERT( in_pVolumesDst || in_uNumChannels == 0 );
109 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++ )
111 in_pVolumesDst[uChan] *= in_fVol;
118 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || in_uNumChannels == 0 );
119 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++ )
121 in_pVolumesDst[uChan] *= in_pVolumesSrc[uChan];
128 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || in_uNumChannels == 0 );
129 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++ )
131 in_pVolumesDst[uChan] =
AkMax( in_pVolumesDst[uChan], in_pVolumesSrc[uChan] );
138 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || in_uNumChannels == 0 );
139 for (
AkUInt32 uChan = 0; uChan < in_uNumChannels; uChan++ )
141 in_pVolumesDst[uChan] =
AkMin( in_pVolumesDst[uChan], in_pVolumesSrc[uChan] );
179 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || uNumElements == 0 );
181 memcpy( in_pVolumesDst, in_pVolumesSrc, uNumElements *
sizeof(
AkReal32 ) );
188 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || uNumElements == 0 );
189 for (
AkUInt32 uChan = 0; uChan < uNumElements; uChan++ )
191 in_pVolumesDst[uChan] = in_pVolumesSrc[uChan] * in_fGain;
199 AKASSERT( in_pVolumes || uNumElements == 0 );
201 memset( in_pVolumes, 0, uNumElements *
sizeof(
AkReal32 ) );
208 AKASSERT( in_pVolumesDst || uNumElements == 0 );
209 for (
AkUInt32 uChan = 0; uChan < uNumElements; uChan++ )
211 in_pVolumesDst[uChan] *= in_fVol;
219 AKASSERT((in_pVolumesDst && in_pVolumesSrc) || uNumElements == 0);
220 for (
AkUInt32 uChan = 0; uChan < uNumElements; uChan++)
222 in_pVolumesDst[uChan] += in_pVolumesSrc[uChan];
230 AKASSERT((in_pVolumesDst && in_pVolumesSrc) || uNumElements == 0);
231 for (
AkUInt32 uChan = 0; uChan < uNumElements; uChan++)
233 in_pVolumesDst[uChan] += in_pVolumesSrc[uChan] * in_fGain;
241 AKASSERT( ( in_pVolumesDst && in_pVolumesSrc ) || uNumElements == 0 );
242 for (
AkUInt32 uChan = 0; uChan < uNumElements; uChan++ )
244 in_pVolumesDst[uChan] = ((in_pVolumesDst[uChan] * in_pVolumesDst[uChan]) > (in_pVolumesSrc[uChan] * in_pVolumesSrc[uChan])) ? in_pVolumesDst[uChan] : in_pVolumesSrc[uChan];
252 AKASSERT((in_pVolumesDst && in_pVolumesSrc) || uNumElements == 0);
253 for (
AkUInt32 uChan = 0; uChan < uNumElements; uChan++)
255 in_pVolumesDst[uChan] = (in_pVolumesDst[uChan] > in_pVolumesSrc[uChan]) ? in_pVolumesDst[uChan] : in_pVolumesSrc[uChan];
262 #endif //_AK_SPEAKER_VOLUMES_H_
AkForceInline void Copy(VectorPtr in_pVolumesDst, ConstVectorPtr in_pVolumesSrc, AkUInt32 in_uNumChannels)
Copy volumes.
AkForceInline AkReal32 L1Norm(ConstVectorPtr io_pVolumes, AkUInt32 in_uNumChannels)
Compute the sum of all components of a volume vector.
AkForceInline void Max(AkReal32 *in_pVolumesDst, const AkReal32 *in_pVolumesSrc, AkUInt32 in_uNumChannels)
Get max for all elements of two volume vectors, independently.
AkForceInline AkUInt32 GetRequiredSize(AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Compute size (in bytes) required for given channel configurations.
AkForceInline void Zero(MatrixPtr in_pVolumes, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Clear matrix.
AkForceInline AkUInt32 GetNumElements(AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Compute size (in number of elements) required for given channel configurations.
float AkReal32
32-bit floating point
AkForceInline void AbsMax(MatrixPtr in_pVolumesDst, ConstMatrixPtr in_pVolumesSrc, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Get absolute max for all elements of two volume matrices, independently.
AkReal32 * VectorPtr
Volume vector. Access each element with the standard bracket [] operator.
AkForceInline VectorPtr GetChannel(MatrixPtr in_pVolumeMx, AkUInt32 in_uIdxChannelIn, AkUInt32 in_uNumChannelsOut)
Get pointer to volume distribution for input channel in_uIdxChannelIn.
#define AKASSERT(Condition)
AkForceInline void Add(MatrixPtr in_pVolumesDst, ConstMatrixPtr in_pVolumesSrc, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Add all elements of two volume matrices, independently.
const AkReal32 * ConstMatrixPtr
Constant volume matrix. Access each input channel vector with AK::SpeakerVolumes::Matrix::GetChannel(...
AkForceInline void Zero(VectorPtr in_pVolumes, AkUInt32 in_uNumChannels)
Clear volumes.
AkForceInline void MAdd(MatrixPtr in_pVolumesDst, ConstMatrixPtr in_pVolumesSrc, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut, AkReal32 in_fGain)
Pointwise Multiply-Add of all elements of two volume matrices.
AkForceInline void Add(VectorPtr in_pVolumesDst, ConstVectorPtr in_pVolumesSrc, AkUInt32 in_uNumChannels)
Accumulate two volume vectors.
AkReal32 * MatrixPtr
Volume matrix. Access each input channel vector with AK::SpeakerVolumes::Matrix::GetChannel().
AkForceInline void Mul(MatrixPtr in_pVolumesDst, const AkReal32 in_fVol, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Multiply a matrix with a scalar.
uint32_t AkUInt32
Unsigned 32-bit integer
AkForceInline void Copy(MatrixPtr in_pVolumesDst, ConstMatrixPtr in_pVolumesSrc, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Copy matrix.
AkForceInline void Max(MatrixPtr in_pVolumesDst, ConstMatrixPtr in_pVolumesSrc, AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Get max for all elements of two volume matrices, independently.
const AkReal32 * ConstVectorPtr
Constant volume vector. Access each element with the standard bracket [] operator.
AkForceInline void Min(AkReal32 *in_pVolumesDst, const AkReal32 *in_pVolumesSrc, AkUInt32 in_uNumChannels)
Get min for all elements of two volume vectors, independently.
AkForceInline void Mul(VectorPtr in_pVolumesDst, const AkReal32 in_fVol, AkUInt32 in_uNumChannels)
Multiply volume vector with a scalar.
지원이 필요하신가요?
질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!
지원 페이지를 방문해 주세요
작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요