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
00049 #include "portaudio.h"
00050
00051 #ifdef __cplusplus
00052 extern "C"
00053 {
00054 #endif
00055
00056
00057 struct PaUtilTriangularDitherGenerator;
00058
00059
00069 PaSampleFormat PaUtil_SelectClosestAvailableFormat(
00070 PaSampleFormat availableFormats, PaSampleFormat format );
00071
00072
00073
00074
00075
00090 typedef void PaUtilConverter(
00091 void *destinationBuffer, signed int destinationStride,
00092 void *sourceBuffer, signed int sourceStride,
00093 unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator );
00094
00095
00107 PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat,
00108 PaSampleFormat destinationFormat, PaStreamFlags flags );
00109
00110
00119 typedef void PaUtilZeroer(
00120 void *destinationBuffer, signed int destinationStride, unsigned int count );
00121
00122
00128 PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat );
00129
00130
00131
00132
00133
00134
00138 typedef struct{
00139 PaUtilConverter *Float32_To_Int32;
00140 PaUtilConverter *Float32_To_Int32_Dither;
00141 PaUtilConverter *Float32_To_Int32_Clip;
00142 PaUtilConverter *Float32_To_Int32_DitherClip;
00143
00144 PaUtilConverter *Float32_To_Int24;
00145 PaUtilConverter *Float32_To_Int24_Dither;
00146 PaUtilConverter *Float32_To_Int24_Clip;
00147 PaUtilConverter *Float32_To_Int24_DitherClip;
00148
00149 PaUtilConverter *Float32_To_Int16;
00150 PaUtilConverter *Float32_To_Int16_Dither;
00151 PaUtilConverter *Float32_To_Int16_Clip;
00152 PaUtilConverter *Float32_To_Int16_DitherClip;
00153
00154 PaUtilConverter *Float32_To_Int8;
00155 PaUtilConverter *Float32_To_Int8_Dither;
00156 PaUtilConverter *Float32_To_Int8_Clip;
00157 PaUtilConverter *Float32_To_Int8_DitherClip;
00158
00159 PaUtilConverter *Float32_To_UInt8;
00160 PaUtilConverter *Float32_To_UInt8_Dither;
00161 PaUtilConverter *Float32_To_UInt8_Clip;
00162 PaUtilConverter *Float32_To_UInt8_DitherClip;
00163
00164 PaUtilConverter *Int32_To_Float32;
00165 PaUtilConverter *Int32_To_Int24;
00166 PaUtilConverter *Int32_To_Int24_Dither;
00167 PaUtilConverter *Int32_To_Int16;
00168 PaUtilConverter *Int32_To_Int16_Dither;
00169 PaUtilConverter *Int32_To_Int8;
00170 PaUtilConverter *Int32_To_Int8_Dither;
00171 PaUtilConverter *Int32_To_UInt8;
00172 PaUtilConverter *Int32_To_UInt8_Dither;
00173
00174 PaUtilConverter *Int24_To_Float32;
00175 PaUtilConverter *Int24_To_Int32;
00176 PaUtilConverter *Int24_To_Int16;
00177 PaUtilConverter *Int24_To_Int16_Dither;
00178 PaUtilConverter *Int24_To_Int8;
00179 PaUtilConverter *Int24_To_Int8_Dither;
00180 PaUtilConverter *Int24_To_UInt8;
00181 PaUtilConverter *Int24_To_UInt8_Dither;
00182
00183 PaUtilConverter *Int16_To_Float32;
00184 PaUtilConverter *Int16_To_Int32;
00185 PaUtilConverter *Int16_To_Int24;
00186 PaUtilConverter *Int16_To_Int8;
00187 PaUtilConverter *Int16_To_Int8_Dither;
00188 PaUtilConverter *Int16_To_UInt8;
00189 PaUtilConverter *Int16_To_UInt8_Dither;
00190
00191 PaUtilConverter *Int8_To_Float32;
00192 PaUtilConverter *Int8_To_Int32;
00193 PaUtilConverter *Int8_To_Int24;
00194 PaUtilConverter *Int8_To_Int16;
00195 PaUtilConverter *Int8_To_UInt8;
00196
00197 PaUtilConverter *UInt8_To_Float32;
00198 PaUtilConverter *UInt8_To_Int32;
00199 PaUtilConverter *UInt8_To_Int24;
00200 PaUtilConverter *UInt8_To_Int16;
00201 PaUtilConverter *UInt8_To_Int8;
00202
00203 PaUtilConverter *Copy_8_To_8;
00204 PaUtilConverter *Copy_16_To_16;
00205 PaUtilConverter *Copy_24_To_24;
00206 PaUtilConverter *Copy_32_To_32;
00207 } PaUtilConverterTable;
00208
00209
00227 extern PaUtilConverterTable paConverters;
00228
00229
00233 typedef struct{
00234 PaUtilZeroer *ZeroU8;
00235 PaUtilZeroer *Zero8;
00236 PaUtilZeroer *Zero16;
00237 PaUtilZeroer *Zero24;
00238 PaUtilZeroer *Zero32;
00239 } PaUtilZeroerTable;
00240
00241
00258 extern PaUtilZeroerTable paZeroers;
00259
00260 #ifdef __cplusplus
00261 }
00262 #endif
00263 #endif