00001 #ifndef PA_CONVERTERS_H
00002 #define PA_CONVERTERS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00047 #include "portaudio.h"
00048
00049 #ifdef __cplusplus
00050 extern "C"
00051 {
00052 #endif
00053
00054
00055 struct PaUtilTriangularDitherGenerator;
00056
00057
00067 PaSampleFormat PaUtil_SelectClosestAvailableFormat(
00068 PaSampleFormat availableFormats, PaSampleFormat format );
00069
00070
00071
00072
00073
00088 typedef void PaUtilConverter(
00089 void *destinationBuffer, signed int destinationStride,
00090 void *sourceBuffer, signed int sourceStride,
00091 unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator );
00092
00093
00105 PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat,
00106 PaSampleFormat destinationFormat, PaStreamFlags flags );
00107
00108
00117 typedef void PaUtilZeroer(
00118 void *destinationBuffer, signed int destinationStride, unsigned int count );
00119
00120
00126 PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat );
00127
00128
00129
00130
00131
00132
00136 typedef struct{
00137 PaUtilConverter *Float32_To_Int32;
00138 PaUtilConverter *Float32_To_Int32_Dither;
00139 PaUtilConverter *Float32_To_Int32_Clip;
00140 PaUtilConverter *Float32_To_Int32_DitherClip;
00141
00142 PaUtilConverter *Float32_To_Int24;
00143 PaUtilConverter *Float32_To_Int24_Dither;
00144 PaUtilConverter *Float32_To_Int24_Clip;
00145 PaUtilConverter *Float32_To_Int24_DitherClip;
00146
00147 PaUtilConverter *Float32_To_Int16;
00148 PaUtilConverter *Float32_To_Int16_Dither;
00149 PaUtilConverter *Float32_To_Int16_Clip;
00150 PaUtilConverter *Float32_To_Int16_DitherClip;
00151
00152 PaUtilConverter *Float32_To_Int8;
00153 PaUtilConverter *Float32_To_Int8_Dither;
00154 PaUtilConverter *Float32_To_Int8_Clip;
00155 PaUtilConverter *Float32_To_Int8_DitherClip;
00156
00157 PaUtilConverter *Float32_To_UInt8;
00158 PaUtilConverter *Float32_To_UInt8_Dither;
00159 PaUtilConverter *Float32_To_UInt8_Clip;
00160 PaUtilConverter *Float32_To_UInt8_DitherClip;
00161
00162 PaUtilConverter *Int32_To_Float32;
00163 PaUtilConverter *Int32_To_Int24;
00164 PaUtilConverter *Int32_To_Int24_Dither;
00165 PaUtilConverter *Int32_To_Int16;
00166 PaUtilConverter *Int32_To_Int16_Dither;
00167 PaUtilConverter *Int32_To_Int8;
00168 PaUtilConverter *Int32_To_Int8_Dither;
00169 PaUtilConverter *Int32_To_UInt8;
00170 PaUtilConverter *Int32_To_UInt8_Dither;
00171
00172 PaUtilConverter *Int24_To_Float32;
00173 PaUtilConverter *Int24_To_Int32;
00174 PaUtilConverter *Int24_To_Int16;
00175 PaUtilConverter *Int24_To_Int16_Dither;
00176 PaUtilConverter *Int24_To_Int8;
00177 PaUtilConverter *Int24_To_Int8_Dither;
00178 PaUtilConverter *Int24_To_UInt8;
00179 PaUtilConverter *Int24_To_UInt8_Dither;
00180
00181 PaUtilConverter *Int16_To_Float32;
00182 PaUtilConverter *Int16_To_Int32;
00183 PaUtilConverter *Int16_To_Int24;
00184 PaUtilConverter *Int16_To_Int8;
00185 PaUtilConverter *Int16_To_Int8_Dither;
00186 PaUtilConverter *Int16_To_UInt8;
00187 PaUtilConverter *Int16_To_UInt8_Dither;
00188
00189 PaUtilConverter *Int8_To_Float32;
00190 PaUtilConverter *Int8_To_Int32;
00191 PaUtilConverter *Int8_To_Int24;
00192 PaUtilConverter *Int8_To_Int16;
00193 PaUtilConverter *Int8_To_UInt8;
00194
00195 PaUtilConverter *UInt8_To_Float32;
00196 PaUtilConverter *UInt8_To_Int32;
00197 PaUtilConverter *UInt8_To_Int24;
00198 PaUtilConverter *UInt8_To_Int16;
00199 PaUtilConverter *UInt8_To_Int8;
00200
00201 PaUtilConverter *Copy_8_To_8;
00202 PaUtilConverter *Copy_16_To_16;
00203 PaUtilConverter *Copy_24_To_24;
00204 PaUtilConverter *Copy_32_To_32;
00205 } PaUtilConverterTable;
00206
00207
00225 extern PaUtilConverterTable paConverters;
00226
00227
00231 typedef struct{
00232 PaUtilZeroer *ZeroU8;
00233 PaUtilZeroer *Zero8;
00234 PaUtilZeroer *Zero16;
00235 PaUtilZeroer *Zero24;
00236 PaUtilZeroer *Zero32;
00237 } PaUtilZeroerTable;
00238
00239
00256 extern PaUtilZeroerTable paZeroers;
00257
00258 #ifdef __cplusplus
00259 }
00260 #endif
00261 #endif