Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Typedefs | Functions
ConverterFunctions.h File Reference

Defines several conversion functions between different sample formats. More...

#include "Audaspace.h"
#include <cstring>
Include dependency graph for ConverterFunctions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef 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 parameter order as std::memcpy.
 

Functions

template<class T >
void convert_copy (data_t *target, data_t *source, int length)
 The copy conversion function simply calls std::memcpy.
 
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_u8_s24_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_U8 to FORMAT_S24 big endian.
 
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_u8_s32 (data_t *target, data_t *source, int length)
 Converts from FORMAT_U8 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_u8_double (data_t *target, data_t *source, int length)
 Converts from FORMAT_U8 to FORMAT_FLOAT64.
 
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_s16_s24_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_S16 to FORMAT_S24 big endian.
 
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_s16_s32 (data_t *target, data_t *source, int length)
 Converts from FORMAT_S16 to FORMAT_S32.
 
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_s16_double (data_t *target, data_t *source, int length)
 Converts from FORMAT_S16 to FORMAT_FLOAT64.
 
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_u8_le (data_t *target, data_t *source, int length)
 Converts from FORMAT_S24 little endian to FORMAT_U8.
 
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_s24_s16_le (data_t *target, data_t *source, int length)
 Converts from FORMAT_S24 little endian to FORMAT_S16.
 
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_s24_s32_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_S24 big endian to FORMAT_S32.
 
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_s24_float_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_S24 big endian to FORMAT_FLOAT32.
 
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_s24_double_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_S24 big endian to FORMAT_FLOAT64.
 
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_s32_u8 (data_t *target, data_t *source, int length)
 Converts from FORMAT_S32 to FORMAT_U8.
 
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_s32_s24_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_S32 to FORMAT_S24 big endian.
 
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_float (data_t *target, data_t *source, int length)
 Converts from FORMAT_S32 to FORMAT_FLOAT32.
 
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_float_u8 (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT32 to FORMAT_U8.
 
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_s24_be (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT32 to FORMAT_S24 big endian.
 
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_s32 (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT32 to FORMAT_S32.
 
void AUD_API convert_float_double (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT32 to FORMAT_FLOAT64.
 
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_double_s16 (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT64 to FORMAT_S16.
 
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_double_s24_le (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT64 to FORMAT_S24 little endian.
 
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_double_float (data_t *target, data_t *source, int length)
 Converts from FORMAT_FLOAT64 to FORMAT_FLOAT32.
 

Detailed Description

Defines several conversion functions between different sample formats.

Function Documentation

◆ convert_copy()

template<class T >
void convert_copy ( data_t * target,
data_t * source,
int length )

The copy conversion function simply calls std::memcpy.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_double_float()

void AUD_API convert_double_float ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT64 to FORMAT_FLOAT32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_double_s16()

void AUD_API convert_double_s16 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT64 to FORMAT_S16.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_double_s24_be()

void AUD_API convert_double_s24_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT64 to FORMAT_S24 big endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_double_s24_le()

void AUD_API convert_double_s24_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT64 to FORMAT_S24 little endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_double_s32()

void AUD_API convert_double_s32 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT64 to FORMAT_S32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_double_u8()

void AUD_API convert_double_u8 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT64 to FORMAT_U8.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_float_double()

void AUD_API convert_float_double ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT32 to FORMAT_FLOAT64.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_float_s16()

void AUD_API convert_float_s16 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT32 to FORMAT_S16.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_float_s24_be()

void AUD_API convert_float_s24_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT32 to FORMAT_S24 big endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_float_s24_le()

void AUD_API convert_float_s24_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT32 to FORMAT_S24 little endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_float_s32()

void AUD_API convert_float_s32 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT32 to FORMAT_S32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_float_u8()

void AUD_API convert_float_u8 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_FLOAT32 to FORMAT_U8.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s16_double()

void AUD_API convert_s16_double ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S16 to FORMAT_FLOAT64.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s16_float()

void AUD_API convert_s16_float ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S16 to FORMAT_FLOAT32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s16_s24_be()

void AUD_API convert_s16_s24_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S16 to FORMAT_S24 big endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s16_s24_le()

void AUD_API convert_s16_s24_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S16 to FORMAT_S24 little endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s16_s32()

void AUD_API convert_s16_s32 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S16 to FORMAT_S32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s16_u8()

void AUD_API convert_s16_u8 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S16 to FORMAT_U8.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_double_be()

void AUD_API convert_s24_double_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 big endian to FORMAT_FLOAT64.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_double_le()

void AUD_API convert_s24_double_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 little endian to FORMAT_FLOAT64.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_float_be()

void AUD_API convert_s24_float_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 big endian to FORMAT_FLOAT32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_float_le()

void AUD_API convert_s24_float_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 little endian to FORMAT_FLOAT32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_s16_be()

void AUD_API convert_s24_s16_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 big endian to FORMAT_S16.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_s16_le()

void AUD_API convert_s24_s16_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 little endian to FORMAT_S16.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_s24()

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.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_s32_be()

void AUD_API convert_s24_s32_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 big endian to FORMAT_S32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_s32_le()

void AUD_API convert_s24_s32_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 little endian to FORMAT_S32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_u8_be()

void AUD_API convert_s24_u8_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 big endian to FORMAT_U8.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s24_u8_le()

void AUD_API convert_s24_u8_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S24 little endian to FORMAT_U8.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s32_double()

void AUD_API convert_s32_double ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S32 to FORMAT_FLOAT64.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s32_float()

void AUD_API convert_s32_float ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S32 to FORMAT_FLOAT32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s32_s16()

void AUD_API convert_s32_s16 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S32 to FORMAT_S16.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s32_s24_be()

void AUD_API convert_s32_s24_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S32 to FORMAT_S24 big endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s32_s24_le()

void AUD_API convert_s32_s24_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S32 to FORMAT_S24 little endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_s32_u8()

void AUD_API convert_s32_u8 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_S32 to FORMAT_U8.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_u8_double()

void AUD_API convert_u8_double ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_U8 to FORMAT_FLOAT64.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_u8_float()

void AUD_API convert_u8_float ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_U8 to FORMAT_FLOAT32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_u8_s16()

void AUD_API convert_u8_s16 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_U8 to FORMAT_S16.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_u8_s24_be()

void AUD_API convert_u8_s24_be ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_U8 to FORMAT_S24 big endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_u8_s24_le()

void AUD_API convert_u8_s24_le ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_U8 to FORMAT_S24 little endian.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.

◆ convert_u8_s32()

void AUD_API convert_u8_s32 ( data_t * target,
data_t * source,
int length )

Converts from FORMAT_U8 to FORMAT_S32.

Parameters
targetThe target buffer.
sourceThe source buffer.
lengthThe amount of samples to be converted.