|
Blender
V2.59
|
00001 /* 00002 * $Id: AUD_ConverterFunctions.h 35141 2011-02-25 10:21:56Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * Copyright 2009-2011 Jörg Hermann Müller 00007 * 00008 * This file is part of AudaSpace. 00009 * 00010 * Audaspace is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * AudaSpace is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with Audaspace; if not, write to the Free Software Foundation, 00022 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00023 * 00024 * ***** END GPL LICENSE BLOCK ***** 00025 */ 00026 00032 #ifndef AUD_CONVERTERFUNCTIONS 00033 #define AUD_CONVERTERFUNCTIONS 00034 00035 #include "AUD_Space.h" 00036 00037 #include <cstring> 00038 #ifdef _MSC_VER 00039 #if (_MSC_VER < 1300) 00040 typedef short int16_t; 00041 typedef int int32_t; 00042 #else 00043 typedef __int16 int16_t; 00044 typedef __int32 int32_t; 00045 #endif 00046 #else 00047 #include <stdint.h> 00048 #endif 00049 00050 typedef void (*AUD_convert_f)(data_t* target, data_t* source, int length); 00051 00052 template <class T> 00053 void AUD_convert_copy(data_t* target, data_t* source, int length) 00054 { 00055 memcpy(target, source, length*sizeof(T)); 00056 } 00057 00058 void AUD_convert_u8_s16(data_t* target, data_t* source, int length); 00059 00060 void AUD_convert_u8_s24_be(data_t* target, data_t* source, int length); 00061 00062 void AUD_convert_u8_s24_le(data_t* target, data_t* source, int length); 00063 00064 void AUD_convert_u8_s32(data_t* target, data_t* source, int length); 00065 00066 void AUD_convert_u8_float(data_t* target, data_t* source, int length); 00067 00068 void AUD_convert_u8_double(data_t* target, data_t* source, int length); 00069 00070 void AUD_convert_s16_u8(data_t* target, data_t* source, int length); 00071 00072 void AUD_convert_s16_s24_be(data_t* target, data_t* source, int length); 00073 00074 void AUD_convert_s16_s24_le(data_t* target, data_t* source, int length); 00075 00076 void AUD_convert_s16_s32(data_t* target, data_t* source, int length); 00077 00078 void AUD_convert_s16_float(data_t* target, data_t* source, int length); 00079 00080 void AUD_convert_s16_double(data_t* target, data_t* source, int length); 00081 00082 void AUD_convert_s24_u8_be(data_t* target, data_t* source, int length); 00083 00084 void AUD_convert_s24_u8_le(data_t* target, data_t* source, int length); 00085 00086 void AUD_convert_s24_s16_be(data_t* target, data_t* source, int length); 00087 00088 void AUD_convert_s24_s16_le(data_t* target, data_t* source, int length); 00089 00090 void AUD_convert_s24_s24(data_t* target, data_t* source, int length); 00091 00092 void AUD_convert_s24_s32_be(data_t* target, data_t* source, int length); 00093 00094 void AUD_convert_s24_s32_le(data_t* target, data_t* source, int length); 00095 00096 void AUD_convert_s24_float_be(data_t* target, data_t* source, int length); 00097 00098 void AUD_convert_s24_float_le(data_t* target, data_t* source, int length); 00099 00100 void AUD_convert_s24_double_be(data_t* target, data_t* source, int length); 00101 00102 void AUD_convert_s24_double_le(data_t* target, data_t* source, int length); 00103 00104 void AUD_convert_s32_u8(data_t* target, data_t* source, int length); 00105 00106 void AUD_convert_s32_s16(data_t* target, data_t* source, int length); 00107 00108 void AUD_convert_s32_s24_be(data_t* target, data_t* source, int length); 00109 00110 void AUD_convert_s32_s24_le(data_t* target, data_t* source, int length); 00111 00112 void AUD_convert_s32_float(data_t* target, data_t* source, int length); 00113 00114 void AUD_convert_s32_double(data_t* target, data_t* source, int length); 00115 00116 void AUD_convert_float_u8(data_t* target, data_t* source, int length); 00117 00118 void AUD_convert_float_s16(data_t* target, data_t* source, int length); 00119 00120 void AUD_convert_float_s24_be(data_t* target, data_t* source, int length); 00121 00122 void AUD_convert_float_s24_le(data_t* target, data_t* source, int length); 00123 00124 void AUD_convert_float_s32(data_t* target, data_t* source, int length); 00125 00126 void AUD_convert_float_double(data_t* target, data_t* source, int length); 00127 00128 void AUD_convert_double_u8(data_t* target, data_t* source, int length); 00129 00130 void AUD_convert_double_s16(data_t* target, data_t* source, int length); 00131 00132 void AUD_convert_double_s24_be(data_t* target, data_t* source, int length); 00133 00134 void AUD_convert_double_s24_le(data_t* target, data_t* source, int length); 00135 00136 void AUD_convert_double_s32(data_t* target, data_t* source, int length); 00137 00138 void AUD_convert_double_float(data_t* target, data_t* source, int length); 00139 00140 #endif //AUD_CONVERTERFUNCTIONS