PortAudio
2.0
|
Conversion function implementations. More...
Macros | |
#define | PA_SELECT_FORMAT_(format, float32, int32, int24, int16, int8, uint8) |
#define | PA_SELECT_CONVERTER_DITHER_CLIP_(flags, source, destination) |
#define | PA_SELECT_CONVERTER_DITHER_(flags, source, destination) |
#define | PA_USE_CONVERTER_(source, destination) return paConverters. source ## _To_ ## destination; |
#define | PA_UNITY_CONVERSION_(wordlength) return paConverters. Copy_ ## wordlength ## _To_ ## wordlength; |
#define | PA_CLIP_(val, min, max) { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } |
Functions | |
PaSampleFormat | PaUtil_SelectClosestAvailableFormat (PaSampleFormat availableFormats, PaSampleFormat format) |
PaUtilConverter * | PaUtil_SelectConverter (PaSampleFormat sourceFormat, PaSampleFormat destinationFormat, PaStreamFlags flags) |
PaUtilZeroer * | PaUtil_SelectZeroer (PaSampleFormat destinationFormat) |
Variables | |
PaUtilConverterTable | paConverters |
PaUtilZeroerTable | paZeroers |
Conversion function implementations.
If the C9x function lrintf() is available, define PA_USE_C99_LRINTF to use it
#define PA_CLIP_ | ( | val, | |
min, | |||
max | |||
) | { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } |
#define PA_SELECT_CONVERTER_DITHER_ | ( | flags, | |
source, | |||
destination | |||
) |
Referenced by PaUtil_SelectConverter().
#define PA_SELECT_CONVERTER_DITHER_CLIP_ | ( | flags, | |
source, | |||
destination | |||
) |
Referenced by PaUtil_SelectConverter().
#define PA_SELECT_FORMAT_ | ( | format, | |
float32, | |||
int32, | |||
int24, | |||
int16, | |||
int8, | |||
uint8 | |||
) |
Referenced by PaUtil_SelectConverter().
#define PA_UNITY_CONVERSION_ | ( | wordlength | ) | return paConverters. Copy_ ## wordlength ## _To_ ## wordlength; |
Referenced by PaUtil_SelectConverter().
#define PA_USE_CONVERTER_ | ( | source, | |
destination | |||
) | return paConverters. source ## _To_ ## destination; |
Referenced by PaUtil_SelectConverter().
PaSampleFormat PaUtil_SelectClosestAvailableFormat | ( | PaSampleFormat | availableFormats, |
PaSampleFormat | format | ||
) |
Choose an available sample format which is most appropriate for representing the requested format. If the requested format is not available higher quality formats are considered before lower quality formates.
availableFormats | A variable containing the logical OR of all available formats. |
format | The desired format. |
References paCustomFormat, paNonInterleaved, and paSampleFormatNotSupported.
PaUtilConverter* PaUtil_SelectConverter | ( | PaSampleFormat | sourceFormat, |
PaSampleFormat | destinationFormat, | ||
PaStreamFlags | flags | ||
) |
Find a sample converter function for the given source and destinations formats and flags (clip and dither.)
References PA_SELECT_CONVERTER_DITHER_, PA_SELECT_CONVERTER_DITHER_CLIP_, PA_SELECT_FORMAT_, PA_UNITY_CONVERSION_, and PA_USE_CONVERTER_.
Referenced by main(), and PaUtil_InitializeBufferProcessor().
PaUtilZeroer* PaUtil_SelectZeroer | ( | PaSampleFormat | destinationFormat | ) |
Find a buffer zeroer function for the given destination format.
References paFloat32, paInt16, paInt24, paInt32, paInt8, paNonInterleaved, paUInt8, paZeroers, PaUtilZeroerTable::Zero16, PaUtilZeroerTable::Zero24, PaUtilZeroerTable::Zero32, PaUtilZeroerTable::Zero8, and PaUtilZeroerTable::ZeroU8.
Referenced by PaUtil_InitializeBufferProcessor().
PaUtilConverterTable paConverters |
A table of pointers to all required converter functions. PaUtil_SelectConverter() uses this table to lookup the appropriate conversion functions. The fields of this structure are initialized with default conversion functions. Fields may be NULL, indicating that no conversion function is available. User code may substitue optimised conversion functions by assigning different function pointers to these fields.
Referenced by PaUtil_InitializeX86PlainConverters().
PaUtilZeroerTable paZeroers |
A table of pointers to all required zeroer functions. PaUtil_SelectZeroer() uses this table to lookup the appropriate conversion functions. The fields of this structure are initialized with default conversion functions. User code may substitue optimised conversion functions by assigning different function pointers to these fields.
Referenced by PaUtil_SelectZeroer().