Namespaces |
namespace | SSE |
Classes |
struct | IfThenElse< true, TrueType, FalseType > |
struct | IfThenElse< false, TrueType, FalseType > |
struct | ScaleFactor |
struct | ScaleFactor< Source, Source > |
Functions |
DWORD | ConvertCopy (LPCVOID pSrcArray, DWORD numFrames, PVOID pDstArray, WORD sampleSize, WORD numChannels) |
| DEFINE_DETERMINE_PCM_CHANNEL_X_HELPER (Up) |
| DEFINE_DETERMINE_PCM_CHANNEL_X_HELPER (Down) |
| DEFINE_DETERMINE_PCM_CHANNEL_X_HELPER (Equal) |
| DEFINE_DETERMINE_FLOAT_CHANNEL_X_HELPER (Up) |
| DEFINE_DETERMINE_FLOAT_CHANNEL_X_HELPER (Down) |
| DEFINE_DETERMINE_FLOAT_CHANNEL_X_HELPER (Equal) |
template<class SourceSampleType , class DestSampleType > |
DWORD | ConvertChannelEqual (LPCVOID pSrcArray, DWORD numFrames, PVOID pDstArray, WORD srcChannels, WORD) |
template<class DestSampleType > |
DWORD | ConvertChannelEqual (LPCVOID pSrcArray, DWORD numFrames, PVOID pDstArray, WORD srcChannels) |
template<class DestSampleType > |
DWORD | ConvertChannelEqualSSE (LPCVOID pSrcArray, DWORD numFrames, PVOID pDstArray, WORD srcChannels) |
template<class SourceSampleType , class DestSampleType > |
DWORD | ConvertChannelDown (LPCVOID pSrcArray, DWORD numFrames, PVOID pDstArray, WORD srcChannels, WORD dstChannels) |
template<class SourceSampleType , class DestSampleType > |
DWORD | ConvertChannelUp (LPCVOID pSrcArray, DWORD numFrames, PVOID pDstArray, WORD srcChannels, WORD dstChannels) |
Contains functions and values used in samples conversion These are not to be used directly, instead the relevant functions are chosen by DetermineSampleConverter() and called indirectly by the ConverterFnPtr variable it returns
template<class SourceSampleType , class DestSampleType >
DWORD detail::ConvertChannelDown |
( |
LPCVOID |
pSrcArray, |
|
|
DWORD |
numFrames, |
|
|
PVOID |
pDstArray, |
|
|
WORD |
srcChannels, |
|
|
WORD |
dstChannels |
|
) |
| |
Folds down samples when there are more source channels than destination ones
For every frame, an average of every (srcChannels / dstChannels) scaled samples are taken. Left over channel samples from the division (i.e. srcChannels % dstChannels) are included in the average at the rate of one extra per dstChannel until they've all been included.
- Parameters:
-
pSrcArray | The (srcChannels * numFrames) samples |
numFrames | The number of frames of data in pSrcArray |
pDstArray | Output buffer for the dest type samples |
srcChannels | Number of channels of data in the input buffer |
dstChannels | Number of channels of data in the output buffer |
- Returns:
- Number of bytes written to pDstArray
template<class SourceSampleType , class DestSampleType >
DWORD detail::ConvertChannelEqual |
( |
LPCVOID |
pSrcArray, |
|
|
DWORD |
numFrames, |
|
|
PVOID |
pDstArray, |
|
|
WORD |
srcChannels, |
|
|
WORD |
|
|
) |
| |
Simply converts source samples to destination samples
Loops through (srcChannels * numFrames) source samples, converting them to destination samples by dividing by the scale factor. The unused parameter would be for the dstChannels variable, but with an equal number of channels this is the same value as the srcChannels variable so it is unnecessary
- Parameters:
-
pSrcArray | The (srcChannels * numFrames) source samples of type SourceSampleType |
numFrames | The number of frames of data in pSrcArray |
pDstArray | Output buffer for the dest type samples |
srcChannels | Number of channels of data in the input and output |
- Returns:
- Number of bytes written to pDstArray
template<class DestSampleType >
DWORD detail::ConvertChannelEqual |
( |
LPCVOID |
pSrcArray, |
|
|
DWORD |
numFrames, |
|
|
PVOID |
pDstArray, |
|
|
WORD |
srcChannels |
|
) |
| |
Simply converts float samples to destination samples
Loops through (srcChannels * numFrames) float samples, converting them to destination samples by multiplying by max(DestSampleType). These are multiplied rather than divided because float samples are in the range of [-1,1].
- Parameters:
-
pSrcArray | The (srcChannels * numFrames) float samples |
numFrames | The number of frames of data in pSrcArray |
pDstArray | Output buffer for the dest type samples |
srcChannels | Number of channels of data in the input and output |
- Returns:
- Number of bytes written to pDstArray
template<class DestSampleType >
DWORD detail::ConvertChannelEqualSSE |
( |
LPCVOID |
pSrcArray, |
|
|
DWORD |
numFrames, |
|
|
PVOID |
pDstArray, |
|
|
WORD |
srcChannels |
|
) |
| |
Converts float samples to destination samples using SSE
Converts the source sample floats to their integer destination type (int or short) first in groups of 16, then in groups of 4 and then individually for any odd leftovers. From testing float->integral with channels equal is the most common case, hence why this has an SSE implementation.
- Parameters:
-
pSrcArray | The (srcChannels * numFrames) float samples |
numFrames | The number of frames of data in pSrcArray |
pDstArray | Output buffer for the dest type samples |
srcChannels | Number of channels of data in the input and output |
- Returns:
- Number of bytes written to pDstArray
template<class SourceSampleType , class DestSampleType >
DWORD detail::ConvertChannelUp |
( |
LPCVOID |
pSrcArray, |
|
|
DWORD |
numFrames, |
|
|
PVOID |
pDstArray, |
|
|
WORD |
srcChannels, |
|
|
WORD |
dstChannels |
|
) |
| |
Replicates samples when there are more destination channels than source ones
For every frame, one converted source channel is copied to every (dstChannels / srcChannels) channels. Channels unaccounted for by this division (i.e. dstChannels % srcChannels) are written at the rate of one per source channel until they've all been filled.
- Parameters:
-
pSrcArray | The (srcChannels * numFrames) samples |
numFrames | The number of frames of data in pSrcArray |
pDstArray | Output buffer for the dest type samples |
srcChannels | Number of channels of data in the input buffer |
dstChannels | Number of channels of data in the output buffer |
- Returns:
- Number of bytes written to pDstArray