PortAudio
2.0
|
Conversion functions used to convert buffers of samples from one format to another. More...
#include "portaudio.h"
Go to the source code of this file.
Data Structures | |
struct | PaUtilConverterTable |
struct | PaUtilZeroerTable |
Typedefs | |
typedef void | PaUtilConverter (void *destinationBuffer, signed int destinationStride, void *sourceBuffer, signed int sourceStride, unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator) |
typedef void | PaUtilZeroer (void *destinationBuffer, signed int destinationStride, unsigned int count) |
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 functions used to convert buffers of samples from one format to another.
typedef void PaUtilConverter(void *destinationBuffer, signed int destinationStride, void *sourceBuffer, signed int sourceStride, unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator) |
The generic sample converter prototype. Sample converters convert count samples from sourceBuffer to destinationBuffer. The actual type of the data pointed to by these parameters varys for different converter functions.
destinationBuffer | A pointer to the first sample of the destination. |
destinationStride | An offset between successive destination samples expressed in samples (not bytes.) It may be negative. |
sourceBuffer | A pointer to the first sample of the source. |
sourceStride | An offset between successive source samples expressed in samples (not bytes.) It may be negative. |
count | The number of samples to convert. |
ditherState | State information used to calculate dither. Converters that do not perform dithering will ignore this parameter, in which case NULL or invalid dither state may be passed. |
typedef void PaUtilZeroer(void *destinationBuffer, signed int destinationStride, unsigned int count) |
The generic buffer zeroer prototype. Buffer zeroers copy count zeros to destinationBuffer. The actual type of the data pointed to varys for different zeroer functions.
destinationBuffer | A pointer to the first sample of the destination. |
destinationStride | An offset between successive destination samples expressed in samples (not bytes.) It may be negative. |
count | The number of samples to zero. |
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().