Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
ConverterFunctions.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright 2009-2016 Jörg Müller
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16
17#pragma once
18
25#include "Audaspace.h"
26
27#include <cstring>
28
30
35typedef void (*convert_f)(data_t* target, data_t* source, int length);
36
43template <class T>
44void convert_copy(data_t* target, data_t* source, int length)
45{
46 std::memcpy(target, source, length*sizeof(T));
47}
48
55void AUD_API convert_u8_s16(data_t* target, data_t* source, int length);
56
63void AUD_API convert_u8_s24_be(data_t* target, data_t* source, int length);
64
71void AUD_API convert_u8_s24_le(data_t* target, data_t* source, int length);
72
79void AUD_API convert_u8_s32(data_t* target, data_t* source, int length);
80
87void AUD_API convert_u8_float(data_t* target, data_t* source, int length);
88
95void AUD_API convert_u8_double(data_t* target, data_t* source, int length);
96
103void AUD_API convert_s16_u8(data_t* target, data_t* source, int length);
104
111void AUD_API convert_s16_s24_be(data_t* target, data_t* source, int length);
112
119void AUD_API convert_s16_s24_le(data_t* target, data_t* source, int length);
120
127void AUD_API convert_s16_s32(data_t* target, data_t* source, int length);
128
135void AUD_API convert_s16_float(data_t* target, data_t* source, int length);
136
143void AUD_API convert_s16_double(data_t* target, data_t* source, int length);
144
151void AUD_API convert_s24_u8_be(data_t* target, data_t* source, int length);
152
159void AUD_API convert_s24_u8_le(data_t* target, data_t* source, int length);
160
167void AUD_API convert_s24_s16_be(data_t* target, data_t* source, int length);
168
175void AUD_API convert_s24_s16_le(data_t* target, data_t* source, int length);
176
183void AUD_API convert_s24_s24(data_t* target, data_t* source, int length);
184
191void AUD_API convert_s24_s32_be(data_t* target, data_t* source, int length);
192
199void AUD_API convert_s24_s32_le(data_t* target, data_t* source, int length);
200
207void AUD_API convert_s24_float_be(data_t* target, data_t* source, int length);
208
215void AUD_API convert_s24_float_le(data_t* target, data_t* source, int length);
216
223void AUD_API convert_s24_double_be(data_t* target, data_t* source, int length);
224
231void AUD_API convert_s24_double_le(data_t* target, data_t* source, int length);
232
239void AUD_API convert_s32_u8(data_t* target, data_t* source, int length);
240
247void AUD_API convert_s32_s16(data_t* target, data_t* source, int length);
248
255void AUD_API convert_s32_s24_be(data_t* target, data_t* source, int length);
256
263void AUD_API convert_s32_s24_le(data_t* target, data_t* source, int length);
264
271void AUD_API convert_s32_float(data_t* target, data_t* source, int length);
272
279void AUD_API convert_s32_double(data_t* target, data_t* source, int length);
280
287void AUD_API convert_float_u8(data_t* target, data_t* source, int length);
288
295void AUD_API convert_float_s16(data_t* target, data_t* source, int length);
296
303void AUD_API convert_float_s24_be(data_t* target, data_t* source, int length);
304
311void AUD_API convert_float_s24_le(data_t* target, data_t* source, int length);
312
319void AUD_API convert_float_s32(data_t* target, data_t* source, int length);
320
327void AUD_API convert_float_double(data_t* target, data_t* source, int length);
328
335void AUD_API convert_double_u8(data_t* target, data_t* source, int length);
336
343void AUD_API convert_double_s16(data_t* target, data_t* source, int length);
344
351void AUD_API convert_double_s24_be(data_t* target, data_t* source, int length);
352
359void AUD_API convert_double_s24_le(data_t* target, data_t* source, int length);
360
367void AUD_API convert_double_s32(data_t* target, data_t* source, int length);
368
375void AUD_API convert_double_float(data_t* target, data_t* source, int length);
376
The main header file of the library defining the namespace and basic data types.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
unsigned char data_t
Sample data type (format samples)
Definition Audaspace.h:129
void AUD_API convert_s24_float_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 big endian to FORMAT_FLOAT32.
void AUD_API convert_s16_s24_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S16 to FORMAT_S24 little endian.
void AUD_API convert_float_s16(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT32 to FORMAT_S16.
void AUD_API convert_float_u8(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT32 to FORMAT_U8.
void AUD_API convert_u8_s32(data_t *target, data_t *source, int length)
Converts from FORMAT_U8 to FORMAT_S32.
void AUD_API convert_u8_s24_le(data_t *target, data_t *source, int length)
Converts from FORMAT_U8 to FORMAT_S24 little endian.
void AUD_API convert_double_s16(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT64 to FORMAT_S16.
void AUD_API convert_float_s24_be(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT32 to FORMAT_S24 big endian.
void AUD_API convert_double_float(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT64 to FORMAT_FLOAT32.
void AUD_API convert_s24_double_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 little endian to FORMAT_FLOAT64.
void AUD_API convert_s16_float(data_t *target, data_t *source, int length)
Converts from FORMAT_S16 to FORMAT_FLOAT32.
void AUD_API convert_s24_u8_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 big endian to FORMAT_U8.
void AUD_API convert_s24_float_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 little endian to FORMAT_FLOAT32.
void AUD_API convert_double_s24_be(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT64 to FORMAT_S24 big endian.
void AUD_API convert_s16_double(data_t *target, data_t *source, int length)
Converts from FORMAT_S16 to FORMAT_FLOAT64.
void(* convert_f)(data_t *target, data_t *source, int length)
The function template for functions converting from one sample format to another, having the same par...
Definition ConverterFunctions.h:35
void AUD_API convert_s16_s32(data_t *target, data_t *source, int length)
Converts from FORMAT_S16 to FORMAT_S32.
void AUD_API convert_double_s32(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT64 to FORMAT_S32.
void AUD_API convert_u8_float(data_t *target, data_t *source, int length)
Converts from FORMAT_U8 to FORMAT_FLOAT32.
void AUD_API convert_s32_float(data_t *target, data_t *source, int length)
Converts from FORMAT_S32 to FORMAT_FLOAT32.
void AUD_API convert_s32_s24_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S32 to FORMAT_S24 big endian.
void convert_copy(data_t *target, data_t *source, int length)
The copy conversion function simply calls std::memcpy.
Definition ConverterFunctions.h:44
void AUD_API convert_s24_s32_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 big endian to FORMAT_S32.
void AUD_API convert_s16_s24_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S16 to FORMAT_S24 big endian.
void AUD_API convert_s24_s16_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 little endian to FORMAT_S16.
void AUD_API convert_double_u8(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT64 to FORMAT_U8.
void AUD_API convert_s32_u8(data_t *target, data_t *source, int length)
Converts from FORMAT_S32 to FORMAT_U8.
void AUD_API convert_s24_s32_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 little endian to FORMAT_S32.
void AUD_API convert_s32_s24_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S32 to FORMAT_S24 little endian.
void AUD_API convert_s32_double(data_t *target, data_t *source, int length)
Converts from FORMAT_S32 to FORMAT_FLOAT64.
void AUD_API convert_s24_double_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 big endian to FORMAT_FLOAT64.
void AUD_API convert_double_s24_le(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT64 to FORMAT_S24 little endian.
void AUD_API convert_s24_s16_be(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 big endian to FORMAT_S16.
void AUD_API convert_u8_double(data_t *target, data_t *source, int length)
Converts from FORMAT_U8 to FORMAT_FLOAT64.
void AUD_API convert_u8_s16(data_t *target, data_t *source, int length)
Converts from FORMAT_U8 to FORMAT_S16.
void AUD_API convert_s32_s16(data_t *target, data_t *source, int length)
Converts from FORMAT_S32 to FORMAT_S16.
void AUD_API convert_u8_s24_be(data_t *target, data_t *source, int length)
Converts from FORMAT_U8 to FORMAT_S24 big endian.
void AUD_API convert_float_s32(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT32 to FORMAT_S32.
void AUD_API convert_s24_u8_le(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 little endian to FORMAT_U8.
void AUD_API convert_s16_u8(data_t *target, data_t *source, int length)
Converts from FORMAT_S16 to FORMAT_U8.
void AUD_API convert_s24_s24(data_t *target, data_t *source, int length)
Converts from FORMAT_S24 to FORMAT_S24 simply using std::memcpy.
void AUD_API convert_float_s24_le(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT32 to FORMAT_S24 little endian.
void AUD_API convert_float_double(data_t *target, data_t *source, int length)
Converts from FORMAT_FLOAT32 to FORMAT_FLOAT64.