SDL_audiotypecvt.c File Reference
`#include "../SDL_internal.h"`
`#include "SDL_audio.h"`
`#include "SDL_audio_c.h"`
Include dependency graph for SDL_audiotypecvt.c:

Go to the source code of this file.

## Macros

#define | DEBUG_CONVERT 0
#define | LESS_RESAMPLERS 0
#define | NO_RESAMPLERS 0
#define | NO_CONVERTERS 0
#define | DIVBY127 0.0078740157480315f
#define | DIVBY32767 3.05185094759972e-05f
#define | DIVBY2147483647 4.6566128752458e-10f

## Functions

static void | SDL_Convert_U8_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U8_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S8_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16LSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16LSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_U16MSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S16MSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32LSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_S32MSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32LSB_to_F32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_U8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_S8 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_U16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_S16LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_U16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_S16MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_S32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_S32MSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Convert_F32MSB_to_F32LSB (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_1c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_2c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_4c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_6c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_8c (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U8_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U8_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S8_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S8_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_U16MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_U16MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S16MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S16MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_S32MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_S32MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32LSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_1c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_1c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_2c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_2c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_4c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_4c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_6c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_6c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_8c_x2 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Upsample_F32MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)
static void | SDL_Downsample_F32MSB_8c_x4 (SDL_AudioCVT *cvt, SDL_AudioFormat format)

## Variables

const SDL_AudioTypeFilters | sdl_audio_type_filters []
const SDL_AudioRateFilters | sdl_audio_rate_filters []

## Macro Definition Documentation

#define DEBUG_CONVERT 0

Definition at line 28 of file SDL_audiotypecvt.c.

#define DIVBY127 0.0078740157480315f

Definition at line 52 of file SDL_audiotypecvt.c.

Referenced by SDL_Convert_S8_to_F32LSB(), SDL_Convert_S8_to_F32MSB(), SDL_Convert_U8_to_F32LSB(), and SDL_Convert_U8_to_F32MSB().

#define DIVBY2147483647 4.6566128752458e-10f

Definition at line 54 of file SDL_audiotypecvt.c.

Referenced by SDL_Convert_S32LSB_to_F32LSB(), SDL_Convert_S32LSB_to_F32MSB(), SDL_Convert_S32MSB_to_F32LSB(), and SDL_Convert_S32MSB_to_F32MSB().

#define DIVBY32767 3.05185094759972e-05f

Definition at line 53 of file SDL_audiotypecvt.c.

Referenced by SDL_Convert_S16LSB_to_F32LSB(), SDL_Convert_S16LSB_to_F32MSB(), SDL_Convert_S16MSB_to_F32LSB(), SDL_Convert_S16MSB_to_F32MSB(), SDL_Convert_U16LSB_to_F32LSB(), SDL_Convert_U16LSB_to_F32MSB(), SDL_Convert_U16MSB_to_F32LSB(), and SDL_Convert_U16MSB_to_F32MSB().

#define LESS_RESAMPLERS 0

Definition at line 36 of file SDL_audiotypecvt.c.

#define NO_CONVERTERS 0

Definition at line 46 of file SDL_audiotypecvt.c.

#define NO_RESAMPLERS 0

Definition at line 41 of file SDL_audiotypecvt.c.

## Function Documentation

static void SDL_Convert_F32LSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1957 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const float *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (float *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const float val = SDL_SwapFloatLE(*src);
*dst = SDL_SwapFloatBE(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32LSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1839 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, SDL_SwapLE16, and SDLCALL.

{
int i;
const float *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
*dst = ((Sint16) SDL_SwapLE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_F32LSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1887 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const float *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
*dst = ((Sint16) SDL_SwapBE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_F32LSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1911 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, SDL_SwapLE32, and SDLCALL.

{
int i;
const float *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint32 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
*dst = ((Sint32) SDL_SwapLE32(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32LSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1934 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const float *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint32 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
*dst = ((Sint32) SDL_SwapBE32(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32LSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1791 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const float *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32LSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1815 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, SDL_SwapLE16, and SDLCALL.

{
int i;
const float *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
*dst = SDL_SwapLE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32LSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1863 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const float *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
*dst = SDL_SwapBE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_F32LSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1767 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const float *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n");
#endif
src = (const float *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) ((SDL_SwapFloatLE(*src) + 1.0f) * 127.0f));
*dst = val;
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32MSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2170 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDL_SwapFloatLE.

{
int i;
const float *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (float *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const float val = SDL_SwapFloatBE(*src);
*dst = SDL_SwapFloatLE(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32MSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2052 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapLE16, and SDLCALL.

{
int i;
const float *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
*dst = ((Sint16) SDL_SwapLE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_F32MSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2100 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const float *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
*dst = ((Sint16) SDL_SwapBE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_F32MSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2124 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapLE32, and SDLCALL.

{
int i;
const float *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint32 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
*dst = ((Sint32) SDL_SwapLE32(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32MSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2147 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const float *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint32 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
*dst = ((Sint32) SDL_SwapBE32(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32MSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2004 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const float *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n");
#endif
src = (const float *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32MSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2028 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapLE16, and SDLCALL.

{
int i;
const float *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
*dst = SDL_SwapLE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_F32MSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2076 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const float *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n");
#endif
src = (const float *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
*dst = SDL_SwapBE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_F32MSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1980 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const float *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n");
#endif
src = (const float *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) ((SDL_SwapFloatBE(*src) + 1.0f) * 127.0f));
*dst = val;
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S16LSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 867 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
*dst = SDL_SwapFloatLE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 891 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
*dst = SDL_SwapFloatBE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 796 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) SDL_SwapLE16(*src));
*dst = ((Sint16) SDL_SwapBE16(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 819 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
*dst = ((Sint32) SDL_SwapLE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 843 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
*dst = ((Sint32) SDL_SwapBE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 726 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 750 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
*dst = SDL_SwapLE16(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16LSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 773 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
*dst = SDL_SwapBE16(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_S16LSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 702 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8));
*dst = val;
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1293 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
*dst = SDL_SwapFloatLE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1317 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
*dst = SDL_SwapFloatBE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1199 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) SDL_SwapBE16(*src));
*dst = ((Sint16) SDL_SwapLE16(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1245 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
*dst = ((Sint32) SDL_SwapLE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1269 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
*dst = ((Sint32) SDL_SwapBE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1152 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1176 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
*dst = SDL_SwapLE16(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S16MSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1222 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
*dst = SDL_SwapBE16(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_S16MSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1128 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8));
*dst = val;
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S32LSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1508 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY2147483647, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (float *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
*dst = SDL_SwapFloatLE(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY2147483647
#define DIVBY2147483647
Definition: SDL_audiotypecvt.c:54
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32LSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1531 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY2147483647, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (float *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
*dst = SDL_SwapFloatBE(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
DIVBY2147483647
#define DIVBY2147483647
Definition: SDL_audiotypecvt.c:54
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32LSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1413 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
*dst = ((Sint16) SDL_SwapLE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S32LSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1461 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
*dst = ((Sint16) SDL_SwapBE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S32LSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1485 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint32 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint32 val = ((Sint32) SDL_SwapLE32(*src));
*dst = ((Sint32) SDL_SwapBE32(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32LSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1365 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32LSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1389 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
*dst = SDL_SwapLE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32LSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1437 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
*dst = SDL_SwapBE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_S32LSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1341 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24));
*dst = val;
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32MSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1721 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY2147483647, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const Uint32 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (float *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
*dst = SDL_SwapFloatLE(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY2147483647
#define DIVBY2147483647
Definition: SDL_audiotypecvt.c:54
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32MSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1744 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY2147483647, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const Uint32 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (float *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
*dst = SDL_SwapFloatBE(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
DIVBY2147483647
#define DIVBY2147483647
Definition: SDL_audiotypecvt.c:54
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32MSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1626 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint32 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
*dst = ((Sint16) SDL_SwapLE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S32MSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1674 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
*dst = ((Sint16) SDL_SwapBE16(val));
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S32MSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1698 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint32 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint32 val = ((Sint32) SDL_SwapBE32(*src));
*dst = ((Sint32) SDL_SwapLE32(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32MSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1578 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint32 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32MSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1602 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint32 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
*dst = SDL_SwapLE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S32MSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1650 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint32 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
*dst = SDL_SwapBE16(val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_S32MSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1554 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint32 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n");
#endif
src = (const Uint32 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24));
*dst = val;
}
cvt->len_cvt /= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S8_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 441 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY127, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const Uint8 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const float val = (((float) ((Sint8) *src)) * DIVBY127);
*dst = SDL_SwapFloatLE(val);
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY127
#define DIVBY127
Definition: SDL_audiotypecvt.c:52
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S8_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 465 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY127, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const Uint8 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const float val = (((float) ((Sint8) *src)) * DIVBY127);
*dst = SDL_SwapFloatBE(val);
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
DIVBY127
#define DIVBY127
Definition: SDL_audiotypecvt.c:52
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S8_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 321 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint8 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
*dst = ((Sint16) SDL_SwapLE16(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S8_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 369 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint8 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
*dst = ((Sint16) SDL_SwapBE16(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_S8_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 393 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint8 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
*dst = ((Sint32) SDL_SwapLE32(val));
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S8_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 417 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint8 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
*dst = ((Sint32) SDL_SwapBE32(val));
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S8_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 297 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint8 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
*dst = SDL_SwapLE16(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_S8_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 345 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint8 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
*dst = SDL_SwapBE16(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_S8_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 274 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, and SDLCALL.

{
int i;
const Uint8 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n");
#endif
src = (const Uint8 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
const Uint8 val = ((((Sint8) *src)) ^ 0x80);
*dst = val;
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16LSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 654 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
*dst = SDL_SwapFloatLE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16LSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 678 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
*dst = SDL_SwapFloatBE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16LSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 537 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
*dst = ((Sint16) SDL_SwapLE16(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_U16LSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 583 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
*dst = ((Sint16) SDL_SwapBE16(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_U16LSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 606 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
*dst = ((Sint32) SDL_SwapLE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16LSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 630 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
*dst = ((Sint32) SDL_SwapBE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16LSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 513 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16LSB_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 560 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint16 val = SDL_SwapLE16(*src);
*dst = SDL_SwapBE16(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Convert_U16LSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 489 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8));
*dst = val;
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1080 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
*dst = SDL_SwapFloatLE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1104 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY32767, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const Uint16 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
*dst = SDL_SwapFloatBE(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
DIVBY32767
#define DIVBY32767
Definition: SDL_audiotypecvt.c:53
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 986 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
*dst = ((Sint16) SDL_SwapLE16(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_U16MSB_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1009 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
*dst = ((Sint16) SDL_SwapBE16(val));
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_U16MSB_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1032 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
*dst = ((Sint32) SDL_SwapLE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 1056 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint16 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n");
#endif
src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
*dst = ((Sint32) SDL_SwapBE32(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 939 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint16 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8));
*dst = ((Sint8) val);
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 963 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint16 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint16 val = SDL_SwapBE16(*src);
*dst = SDL_SwapLE16(val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U16MSB_to_U8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 915 of file SDL_audiotypecvt.c.

References AUDIO_U8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint16 *src;
Uint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n");
#endif
src = (const Uint16 *) cvt->buf;
dst = (Uint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8));
*dst = val;
}
cvt->len_cvt /= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
AUDIO_U8
#define AUDIO_U8
Definition: SDL_audio.h:89
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_F32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 226 of file SDL_audiotypecvt.c.

References AUDIO_F32LSB, SDL_AudioCVT::buf, DIVBY127, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
int i;
const Uint8 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const float val = ((((float) *src) * DIVBY127) - 1.0f);
*dst = SDL_SwapFloatLE(val);
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
AUDIO_F32LSB
#define AUDIO_F32LSB
Definition: SDL_audio.h:112
DIVBY127
#define DIVBY127
Definition: SDL_audiotypecvt.c:52
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_F32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 250 of file SDL_audiotypecvt.c.

References AUDIO_F32MSB, SDL_AudioCVT::buf, DIVBY127, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
int i;
const Uint8 *src;
float *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const float val = ((((float) *src) * DIVBY127) - 1.0f);
*dst = SDL_SwapFloatBE(val);
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
f
GLfloat f
Definition: SDL_opengl_glext.h:1870
AUDIO_F32MSB
#define AUDIO_F32MSB
Definition: SDL_audio.h:113
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
DIVBY127
#define DIVBY127
Definition: SDL_audiotypecvt.c:52
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_S16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 106 of file SDL_audiotypecvt.c.

References AUDIO_S16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint8 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
*dst = ((Sint16) SDL_SwapLE16(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16LSB
#define AUDIO_S16LSB
Definition: SDL_audio.h:92
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_U8_to_S16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 154 of file SDL_audiotypecvt.c.

References AUDIO_S16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint8 *src;
Sint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
*dst = ((Sint16) SDL_SwapBE16(val));
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S16MSB
#define AUDIO_S16MSB
Definition: SDL_audio.h:94
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Convert_U8_to_S32LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 178 of file SDL_audiotypecvt.c.

References AUDIO_S32LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
int i;
const Uint8 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
*dst = ((Sint32) SDL_SwapLE32(val));
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
AUDIO_S32LSB
#define AUDIO_S32LSB
Definition: SDL_audio.h:103
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_S32MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 202 of file SDL_audiotypecvt.c.

References AUDIO_S32MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
int i;
const Uint8 *src;
Sint32 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
*dst = ((Sint32) SDL_SwapBE32(val));
}
cvt->len_cvt *= 4;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_S32MSB
#define AUDIO_S32MSB
Definition: SDL_audio.h:104
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_S8 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 59 of file SDL_audiotypecvt.c.

References AUDIO_S8, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, and SDLCALL.

{
int i;
const Uint8 *src;
Sint8 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n");
#endif
src = (const Uint8 *) cvt->buf;
dst = (Sint8 *) cvt->buf;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
const Sint8 val = ((*src) ^ 0x80);
*dst = ((Sint8) val);
}
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
AUDIO_S8
#define AUDIO_S8
Definition: SDL_audio.h:90
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_U16LSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 82 of file SDL_audiotypecvt.c.

References AUDIO_U16LSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
int i;
const Uint8 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Uint16 val = (((Uint16) *src) << 8);
*dst = SDL_SwapLE16(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
AUDIO_U16LSB
#define AUDIO_U16LSB
Definition: SDL_audio.h:91
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Convert_U8_to_U16MSB | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 130 of file SDL_audiotypecvt.c.

References AUDIO_U16MSB, SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, i, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
int i;
const Uint8 *src;
Uint16 *dst;
#if DEBUG_CONVERT
fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n");
#endif
src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
const Uint16 val = (((Uint16) *src) << 8);
*dst = SDL_SwapBE16(val);
}
cvt->len_cvt *= 2;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737
AUDIO_U16MSB
#define AUDIO_U16MSB
Definition: SDL_audio.h:93

static void SDL_Downsample_F32LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6168 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatLE(src[0]);
float last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatLE(sample0);
dst++;
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14006 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src += 2;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14061 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src += 4;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6237 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatLE(src[0]);
float sample1 = SDL_SwapFloatLE(src[1]);
float last_sample0 = sample0;
float last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatLE(sample0);
dst[1] = SDL_SwapFloatLE(sample1);
dst += 2;
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14119 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
src += 4;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14185 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
src += 8;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6321 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatLE(src[0]);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample2 = SDL_SwapFloatLE(src[2]);
float sample3 = SDL_SwapFloatLE(src[3]);
float last_sample0 = sample0;
float last_sample1 = sample1;
float last_sample2 = sample2;
float last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatLE(sample0);
dst[1] = SDL_SwapFloatLE(sample1);
dst[2] = SDL_SwapFloatLE(sample2);
dst[3] = SDL_SwapFloatLE(sample3);
dst += 4;
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14257 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
src += 8;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14345 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
src += 16;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6425 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatLE(src[0]);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample2 = SDL_SwapFloatLE(src[2]);
float sample3 = SDL_SwapFloatLE(src[3]);
float sample4 = SDL_SwapFloatLE(src[4]);
float sample5 = SDL_SwapFloatLE(src[5]);
float last_sample0 = sample0;
float last_sample1 = sample1;
float last_sample2 = sample2;
float last_sample3 = sample3;
float last_sample4 = sample4;
float last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatLE(sample0);
dst[1] = SDL_SwapFloatLE(sample1);
dst[2] = SDL_SwapFloatLE(sample2);
dst[3] = SDL_SwapFloatLE(sample3);
dst[4] = SDL_SwapFloatLE(sample4);
dst[5] = SDL_SwapFloatLE(sample5);
dst += 6;
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14435 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
src += 12;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14545 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
src += 24;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6549 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatLE(src[0]);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample2 = SDL_SwapFloatLE(src[2]);
float sample3 = SDL_SwapFloatLE(src[3]);
float sample4 = SDL_SwapFloatLE(src[4]);
float sample5 = SDL_SwapFloatLE(src[5]);
float sample6 = SDL_SwapFloatLE(src[6]);
float sample7 = SDL_SwapFloatLE(src[7]);
float last_sample0 = sample0;
float last_sample1 = sample1;
float last_sample2 = sample2;
float last_sample3 = sample3;
float last_sample4 = sample4;
float last_sample5 = sample5;
float last_sample6 = sample6;
float last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatLE(sample0);
dst[1] = SDL_SwapFloatLE(sample1);
dst[2] = SDL_SwapFloatLE(sample2);
dst[3] = SDL_SwapFloatLE(sample3);
dst[4] = SDL_SwapFloatLE(sample4);
dst[5] = SDL_SwapFloatLE(sample5);
dst[6] = SDL_SwapFloatLE(sample6);
dst[7] = SDL_SwapFloatLE(sample7);
dst += 8;
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5);
sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14653 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
const double sample6 = (double) SDL_SwapFloatLE(src[6]);
const double sample7 = (double) SDL_SwapFloatLE(src[7]);
src += 16;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
dst[6] = (float) ((sample6 + last_sample6) * 0.5);
dst[7] = (float) ((sample7 + last_sample7) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14785 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
const double sample6 = (double) SDL_SwapFloatLE(src[6]);
const double sample7 = (double) SDL_SwapFloatLE(src[7]);
src += 32;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
dst[6] = (float) ((sample6 + last_sample6) * 0.5);
dst[7] = (float) ((sample7 + last_sample7) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6648 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatBE(src[0]);
float last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatBE(sample0);
dst++;
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14866 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src += 2;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14921 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src += 4;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6717 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatBE(src[0]);
float sample1 = SDL_SwapFloatBE(src[1]);
float last_sample0 = sample0;
float last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatBE(sample0);
dst[1] = SDL_SwapFloatBE(sample1);
dst += 2;
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14979 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
src += 4;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15045 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
src += 8;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6801 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatBE(src[0]);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample2 = SDL_SwapFloatBE(src[2]);
float sample3 = SDL_SwapFloatBE(src[3]);
float last_sample0 = sample0;
float last_sample1 = sample1;
float last_sample2 = sample2;
float last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatBE(sample0);
dst[1] = SDL_SwapFloatBE(sample1);
dst[2] = SDL_SwapFloatBE(sample2);
dst[3] = SDL_SwapFloatBE(sample3);
dst += 4;
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15117 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
src += 8;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15205 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
src += 16;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6905 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatBE(src[0]);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample2 = SDL_SwapFloatBE(src[2]);
float sample3 = SDL_SwapFloatBE(src[3]);
float sample4 = SDL_SwapFloatBE(src[4]);
float sample5 = SDL_SwapFloatBE(src[5]);
float last_sample0 = sample0;
float last_sample1 = sample1;
float last_sample2 = sample2;
float last_sample3 = sample3;
float last_sample4 = sample4;
float last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatBE(sample0);
dst[1] = SDL_SwapFloatBE(sample1);
dst[2] = SDL_SwapFloatBE(sample2);
dst[3] = SDL_SwapFloatBE(sample3);
dst[4] = SDL_SwapFloatBE(sample4);
dst[5] = SDL_SwapFloatBE(sample5);
dst += 6;
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15295 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
src += 12;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15405 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
src += 24;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7029 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
float sample0 = SDL_SwapFloatBE(src[0]);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample2 = SDL_SwapFloatBE(src[2]);
float sample3 = SDL_SwapFloatBE(src[3]);
float sample4 = SDL_SwapFloatBE(src[4]);
float sample5 = SDL_SwapFloatBE(src[5]);
float sample6 = SDL_SwapFloatBE(src[6]);
float sample7 = SDL_SwapFloatBE(src[7]);
float last_sample0 = sample0;
float last_sample1 = sample1;
float last_sample2 = sample2;
float last_sample3 = sample3;
float last_sample4 = sample4;
float last_sample5 = sample5;
float last_sample6 = sample6;
float last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapFloatBE(sample0);
dst[1] = SDL_SwapFloatBE(sample1);
dst[2] = SDL_SwapFloatBE(sample2);
dst[3] = SDL_SwapFloatBE(sample3);
dst[4] = SDL_SwapFloatBE(sample4);
dst[5] = SDL_SwapFloatBE(sample5);
dst[6] = SDL_SwapFloatBE(sample6);
dst[7] = SDL_SwapFloatBE(sample7);
dst += 8;
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5);
sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15513 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
const double sample6 = (double) SDL_SwapFloatBE(src[6]);
const double sample7 = (double) SDL_SwapFloatBE(src[7]);
src += 16;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
dst[6] = (float) ((sample6 + last_sample6) * 0.5);
dst[7] = (float) ((sample7 + last_sample7) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_F32MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15645 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDL_SwapFloatBE.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
float *dst = (float *) cvt->buf;
const float *src = (float *) cvt->buf;
const float *target = (const float *) (cvt->buf + dstsize);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
while (dst < target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
const double sample6 = (double) SDL_SwapFloatBE(src[6]);
const double sample7 = (double) SDL_SwapFloatBE(src[7]);
src += 32;
dst[0] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample2 + last_sample2) * 0.5);
dst[3] = (float) ((sample3 + last_sample3) * 0.5);
dst[4] = (float) ((sample4 + last_sample4) * 0.5);
dst[5] = (float) ((sample5 + last_sample5) * 0.5);
dst[6] = (float) ((sample6 + last_sample6) * 0.5);
dst[7] = (float) ((sample7 + last_sample7) * 0.5);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S16LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3768 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst++;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9706 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src += 2;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9761 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src += 4;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3837 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst += 2;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9819 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
src += 4;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9885 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
src += 8;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3921 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
Sint16 last_sample2 = sample2;
Sint16 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[2] = ((Sint16) SDL_SwapLE16(sample2));
dst[3] = ((Sint16) SDL_SwapLE16(sample3));
dst += 4;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9957 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
src += 8;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10045 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
src += 16;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4025 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
Sint16 last_sample2 = sample2;
Sint16 last_sample3 = sample3;
Sint16 last_sample4 = sample4;
Sint16 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[2] = ((Sint16) SDL_SwapLE16(sample2));
dst[3] = ((Sint16) SDL_SwapLE16(sample3));
dst[4] = ((Sint16) SDL_SwapLE16(sample4));
dst[5] = ((Sint16) SDL_SwapLE16(sample5));
dst += 6;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10135 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
src += 12;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10245 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
src += 24;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4149 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6]));
Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
Sint16 last_sample2 = sample2;
Sint16 last_sample3 = sample3;
Sint16 last_sample4 = sample4;
Sint16 last_sample5 = sample5;
Sint16 last_sample6 = sample6;
Sint16 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[2] = ((Sint16) SDL_SwapLE16(sample2));
dst[3] = ((Sint16) SDL_SwapLE16(sample3));
dst[4] = ((Sint16) SDL_SwapLE16(sample4));
dst[5] = ((Sint16) SDL_SwapLE16(sample5));
dst[6] = ((Sint16) SDL_SwapLE16(sample6));
dst[7] = ((Sint16) SDL_SwapLE16(sample7));
dst += 8;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10353 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
src += 16;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10485 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
src += 32;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4728 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst++;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11426 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src += 2;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11481 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src += 4;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4797 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst += 2;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11539 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
src += 4;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11605 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
src += 8;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4881 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
Sint16 last_sample2 = sample2;
Sint16 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[2] = ((Sint16) SDL_SwapBE16(sample2));
dst[3] = ((Sint16) SDL_SwapBE16(sample3));
dst += 4;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11677 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
src += 8;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11765 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
src += 16;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4985 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
Sint16 last_sample2 = sample2;
Sint16 last_sample3 = sample3;
Sint16 last_sample4 = sample4;
Sint16 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[2] = ((Sint16) SDL_SwapBE16(sample2));
dst[3] = ((Sint16) SDL_SwapBE16(sample3));
dst[4] = ((Sint16) SDL_SwapBE16(sample4));
dst[5] = ((Sint16) SDL_SwapBE16(sample5));
dst += 6;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11855 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
src += 12;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11965 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
src += 24;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5109 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6]));
Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7]));
Sint16 last_sample0 = sample0;
Sint16 last_sample1 = sample1;
Sint16 last_sample2 = sample2;
Sint16 last_sample3 = sample3;
Sint16 last_sample4 = sample4;
Sint16 last_sample5 = sample5;
Sint16 last_sample6 = sample6;
Sint16 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[2] = ((Sint16) SDL_SwapBE16(sample2));
dst[3] = ((Sint16) SDL_SwapBE16(sample3));
dst[4] = ((Sint16) SDL_SwapBE16(sample4));
dst[5] = ((Sint16) SDL_SwapBE16(sample5));
dst[6] = ((Sint16) SDL_SwapBE16(sample6));
dst[7] = ((Sint16) SDL_SwapBE16(sample7));
dst += 8;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12073 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
src += 16;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S16MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12205 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint16 *dst = (Sint16 *) cvt->buf;
const Sint16 *src = (Sint16 *) cvt->buf;
const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
while (dst < target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
src += 32;
dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S32LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5208 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst++;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12286 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src += 2;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12341 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src += 4;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5277 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst += 2;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12399 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
src += 4;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12465 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
src += 8;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5361 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
Sint32 last_sample2 = sample2;
Sint32 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[2] = ((Sint32) SDL_SwapLE32(sample2));
dst[3] = ((Sint32) SDL_SwapLE32(sample3));
dst += 4;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12537 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
src += 8;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12625 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
src += 16;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5465 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
Sint32 last_sample2 = sample2;
Sint32 last_sample3 = sample3;
Sint32 last_sample4 = sample4;
Sint32 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[2] = ((Sint32) SDL_SwapLE32(sample2));
dst[3] = ((Sint32) SDL_SwapLE32(sample3));
dst[4] = ((Sint32) SDL_SwapLE32(sample4));
dst[5] = ((Sint32) SDL_SwapLE32(sample5));
dst += 6;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12715 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
src += 12;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12825 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
src += 24;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5589 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6]));
Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
Sint32 last_sample2 = sample2;
Sint32 last_sample3 = sample3;
Sint32 last_sample4 = sample4;
Sint32 last_sample5 = sample5;
Sint32 last_sample6 = sample6;
Sint32 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[2] = ((Sint32) SDL_SwapLE32(sample2));
dst[3] = ((Sint32) SDL_SwapLE32(sample3));
dst[4] = ((Sint32) SDL_SwapLE32(sample4));
dst[5] = ((Sint32) SDL_SwapLE32(sample5));
dst[6] = ((Sint32) SDL_SwapLE32(sample6));
dst[7] = ((Sint32) SDL_SwapLE32(sample7));
dst += 8;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12933 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
src += 16;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13065 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
src += 32;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5688 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst++;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13146 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src += 2;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13201 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src += 4;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5757 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst += 2;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13259 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
src += 4;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13325 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
src += 8;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5841 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
Sint32 last_sample2 = sample2;
Sint32 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[2] = ((Sint32) SDL_SwapBE32(sample2));
dst[3] = ((Sint32) SDL_SwapBE32(sample3));
dst += 4;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13397 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
src += 8;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13485 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
src += 16;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5945 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
Sint32 last_sample2 = sample2;
Sint32 last_sample3 = sample3;
Sint32 last_sample4 = sample4;
Sint32 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[2] = ((Sint32) SDL_SwapBE32(sample2));
dst[3] = ((Sint32) SDL_SwapBE32(sample3));
dst[4] = ((Sint32) SDL_SwapBE32(sample4));
dst[5] = ((Sint32) SDL_SwapBE32(sample5));
dst += 6;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13575 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
src += 12;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13685 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
src += 24;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6069 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6]));
Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7]));
Sint32 last_sample0 = sample0;
Sint32 last_sample1 = sample1;
Sint32 last_sample2 = sample2;
Sint32 last_sample3 = sample3;
Sint32 last_sample4 = sample4;
Sint32 last_sample5 = sample5;
Sint32 last_sample6 = sample6;
Sint32 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[2] = ((Sint32) SDL_SwapBE32(sample2));
dst[3] = ((Sint32) SDL_SwapBE32(sample3));
dst[4] = ((Sint32) SDL_SwapBE32(sample4));
dst[5] = ((Sint32) SDL_SwapBE32(sample5));
dst[6] = ((Sint32) SDL_SwapBE32(sample6));
dst[7] = ((Sint32) SDL_SwapBE32(sample7));
dst += 8;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13793 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
src += 16;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S32MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13925 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint32 *dst = (Sint32 *) cvt->buf;
const Sint32 *src = (Sint32 *) cvt->buf;
const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
while (dst < target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
src += 32;
dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_S8_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2808 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 16;
const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
register int eps = 0;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint8) sample0);
dst++;
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7986 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src += 2;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8041 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src += 4;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2877 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 last_sample0 = sample0;
Sint8 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint8) sample0);
dst[1] = ((Sint8) sample1);
dst += 2;
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8099 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
src += 4;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8165 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
src += 8;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2961 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample2 = ((Sint8) src[2]);
Sint8 sample3 = ((Sint8) src[3]);
Sint8 last_sample0 = sample0;
Sint8 last_sample1 = sample1;
Sint8 last_sample2 = sample2;
Sint8 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint8) sample0);
dst[1] = ((Sint8) sample1);
dst[2] = ((Sint8) sample2);
dst[3] = ((Sint8) sample3);
dst += 4;
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8237 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
src += 8;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8325 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
src += 16;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3065 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 96;
const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
register int eps = 0;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample2 = ((Sint8) src[2]);
Sint8 sample3 = ((Sint8) src[3]);
Sint8 sample4 = ((Sint8) src[4]);
Sint8 sample5 = ((Sint8) src[5]);
Sint8 last_sample0 = sample0;
Sint8 last_sample1 = sample1;
Sint8 last_sample2 = sample2;
Sint8 last_sample3 = sample3;
Sint8 last_sample4 = sample4;
Sint8 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint8) sample0);
dst[1] = ((Sint8) sample1);
dst[2] = ((Sint8) sample2);
dst[3] = ((Sint8) sample3);
dst[4] = ((Sint8) sample4);
dst[5] = ((Sint8) sample5);
dst += 6;
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8415 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
src += 12;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8525 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
src += 24;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3189 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample2 = ((Sint8) src[2]);
Sint8 sample3 = ((Sint8) src[3]);
Sint8 sample4 = ((Sint8) src[4]);
Sint8 sample5 = ((Sint8) src[5]);
Sint8 sample6 = ((Sint8) src[6]);
Sint8 sample7 = ((Sint8) src[7]);
Sint8 last_sample0 = sample0;
Sint8 last_sample1 = sample1;
Sint8 last_sample2 = sample2;
Sint8 last_sample3 = sample3;
Sint8 last_sample4 = sample4;
Sint8 last_sample5 = sample5;
Sint8 last_sample6 = sample6;
Sint8 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = ((Sint8) sample0);
dst[1] = ((Sint8) sample1);
dst[2] = ((Sint8) sample2);
dst[3] = ((Sint8) sample3);
dst[4] = ((Sint8) sample4);
dst[5] = ((Sint8) sample5);
dst[6] = ((Sint8) sample6);
dst[7] = ((Sint8) sample7);
dst += 8;
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1);
sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8633 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
src += 16;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint8) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint8) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_S8_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8765 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Sint8 *dst = (Sint8 *) cvt->buf;
const Sint8 *src = (Sint8 *) cvt->buf;
const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
while (dst < target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
src += 32;
dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
dst[6] = (Sint8) ((sample6 + last_sample6) >> 1);
dst[7] = (Sint8) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U16LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3288 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapLE16(sample0);
dst++;
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8846 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src += 2;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8901 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src += 4;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3357 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapLE16(sample0);
dst[1] = SDL_SwapLE16(sample1);
dst += 2;
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8959 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
src += 4;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9025 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
src += 8;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3441 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample2 = SDL_SwapLE16(src[2]);
Uint16 sample3 = SDL_SwapLE16(src[3]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
Uint16 last_sample2 = sample2;
Uint16 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapLE16(sample0);
dst[1] = SDL_SwapLE16(sample1);
dst[2] = SDL_SwapLE16(sample2);
dst[3] = SDL_SwapLE16(sample3);
dst += 4;
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9097 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
src += 8;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9185 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
src += 16;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3545 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample2 = SDL_SwapLE16(src[2]);
Uint16 sample3 = SDL_SwapLE16(src[3]);
Uint16 sample4 = SDL_SwapLE16(src[4]);
Uint16 sample5 = SDL_SwapLE16(src[5]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
Uint16 last_sample2 = sample2;
Uint16 last_sample3 = sample3;
Uint16 last_sample4 = sample4;
Uint16 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapLE16(sample0);
dst[1] = SDL_SwapLE16(sample1);
dst[2] = SDL_SwapLE16(sample2);
dst[3] = SDL_SwapLE16(sample3);
dst[4] = SDL_SwapLE16(sample4);
dst[5] = SDL_SwapLE16(sample5);
dst += 6;
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9275 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
src += 12;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9385 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
src += 24;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3669 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample2 = SDL_SwapLE16(src[2]);
Uint16 sample3 = SDL_SwapLE16(src[3]);
Uint16 sample4 = SDL_SwapLE16(src[4]);
Uint16 sample5 = SDL_SwapLE16(src[5]);
Uint16 sample6 = SDL_SwapLE16(src[6]);
Uint16 sample7 = SDL_SwapLE16(src[7]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
Uint16 last_sample2 = sample2;
Uint16 last_sample3 = sample3;
Uint16 last_sample4 = sample4;
Uint16 last_sample5 = sample5;
Uint16 last_sample6 = sample6;
Uint16 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapLE16(sample0);
dst[1] = SDL_SwapLE16(sample1);
dst[2] = SDL_SwapLE16(sample2);
dst[3] = SDL_SwapLE16(sample3);
dst[4] = SDL_SwapLE16(sample4);
dst[5] = SDL_SwapLE16(sample5);
dst[6] = SDL_SwapLE16(sample6);
dst[7] = SDL_SwapLE16(sample7);
dst += 8;
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1);
sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9493 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
src += 16;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9625 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
src += 32;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4248 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapBE16(sample0);
dst++;
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10566 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src += 2;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10621 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src += 4;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4317 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapBE16(sample0);
dst[1] = SDL_SwapBE16(sample1);
dst += 2;
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10679 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
src += 4;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10745 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
src += 8;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4401 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample2 = SDL_SwapBE16(src[2]);
Uint16 sample3 = SDL_SwapBE16(src[3]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
Uint16 last_sample2 = sample2;
Uint16 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapBE16(sample0);
dst[1] = SDL_SwapBE16(sample1);
dst[2] = SDL_SwapBE16(sample2);
dst[3] = SDL_SwapBE16(sample3);
dst += 4;
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10817 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
src += 8;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10905 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
src += 16;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4505 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample2 = SDL_SwapBE16(src[2]);
Uint16 sample3 = SDL_SwapBE16(src[3]);
Uint16 sample4 = SDL_SwapBE16(src[4]);
Uint16 sample5 = SDL_SwapBE16(src[5]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
Uint16 last_sample2 = sample2;
Uint16 last_sample3 = sample3;
Uint16 last_sample4 = sample4;
Uint16 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapBE16(sample0);
dst[1] = SDL_SwapBE16(sample1);
dst[2] = SDL_SwapBE16(sample2);
dst[3] = SDL_SwapBE16(sample3);
dst[4] = SDL_SwapBE16(sample4);
dst[5] = SDL_SwapBE16(sample5);
dst += 6;
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10995 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
src += 12;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11105 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
src += 24;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4629 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample2 = SDL_SwapBE16(src[2]);
Uint16 sample3 = SDL_SwapBE16(src[3]);
Uint16 sample4 = SDL_SwapBE16(src[4]);
Uint16 sample5 = SDL_SwapBE16(src[5]);
Uint16 sample6 = SDL_SwapBE16(src[6]);
Uint16 sample7 = SDL_SwapBE16(src[7]);
Uint16 last_sample0 = sample0;
Uint16 last_sample1 = sample1;
Uint16 last_sample2 = sample2;
Uint16 last_sample3 = sample3;
Uint16 last_sample4 = sample4;
Uint16 last_sample5 = sample5;
Uint16 last_sample6 = sample6;
Uint16 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = SDL_SwapBE16(sample0);
dst[1] = SDL_SwapBE16(sample1);
dst[2] = SDL_SwapBE16(sample2);
dst[3] = SDL_SwapBE16(sample3);
dst[4] = SDL_SwapBE16(sample4);
dst[5] = SDL_SwapBE16(sample5);
dst[6] = SDL_SwapBE16(sample6);
dst[7] = SDL_SwapBE16(sample7);
dst += 8;
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1);
sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11213 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
src += 16;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U16MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11345 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint16 *dst = (Uint16 *) cvt->buf;
const Uint16 *src = (Uint16 *) cvt->buf;
const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
while (dst < target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
src += 32;
dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Downsample_U8_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2328 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 16;
const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
register int eps = 0;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Uint8 sample0 = src[0];
Uint8 last_sample0 = sample0;
while (dst < target) {
src++;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = sample0;
dst++;
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7126 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
src += 2;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7181 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
src += 4;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
last_sample0 = sample0;
dst++;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2397 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Uint8 sample0 = src[0];
Uint8 sample1 = src[1];
Uint8 last_sample0 = sample0;
Uint8 last_sample1 = sample1;
while (dst < target) {
src += 2;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = sample0;
dst[1] = sample1;
dst += 2;
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7239 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
src += 4;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7305 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
src += 8;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
dst += 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2481 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Uint8 sample0 = src[0];
Uint8 sample1 = src[1];
Uint8 sample2 = src[2];
Uint8 sample3 = src[3];
Uint8 last_sample0 = sample0;
Uint8 last_sample1 = sample1;
Uint8 last_sample2 = sample2;
Uint8 last_sample3 = sample3;
while (dst < target) {
src += 4;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = sample0;
dst[1] = sample1;
dst[2] = sample2;
dst[3] = sample3;
dst += 4;
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7377 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample3 = (Sint16) src[3];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample3 = (Sint16) src[3];
src += 8;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7465 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample3 = (Sint16) src[3];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample3 = (Sint16) src[3];
src += 16;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
dst += 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2585 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 96;
const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
register int eps = 0;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Uint8 sample0 = src[0];
Uint8 sample1 = src[1];
Uint8 sample2 = src[2];
Uint8 sample3 = src[3];
Uint8 sample4 = src[4];
Uint8 sample5 = src[5];
Uint8 last_sample0 = sample0;
Uint8 last_sample1 = sample1;
Uint8 last_sample2 = sample2;
Uint8 last_sample3 = sample3;
Uint8 last_sample4 = sample4;
Uint8 last_sample5 = sample5;
while (dst < target) {
src += 6;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = sample0;
dst[1] = sample1;
dst[2] = sample2;
dst[3] = sample3;
dst[4] = sample4;
dst[5] = sample5;
dst += 6;
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7555 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample5 = (Sint16) src[5];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample5 = (Sint16) src[5];
src += 12;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7665 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample5 = (Sint16) src[5];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample5 = (Sint16) src[5];
src += 24;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
dst += 6;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2709 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Uint8 sample0 = src[0];
Uint8 sample1 = src[1];
Uint8 sample2 = src[2];
Uint8 sample3 = src[3];
Uint8 sample4 = src[4];
Uint8 sample5 = src[5];
Uint8 sample6 = src[6];
Uint8 sample7 = src[7];
Uint8 last_sample0 = sample0;
Uint8 last_sample1 = sample1;
Uint8 last_sample2 = sample2;
Uint8 last_sample3 = sample3;
Uint8 last_sample4 = sample4;
Uint8 last_sample5 = sample5;
Uint8 last_sample6 = sample6;
Uint8 last_sample7 = sample7;
while (dst < target) {
src += 8;
eps += dstsize;
if ((eps << 1) >= srcsize) {
dst[0] = sample0;
dst[1] = sample1;
dst[2] = sample2;
dst[3] = sample3;
dst[4] = sample4;
dst[5] = sample5;
dst[6] = sample6;
dst[7] = sample7;
dst += 8;
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1);
sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
eps -= srcsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7773 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 2;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample5 = (Sint16) src[5];
Sint16 last_sample6 = (Sint16) src[6];
Sint16 last_sample7 = (Sint16) src[7];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample5 = (Sint16) src[5];
const Sint16 sample6 = (Sint16) src[6];
const Sint16 sample7 = (Sint16) src[7];
src += 16;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
dst[6] = (Uint8) ((sample6 + last_sample6) >> 1);
dst[7] = (Uint8) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Downsample_U8_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7905 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt / 4;
Uint8 *dst = (Uint8 *) cvt->buf;
const Uint8 *src = (Uint8 *) cvt->buf;
const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
Sint16 last_sample0 = (Sint16) src[0];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample5 = (Sint16) src[5];
Sint16 last_sample6 = (Sint16) src[6];
Sint16 last_sample7 = (Sint16) src[7];
while (dst < target) {
const Sint16 sample0 = (Sint16) src[0];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample5 = (Sint16) src[5];
const Sint16 sample6 = (Sint16) src[6];
const Sint16 sample7 = (Sint16) src[7];
src += 32;
dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
dst[6] = (Uint8) ((sample6 + last_sample6) >> 1);
dst[7] = (Uint8) ((sample7 + last_sample7) >> 1);
last_sample0 = sample0;
last_sample1 = sample1;
last_sample2 = sample2;
last_sample3 = sample3;
last_sample4 = sample4;
last_sample5 = sample5;
last_sample6 = sample6;
last_sample7 = sample7;
dst += 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_F32LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6136 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 1;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
const float *target = ((const float *) cvt->buf);
float sample0 = SDL_SwapFloatLE(src[0]);
float last_sample0 = sample0;
while (dst >= target) {
dst[0] = SDL_SwapFloatLE(sample0);
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13979 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
const float *target = ((const float *) cvt->buf);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src--;
dst[1] = (float) ((sample0 + last_sample0) * 0.5);
dst[0] = (float) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14032 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
const float *target = ((const float *) cvt->buf);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src--;
dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[2] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[0] = (float) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6200 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
const float *target = ((const float *) cvt->buf);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample0 = SDL_SwapFloatLE(src[0]);
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[1] = SDL_SwapFloatLE(sample1);
dst[0] = SDL_SwapFloatLE(sample0);
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14087 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
const float *target = ((const float *) cvt->buf);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 2;
dst[3] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14149 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
const float *target = ((const float *) cvt->buf);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 2;
dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[5] = (float) ((sample1 + last_sample1) * 0.5);
dst[4] = (float) ((sample0 + last_sample0) * 0.5);
dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6274 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
const float *target = ((const float *) cvt->buf);
float sample3 = SDL_SwapFloatLE(src[3]);
float sample2 = SDL_SwapFloatLE(src[2]);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample0 = SDL_SwapFloatLE(src[0]);
float last_sample3 = sample3;
float last_sample2 = sample2;
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[3] = SDL_SwapFloatLE(sample3);
dst[2] = SDL_SwapFloatLE(sample2);
dst[1] = SDL_SwapFloatLE(sample1);
dst[0] = SDL_SwapFloatLE(sample0);
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14215 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
const float *target = ((const float *) cvt->buf);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 4;
dst[7] = (float) ((sample3 + last_sample3) * 0.5);
dst[6] = (float) ((sample2 + last_sample2) * 0.5);
dst[5] = (float) ((sample1 + last_sample1) * 0.5);
dst[4] = (float) ((sample0 + last_sample0) * 0.5);
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14295 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
const float *target = ((const float *) cvt->buf);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 4;
dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[11] = (float) ((sample3 + last_sample3) * 0.5);
dst[10] = (float) ((sample2 + last_sample2) * 0.5);
dst[9] = (float) ((sample1 + last_sample1) * 0.5);
dst[8] = (float) ((sample0 + last_sample0) * 0.5);
dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6368 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 6;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
const float *target = ((const float *) cvt->buf);
float sample5 = SDL_SwapFloatLE(src[5]);
float sample4 = SDL_SwapFloatLE(src[4]);
float sample3 = SDL_SwapFloatLE(src[3]);
float sample2 = SDL_SwapFloatLE(src[2]);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample0 = SDL_SwapFloatLE(src[0]);
float last_sample5 = sample5;
float last_sample4 = sample4;
float last_sample3 = sample3;
float last_sample2 = sample2;
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[5] = SDL_SwapFloatLE(sample5);
dst[4] = SDL_SwapFloatLE(sample4);
dst[3] = SDL_SwapFloatLE(sample3);
dst[2] = SDL_SwapFloatLE(sample2);
dst[1] = SDL_SwapFloatLE(sample1);
dst[0] = SDL_SwapFloatLE(sample0);
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14383 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
const float *target = ((const float *) cvt->buf);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 6;
dst[11] = (float) ((sample5 + last_sample5) * 0.5);
dst[10] = (float) ((sample4 + last_sample4) * 0.5);
dst[9] = (float) ((sample3 + last_sample3) * 0.5);
dst[8] = (float) ((sample2 + last_sample2) * 0.5);
dst[7] = (float) ((sample1 + last_sample1) * 0.5);
dst[6] = (float) ((sample0 + last_sample0) * 0.5);
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14481 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
const float *target = ((const float *) cvt->buf);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 6;
dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[17] = (float) ((sample5 + last_sample5) * 0.5);
dst[16] = (float) ((sample4 + last_sample4) * 0.5);
dst[15] = (float) ((sample3 + last_sample3) * 0.5);
dst[14] = (float) ((sample2 + last_sample2) * 0.5);
dst[13] = (float) ((sample1 + last_sample1) * 0.5);
dst[12] = (float) ((sample0 + last_sample0) * 0.5);
dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6482 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 8;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
const float *target = ((const float *) cvt->buf);
float sample7 = SDL_SwapFloatLE(src[7]);
float sample6 = SDL_SwapFloatLE(src[6]);
float sample5 = SDL_SwapFloatLE(src[5]);
float sample4 = SDL_SwapFloatLE(src[4]);
float sample3 = SDL_SwapFloatLE(src[3]);
float sample2 = SDL_SwapFloatLE(src[2]);
float sample1 = SDL_SwapFloatLE(src[1]);
float sample0 = SDL_SwapFloatLE(src[0]);
float last_sample7 = sample7;
float last_sample6 = sample6;
float last_sample5 = sample5;
float last_sample4 = sample4;
float last_sample3 = sample3;
float last_sample2 = sample2;
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[7] = SDL_SwapFloatLE(sample7);
dst[6] = SDL_SwapFloatLE(sample6);
dst[5] = SDL_SwapFloatLE(sample5);
dst[4] = SDL_SwapFloatLE(sample4);
dst[3] = SDL_SwapFloatLE(sample3);
dst[2] = SDL_SwapFloatLE(sample2);
dst[1] = SDL_SwapFloatLE(sample1);
dst[0] = SDL_SwapFloatLE(sample0);
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5);
sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5);
sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14591 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
const float *target = ((const float *) cvt->buf);
double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample7 = (double) SDL_SwapFloatLE(src[7]);
const double sample6 = (double) SDL_SwapFloatLE(src[6]);
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 8;
dst[15] = (float) ((sample7 + last_sample7) * 0.5);
dst[14] = (float) ((sample6 + last_sample6) * 0.5);
dst[13] = (float) ((sample5 + last_sample5) * 0.5);
dst[12] = (float) ((sample4 + last_sample4) * 0.5);
dst[11] = (float) ((sample3 + last_sample3) * 0.5);
dst[10] = (float) ((sample2 + last_sample2) * 0.5);
dst[9] = (float) ((sample1 + last_sample1) * 0.5);
dst[8] = (float) ((sample0 + last_sample0) * 0.5);
dst[7] = (float) sample7;
dst[6] = (float) sample6;
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14707 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatLE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
const float *target = ((const float *) cvt->buf);
double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
while (dst >= target) {
const double sample7 = (double) SDL_SwapFloatLE(src[7]);
const double sample6 = (double) SDL_SwapFloatLE(src[6]);
const double sample5 = (double) SDL_SwapFloatLE(src[5]);
const double sample4 = (double) SDL_SwapFloatLE(src[4]);
const double sample3 = (double) SDL_SwapFloatLE(src[3]);
const double sample2 = (double) SDL_SwapFloatLE(src[2]);
const double sample1 = (double) SDL_SwapFloatLE(src[1]);
const double sample0 = (double) SDL_SwapFloatLE(src[0]);
src -= 8;
dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[23] = (float) ((sample7 + last_sample7) * 0.5);
dst[22] = (float) ((sample6 + last_sample6) * 0.5);
dst[21] = (float) ((sample5 + last_sample5) * 0.5);
dst[20] = (float) ((sample4 + last_sample4) * 0.5);
dst[19] = (float) ((sample3 + last_sample3) * 0.5);
dst[18] = (float) ((sample2 + last_sample2) * 0.5);
dst[17] = (float) ((sample1 + last_sample1) * 0.5);
dst[16] = (float) ((sample0 + last_sample0) * 0.5);
dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[7] = (float) sample7;
dst[6] = (float) sample6;
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapFloatLE
#define SDL_SwapFloatLE(X)
Definition: SDL_endian.h:214
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6616 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 1;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
const float *target = ((const float *) cvt->buf);
float sample0 = SDL_SwapFloatBE(src[0]);
float last_sample0 = sample0;
while (dst >= target) {
dst[0] = SDL_SwapFloatBE(sample0);
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14839 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
const float *target = ((const float *) cvt->buf);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src--;
dst[1] = (float) ((sample0 + last_sample0) * 0.5);
dst[0] = (float) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14892 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
const float *target = ((const float *) cvt->buf);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src--;
dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[2] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[0] = (float) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6680 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
const float *target = ((const float *) cvt->buf);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample0 = SDL_SwapFloatBE(src[0]);
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[1] = SDL_SwapFloatBE(sample1);
dst[0] = SDL_SwapFloatBE(sample0);
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 14947 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
const float *target = ((const float *) cvt->buf);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 2;
dst[3] = (float) ((sample1 + last_sample1) * 0.5);
dst[2] = (float) ((sample0 + last_sample0) * 0.5);
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15009 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
const float *target = ((const float *) cvt->buf);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 2;
dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[5] = (float) ((sample1 + last_sample1) * 0.5);
dst[4] = (float) ((sample0 + last_sample0) * 0.5);
dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6754 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
const float *target = ((const float *) cvt->buf);
float sample3 = SDL_SwapFloatBE(src[3]);
float sample2 = SDL_SwapFloatBE(src[2]);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample0 = SDL_SwapFloatBE(src[0]);
float last_sample3 = sample3;
float last_sample2 = sample2;
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[3] = SDL_SwapFloatBE(sample3);
dst[2] = SDL_SwapFloatBE(sample2);
dst[1] = SDL_SwapFloatBE(sample1);
dst[0] = SDL_SwapFloatBE(sample0);
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15075 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
const float *target = ((const float *) cvt->buf);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 4;
dst[7] = (float) ((sample3 + last_sample3) * 0.5);
dst[6] = (float) ((sample2 + last_sample2) * 0.5);
dst[5] = (float) ((sample1 + last_sample1) * 0.5);
dst[4] = (float) ((sample0 + last_sample0) * 0.5);
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15155 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
const float *target = ((const float *) cvt->buf);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 4;
dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[11] = (float) ((sample3 + last_sample3) * 0.5);
dst[10] = (float) ((sample2 + last_sample2) * 0.5);
dst[9] = (float) ((sample1 + last_sample1) * 0.5);
dst[8] = (float) ((sample0 + last_sample0) * 0.5);
dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6848 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 6;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
const float *target = ((const float *) cvt->buf);
float sample5 = SDL_SwapFloatBE(src[5]);
float sample4 = SDL_SwapFloatBE(src[4]);
float sample3 = SDL_SwapFloatBE(src[3]);
float sample2 = SDL_SwapFloatBE(src[2]);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample0 = SDL_SwapFloatBE(src[0]);
float last_sample5 = sample5;
float last_sample4 = sample4;
float last_sample3 = sample3;
float last_sample2 = sample2;
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[5] = SDL_SwapFloatBE(sample5);
dst[4] = SDL_SwapFloatBE(sample4);
dst[3] = SDL_SwapFloatBE(sample3);
dst[2] = SDL_SwapFloatBE(sample2);
dst[1] = SDL_SwapFloatBE(sample1);
dst[0] = SDL_SwapFloatBE(sample0);
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15243 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
const float *target = ((const float *) cvt->buf);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 6;
dst[11] = (float) ((sample5 + last_sample5) * 0.5);
dst[10] = (float) ((sample4 + last_sample4) * 0.5);
dst[9] = (float) ((sample3 + last_sample3) * 0.5);
dst[8] = (float) ((sample2 + last_sample2) * 0.5);
dst[7] = (float) ((sample1 + last_sample1) * 0.5);
dst[6] = (float) ((sample0 + last_sample0) * 0.5);
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15341 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
const float *target = ((const float *) cvt->buf);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 6;
dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[17] = (float) ((sample5 + last_sample5) * 0.5);
dst[16] = (float) ((sample4 + last_sample4) * 0.5);
dst[15] = (float) ((sample3 + last_sample3) * 0.5);
dst[14] = (float) ((sample2 + last_sample2) * 0.5);
dst[13] = (float) ((sample1 + last_sample1) * 0.5);
dst[12] = (float) ((sample0 + last_sample0) * 0.5);
dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6962 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
float *dst = ((float *) (cvt->buf + dstsize)) - 8;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
const float *target = ((const float *) cvt->buf);
float sample7 = SDL_SwapFloatBE(src[7]);
float sample6 = SDL_SwapFloatBE(src[6]);
float sample5 = SDL_SwapFloatBE(src[5]);
float sample4 = SDL_SwapFloatBE(src[4]);
float sample3 = SDL_SwapFloatBE(src[3]);
float sample2 = SDL_SwapFloatBE(src[2]);
float sample1 = SDL_SwapFloatBE(src[1]);
float sample0 = SDL_SwapFloatBE(src[0]);
float last_sample7 = sample7;
float last_sample6 = sample6;
float last_sample5 = sample5;
float last_sample4 = sample4;
float last_sample3 = sample3;
float last_sample2 = sample2;
float last_sample1 = sample1;
float last_sample0 = sample0;
while (dst >= target) {
dst[7] = SDL_SwapFloatBE(sample7);
dst[6] = SDL_SwapFloatBE(sample6);
dst[5] = SDL_SwapFloatBE(sample5);
dst[4] = SDL_SwapFloatBE(sample4);
dst[3] = SDL_SwapFloatBE(sample3);
dst[2] = SDL_SwapFloatBE(sample2);
dst[1] = SDL_SwapFloatBE(sample1);
dst[0] = SDL_SwapFloatBE(sample0);
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5);
sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5);
sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15451 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
const float *target = ((const float *) cvt->buf);
double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample7 = (double) SDL_SwapFloatBE(src[7]);
const double sample6 = (double) SDL_SwapFloatBE(src[6]);
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 8;
dst[15] = (float) ((sample7 + last_sample7) * 0.5);
dst[14] = (float) ((sample6 + last_sample6) * 0.5);
dst[13] = (float) ((sample5 + last_sample5) * 0.5);
dst[12] = (float) ((sample4 + last_sample4) * 0.5);
dst[11] = (float) ((sample3 + last_sample3) * 0.5);
dst[10] = (float) ((sample2 + last_sample2) * 0.5);
dst[9] = (float) ((sample1 + last_sample1) * 0.5);
dst[8] = (float) ((sample0 + last_sample0) * 0.5);
dst[7] = (float) sample7;
dst[6] = (float) sample6;
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_F32MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 15567 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapFloatBE, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4;
const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
const float *target = ((const float *) cvt->buf);
double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
while (dst >= target) {
const double sample7 = (double) SDL_SwapFloatBE(src[7]);
const double sample6 = (double) SDL_SwapFloatBE(src[6]);
const double sample5 = (double) SDL_SwapFloatBE(src[5]);
const double sample4 = (double) SDL_SwapFloatBE(src[4]);
const double sample3 = (double) SDL_SwapFloatBE(src[3]);
const double sample2 = (double) SDL_SwapFloatBE(src[2]);
const double sample1 = (double) SDL_SwapFloatBE(src[1]);
const double sample0 = (double) SDL_SwapFloatBE(src[0]);
src -= 8;
dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
dst[23] = (float) ((sample7 + last_sample7) * 0.5);
dst[22] = (float) ((sample6 + last_sample6) * 0.5);
dst[21] = (float) ((sample5 + last_sample5) * 0.5);
dst[20] = (float) ((sample4 + last_sample4) * 0.5);
dst[19] = (float) ((sample3 + last_sample3) * 0.5);
dst[18] = (float) ((sample2 + last_sample2) * 0.5);
dst[17] = (float) ((sample1 + last_sample1) * 0.5);
dst[16] = (float) ((sample0 + last_sample0) * 0.5);
dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
dst[7] = (float) sample7;
dst[6] = (float) sample6;
dst[5] = (float) sample5;
dst[4] = (float) sample4;
dst[3] = (float) sample3;
dst[2] = (float) sample2;
dst[1] = (float) sample1;
dst[0] = (float) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_SwapFloatBE
#define SDL_SwapFloatBE(X)
Definition: SDL_endian.h:218
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S16LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3736 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9679 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src--;
dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[0] = (Sint16) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9732 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src--;
dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Sint16) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3800 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9787 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 2;
dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9849 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 2;
dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3874 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 last_sample3 = sample3;
Sint16 last_sample2 = sample2;
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[3] = ((Sint16) SDL_SwapLE16(sample3));
dst[2] = ((Sint16) SDL_SwapLE16(sample2));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9915 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 4;
dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9995 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 4;
dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3968 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 last_sample5 = sample5;
Sint16 last_sample4 = sample4;
Sint16 last_sample3 = sample3;
Sint16 last_sample2 = sample2;
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[5] = ((Sint16) SDL_SwapLE16(sample5));
dst[4] = ((Sint16) SDL_SwapLE16(sample4));
dst[3] = ((Sint16) SDL_SwapLE16(sample3));
dst[2] = ((Sint16) SDL_SwapLE16(sample2));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10083 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 6;
dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10181 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 6;
dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4082 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7]));
Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6]));
Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
Sint16 last_sample7 = sample7;
Sint16 last_sample6 = sample6;
Sint16 last_sample5 = sample5;
Sint16 last_sample4 = sample4;
Sint16 last_sample3 = sample3;
Sint16 last_sample2 = sample2;
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[7] = ((Sint16) SDL_SwapLE16(sample7));
dst[6] = ((Sint16) SDL_SwapLE16(sample6));
dst[5] = ((Sint16) SDL_SwapLE16(sample5));
dst[4] = ((Sint16) SDL_SwapLE16(sample4));
dst[3] = ((Sint16) SDL_SwapLE16(sample3));
dst[2] = ((Sint16) SDL_SwapLE16(sample2));
dst[1] = ((Sint16) SDL_SwapLE16(sample1));
dst[0] = ((Sint16) SDL_SwapLE16(sample0));
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10291 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 8;
dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint16) sample7;
dst[6] = (Sint16) sample6;
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10407 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
while (dst >= target) {
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
src -= 8;
dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Sint16) sample7;
dst[6] = (Sint16) sample6;
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4696 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11399 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src--;
dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[0] = (Sint16) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11452 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src--;
dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Sint16) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4760 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11507 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 2;
dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11569 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 2;
dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4834 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 last_sample3 = sample3;
Sint16 last_sample2 = sample2;
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[3] = ((Sint16) SDL_SwapBE16(sample3));
dst[2] = ((Sint16) SDL_SwapBE16(sample2));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11635 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 4;
dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11715 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 4;
dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4928 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 last_sample5 = sample5;
Sint16 last_sample4 = sample4;
Sint16 last_sample3 = sample3;
Sint16 last_sample2 = sample2;
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[5] = ((Sint16) SDL_SwapBE16(sample5));
dst[4] = ((Sint16) SDL_SwapBE16(sample4));
dst[3] = ((Sint16) SDL_SwapBE16(sample3));
dst[2] = ((Sint16) SDL_SwapBE16(sample2));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11803 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 6;
dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11901 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 6;
dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5042 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7]));
Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6]));
Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
Sint16 last_sample7 = sample7;
Sint16 last_sample6 = sample6;
Sint16 last_sample5 = sample5;
Sint16 last_sample4 = sample4;
Sint16 last_sample3 = sample3;
Sint16 last_sample2 = sample2;
Sint16 last_sample1 = sample1;
Sint16 last_sample0 = sample0;
while (dst >= target) {
dst[7] = ((Sint16) SDL_SwapBE16(sample7));
dst[6] = ((Sint16) SDL_SwapBE16(sample6));
dst[5] = ((Sint16) SDL_SwapBE16(sample5));
dst[4] = ((Sint16) SDL_SwapBE16(sample4));
dst[3] = ((Sint16) SDL_SwapBE16(sample3));
dst[2] = ((Sint16) SDL_SwapBE16(sample2));
dst[1] = ((Sint16) SDL_SwapBE16(sample1));
dst[0] = ((Sint16) SDL_SwapBE16(sample0));
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12011 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 8;
dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint16) sample7;
dst[6] = (Sint16) sample6;
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S16MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12127 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4;
const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint16 *target = ((const Sint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
while (dst >= target) {
const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
src -= 8;
dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Sint16) sample7;
dst[6] = (Sint16) sample6;
dst[5] = (Sint16) sample5;
dst[4] = (Sint16) sample4;
dst[3] = (Sint16) sample3;
dst[2] = (Sint16) sample2;
dst[1] = (Sint16) sample1;
dst[0] = (Sint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S32LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5176 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12259 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src--;
dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[0] = (Sint32) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12312 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src--;
dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Sint32) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5240 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12367 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 2;
dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12429 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 2;
dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5314 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 last_sample3 = sample3;
Sint32 last_sample2 = sample2;
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[3] = ((Sint32) SDL_SwapLE32(sample3));
dst[2] = ((Sint32) SDL_SwapLE32(sample2));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12495 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 4;
dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12575 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 4;
dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5408 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 last_sample5 = sample5;
Sint32 last_sample4 = sample4;
Sint32 last_sample3 = sample3;
Sint32 last_sample2 = sample2;
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[5] = ((Sint32) SDL_SwapLE32(sample5));
dst[4] = ((Sint32) SDL_SwapLE32(sample4));
dst[3] = ((Sint32) SDL_SwapLE32(sample3));
dst[2] = ((Sint32) SDL_SwapLE32(sample2));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12663 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 6;
dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12761 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 6;
dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5522 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7]));
Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6]));
Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
Sint32 last_sample7 = sample7;
Sint32 last_sample6 = sample6;
Sint32 last_sample5 = sample5;
Sint32 last_sample4 = sample4;
Sint32 last_sample3 = sample3;
Sint32 last_sample2 = sample2;
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[7] = ((Sint32) SDL_SwapLE32(sample7));
dst[6] = ((Sint32) SDL_SwapLE32(sample6));
dst[5] = ((Sint32) SDL_SwapLE32(sample5));
dst[4] = ((Sint32) SDL_SwapLE32(sample4));
dst[3] = ((Sint32) SDL_SwapLE32(sample3));
dst[2] = ((Sint32) SDL_SwapLE32(sample2));
dst[1] = ((Sint32) SDL_SwapLE32(sample1));
dst[0] = ((Sint32) SDL_SwapLE32(sample0));
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12871 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 8;
dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint32) sample7;
dst[6] = (Sint32) sample6;
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 12987 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
while (dst >= target) {
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
src -= 8;
dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Sint32) sample7;
dst[6] = (Sint32) sample6;
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_SwapLE32
#define SDL_SwapLE32(X)
Definition: SDL_endian.h:212
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5656 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13119 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src--;
dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[0] = (Sint32) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13172 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src--;
dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Sint32) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5720 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13227 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 2;
dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13289 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 2;
dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5794 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 last_sample3 = sample3;
Sint32 last_sample2 = sample2;
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[3] = ((Sint32) SDL_SwapBE32(sample3));
dst[2] = ((Sint32) SDL_SwapBE32(sample2));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13355 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 4;
dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13435 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 4;
dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 5888 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 384;
const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 last_sample5 = sample5;
Sint32 last_sample4 = sample4;
Sint32 last_sample3 = sample3;
Sint32 last_sample2 = sample2;
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[5] = ((Sint32) SDL_SwapBE32(sample5));
dst[4] = ((Sint32) SDL_SwapBE32(sample4));
dst[3] = ((Sint32) SDL_SwapBE32(sample3));
dst[2] = ((Sint32) SDL_SwapBE32(sample2));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13523 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 6;
dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13621 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 6;
dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 6002 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 512;
const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
register int eps = 0;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7]));
Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6]));
Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
Sint32 last_sample7 = sample7;
Sint32 last_sample6 = sample6;
Sint32 last_sample5 = sample5;
Sint32 last_sample4 = sample4;
Sint32 last_sample3 = sample3;
Sint32 last_sample2 = sample2;
Sint32 last_sample1 = sample1;
Sint32 last_sample0 = sample0;
while (dst >= target) {
dst[7] = ((Sint32) SDL_SwapBE32(sample7));
dst[6] = ((Sint32) SDL_SwapBE32(sample6));
dst[5] = ((Sint32) SDL_SwapBE32(sample5));
dst[4] = ((Sint32) SDL_SwapBE32(sample4));
dst[3] = ((Sint32) SDL_SwapBE32(sample3));
dst[2] = ((Sint32) SDL_SwapBE32(sample2));
dst[1] = ((Sint32) SDL_SwapBE32(sample1));
dst[0] = ((Sint32) SDL_SwapBE32(sample0));
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13731 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 8;
dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint32) sample7;
dst[6] = (Sint32) sample6;
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S32MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 13847 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE32, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4;
const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint32 *target = ((const Sint32 *) cvt->buf);
Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
while (dst >= target) {
const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
src -= 8;
dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Sint32) sample7;
dst[6] = (Sint32) sample6;
dst[5] = (Sint32) sample5;
dst[4] = (Sint32) sample4;
dst[3] = (Sint32) sample3;
dst[2] = (Sint32) sample2;
dst[1] = (Sint32) sample1;
dst[0] = (Sint32) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE32
#define SDL_SwapBE32(X)
Definition: SDL_endian.h:216
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Sint64
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:160
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_S8_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2776 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 16;
const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
register int eps = 0;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 last_sample0 = sample0;
while (dst >= target) {
dst[0] = ((Sint8) sample0);
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7959 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 2;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src--;
dst[1] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[0] = (Sint8) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8012 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 4;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src--;
dst[3] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Sint8) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2840 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 last_sample1 = sample1;
Sint8 last_sample0 = sample0;
while (dst >= target) {
dst[1] = ((Sint8) sample1);
dst[0] = ((Sint8) sample0);
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8067 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 2;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 2;
dst[3] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8129 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 4;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 2;
dst[7] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2914 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint8 sample3 = ((Sint8) src[3]);
Sint8 sample2 = ((Sint8) src[2]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 last_sample3 = sample3;
Sint8 last_sample2 = sample2;
Sint8 last_sample1 = sample1;
Sint8 last_sample0 = sample0;
while (dst >= target) {
dst[3] = ((Sint8) sample3);
dst[2] = ((Sint8) sample2);
dst[1] = ((Sint8) sample1);
dst[0] = ((Sint8) sample0);
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8195 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 2;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 4;
dst[7] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[6] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[3] = (Sint8) sample3;
dst[2] = (Sint8) sample2;
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8275 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 4;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 4;
dst[15] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Sint8) sample3;
dst[2] = (Sint8) sample2;
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3008 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 96;
const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
register int eps = 0;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint8 sample5 = ((Sint8) src[5]);
Sint8 sample4 = ((Sint8) src[4]);
Sint8 sample3 = ((Sint8) src[3]);
Sint8 sample2 = ((Sint8) src[2]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 last_sample5 = sample5;
Sint8 last_sample4 = sample4;
Sint8 last_sample3 = sample3;
Sint8 last_sample2 = sample2;
Sint8 last_sample1 = sample1;
Sint8 last_sample0 = sample0;
while (dst >= target) {
dst[5] = ((Sint8) sample5);
dst[4] = ((Sint8) sample4);
dst[3] = ((Sint8) sample3);
dst[2] = ((Sint8) sample2);
dst[1] = ((Sint8) sample1);
dst[0] = ((Sint8) sample0);
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8363 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 2;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 6;
dst[11] = (Sint8) ((sample5 + last_sample5) >> 1);
dst[10] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[9] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[8] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[7] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[6] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[5] = (Sint8) sample5;
dst[4] = (Sint8) sample4;
dst[3] = (Sint8) sample3;
dst[2] = (Sint8) sample2;
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8461 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 4;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 6;
dst[23] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Sint8) ((sample5 + last_sample5) >> 1);
dst[16] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[15] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[14] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[13] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[12] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[11] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Sint8) sample5;
dst[4] = (Sint8) sample4;
dst[3] = (Sint8) sample3;
dst[2] = (Sint8) sample2;
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3122 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint8 sample7 = ((Sint8) src[7]);
Sint8 sample6 = ((Sint8) src[6]);
Sint8 sample5 = ((Sint8) src[5]);
Sint8 sample4 = ((Sint8) src[4]);
Sint8 sample3 = ((Sint8) src[3]);
Sint8 sample2 = ((Sint8) src[2]);
Sint8 sample1 = ((Sint8) src[1]);
Sint8 sample0 = ((Sint8) src[0]);
Sint8 last_sample7 = sample7;
Sint8 last_sample6 = sample6;
Sint8 last_sample5 = sample5;
Sint8 last_sample4 = sample4;
Sint8 last_sample3 = sample3;
Sint8 last_sample2 = sample2;
Sint8 last_sample1 = sample1;
Sint8 last_sample0 = sample0;
while (dst >= target) {
dst[7] = ((Sint8) sample7);
dst[6] = ((Sint8) sample6);
dst[5] = ((Sint8) sample5);
dst[4] = ((Sint8) sample4);
dst[3] = ((Sint8) sample3);
dst[2] = ((Sint8) sample2);
dst[1] = ((Sint8) sample1);
dst[0] = ((Sint8) sample0);
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1);
sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1);
sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8571 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 2;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 8;
dst[15] = (Sint8) ((sample7 + last_sample7) >> 1);
dst[14] = (Sint8) ((sample6 + last_sample6) >> 1);
dst[13] = (Sint8) ((sample5 + last_sample5) >> 1);
dst[12] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[7] = (Sint8) sample7;
dst[6] = (Sint8) sample6;
dst[5] = (Sint8) sample5;
dst[4] = (Sint8) sample4;
dst[3] = (Sint8) sample3;
dst[2] = (Sint8) sample2;
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_S8_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8687 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 4;
const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
const Sint8 *target = ((const Sint8 *) cvt->buf);
Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
while (dst >= target) {
const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
src -= 8;
dst[31] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Sint8) ((sample7 + last_sample7) >> 1);
dst[22] = (Sint8) ((sample6 + last_sample6) >> 1);
dst[21] = (Sint8) ((sample5 + last_sample5) >> 1);
dst[20] = (Sint8) ((sample4 + last_sample4) >> 1);
dst[19] = (Sint8) ((sample3 + last_sample3) >> 1);
dst[18] = (Sint8) ((sample2 + last_sample2) >> 1);
dst[17] = (Sint8) ((sample1 + last_sample1) >> 1);
dst[16] = (Sint8) ((sample0 + last_sample0) >> 1);
dst[15] = (Sint8) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Sint8) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Sint8) sample7;
dst[6] = (Sint8) sample6;
dst[5] = (Sint8) sample5;
dst[4] = (Sint8) sample4;
dst[3] = (Sint8) sample3;
dst[2] = (Sint8) sample2;
dst[1] = (Sint8) sample1;
dst[0] = (Sint8) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Sint8
int8_t Sint8
A signed 8-bit integer type.
Definition: SDL_stdinc.h:135
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U16LSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3256 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[0] = SDL_SwapLE16(sample0);
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8819 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src--;
dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[0] = (Uint16) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8872 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src--;
dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Uint16) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3320 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[1] = SDL_SwapLE16(sample1);
dst[0] = SDL_SwapLE16(sample0);
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8927 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 2;
dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 8989 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 2;
dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3394 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample3 = SDL_SwapLE16(src[3]);
Uint16 sample2 = SDL_SwapLE16(src[2]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 last_sample3 = sample3;
Uint16 last_sample2 = sample2;
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[3] = SDL_SwapLE16(sample3);
dst[2] = SDL_SwapLE16(sample2);
dst[1] = SDL_SwapLE16(sample1);
dst[0] = SDL_SwapLE16(sample0);
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9055 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 4;
dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9135 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 4;
dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3488 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample5 = SDL_SwapLE16(src[5]);
Uint16 sample4 = SDL_SwapLE16(src[4]);
Uint16 sample3 = SDL_SwapLE16(src[3]);
Uint16 sample2 = SDL_SwapLE16(src[2]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 last_sample5 = sample5;
Uint16 last_sample4 = sample4;
Uint16 last_sample3 = sample3;
Uint16 last_sample2 = sample2;
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[5] = SDL_SwapLE16(sample5);
dst[4] = SDL_SwapLE16(sample4);
dst[3] = SDL_SwapLE16(sample3);
dst[2] = SDL_SwapLE16(sample2);
dst[1] = SDL_SwapLE16(sample1);
dst[0] = SDL_SwapLE16(sample0);
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9223 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 6;
dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9321 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 6;
dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 3602 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample7 = SDL_SwapLE16(src[7]);
Uint16 sample6 = SDL_SwapLE16(src[6]);
Uint16 sample5 = SDL_SwapLE16(src[5]);
Uint16 sample4 = SDL_SwapLE16(src[4]);
Uint16 sample3 = SDL_SwapLE16(src[3]);
Uint16 sample2 = SDL_SwapLE16(src[2]);
Uint16 sample1 = SDL_SwapLE16(src[1]);
Uint16 sample0 = SDL_SwapLE16(src[0]);
Uint16 last_sample7 = sample7;
Uint16 last_sample6 = sample6;
Uint16 last_sample5 = sample5;
Uint16 last_sample4 = sample4;
Uint16 last_sample3 = sample3;
Uint16 last_sample2 = sample2;
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[7] = SDL_SwapLE16(sample7);
dst[6] = SDL_SwapLE16(sample6);
dst[5] = SDL_SwapLE16(sample5);
dst[4] = SDL_SwapLE16(sample4);
dst[3] = SDL_SwapLE16(sample3);
dst[2] = SDL_SwapLE16(sample2);
dst[1] = SDL_SwapLE16(sample1);
dst[0] = SDL_SwapLE16(sample0);
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1);
sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1);
sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9431 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 8;
dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Uint16) sample7;
dst[6] = (Uint16) sample6;
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16LSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 9547 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapLE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
while (dst >= target) {
const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
src -= 8;
dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Uint16) sample7;
dst[6] = (Uint16) sample6;
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_SwapLE16
#define SDL_SwapLE16(X)
Definition: SDL_endian.h:211
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4216 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[0] = SDL_SwapBE16(sample0);
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10539 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src--;
dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[0] = (Uint16) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10592 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src--;
dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Uint16) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4280 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[1] = SDL_SwapBE16(sample1);
dst[0] = SDL_SwapBE16(sample0);
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10647 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 2;
dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10709 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 2;
dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4354 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample3 = SDL_SwapBE16(src[3]);
Uint16 sample2 = SDL_SwapBE16(src[2]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 last_sample3 = sample3;
Uint16 last_sample2 = sample2;
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[3] = SDL_SwapBE16(sample3);
dst[2] = SDL_SwapBE16(sample2);
dst[1] = SDL_SwapBE16(sample1);
dst[0] = SDL_SwapBE16(sample0);
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10775 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 4;
dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10855 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 4;
dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4448 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 192;
const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample5 = SDL_SwapBE16(src[5]);
Uint16 sample4 = SDL_SwapBE16(src[4]);
Uint16 sample3 = SDL_SwapBE16(src[3]);
Uint16 sample2 = SDL_SwapBE16(src[2]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 last_sample5 = sample5;
Uint16 last_sample4 = sample4;
Uint16 last_sample3 = sample3;
Uint16 last_sample2 = sample2;
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[5] = SDL_SwapBE16(sample5);
dst[4] = SDL_SwapBE16(sample4);
dst[3] = SDL_SwapBE16(sample3);
dst[2] = SDL_SwapBE16(sample2);
dst[1] = SDL_SwapBE16(sample1);
dst[0] = SDL_SwapBE16(sample0);
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 10943 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 6;
dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11041 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 6;
dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 4562 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 256;
const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
register int eps = 0;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Uint16 sample7 = SDL_SwapBE16(src[7]);
Uint16 sample6 = SDL_SwapBE16(src[6]);
Uint16 sample5 = SDL_SwapBE16(src[5]);
Uint16 sample4 = SDL_SwapBE16(src[4]);
Uint16 sample3 = SDL_SwapBE16(src[3]);
Uint16 sample2 = SDL_SwapBE16(src[2]);
Uint16 sample1 = SDL_SwapBE16(src[1]);
Uint16 sample0 = SDL_SwapBE16(src[0]);
Uint16 last_sample7 = sample7;
Uint16 last_sample6 = sample6;
Uint16 last_sample5 = sample5;
Uint16 last_sample4 = sample4;
Uint16 last_sample3 = sample3;
Uint16 last_sample2 = sample2;
Uint16 last_sample1 = sample1;
Uint16 last_sample0 = sample0;
while (dst >= target) {
dst[7] = SDL_SwapBE16(sample7);
dst[6] = SDL_SwapBE16(sample6);
dst[5] = SDL_SwapBE16(sample5);
dst[4] = SDL_SwapBE16(sample4);
dst[3] = SDL_SwapBE16(sample3);
dst[2] = SDL_SwapBE16(sample2);
dst[1] = SDL_SwapBE16(sample1);
dst[0] = SDL_SwapBE16(sample0);
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1);
sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1);
sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11151 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 8;
dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[7] = (Uint16) sample7;
dst[6] = (Uint16) sample6;
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U16MSB_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 11267 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_SwapBE16, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4;
const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint16 *target = ((const Uint16 *) cvt->buf);
Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
while (dst >= target) {
const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
src -= 8;
dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Uint16) sample7;
dst[6] = (Uint16) sample6;
dst[5] = (Uint16) sample5;
dst[4] = (Uint16) sample4;
dst[3] = (Uint16) sample3;
dst[2] = (Uint16) sample2;
dst[1] = (Uint16) sample1;
dst[0] = (Uint16) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_SwapBE16
#define SDL_SwapBE16(X)
Definition: SDL_endian.h:215
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
target
GLenum target
Definition: SDL_opengl_glext.h:1551
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
src
GLenum src
Definition: SDL_opengl_glext.h:1737

static void SDL_Upsample_U8_1c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2296 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 16;
const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
register int eps = 0;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Uint8 sample0 = src[0];
Uint8 last_sample0 = sample0;
while (dst >= target) {
dst[0] = sample0;
dst--;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src--;
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_1c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7099 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 2;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample0 = (Sint16) src[0];
src--;
dst[1] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[0] = (Uint8) sample0;
last_sample0 = sample0;
dst -= 2;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_1c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7152 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 4;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample0 = (Sint16) src[0];
src--;
dst[3] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
dst[0] = (Uint8) sample0;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_2c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2360 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 32;
const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
register int eps = 0;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Uint8 sample1 = src[1];
Uint8 sample0 = src[0];
Uint8 last_sample1 = sample1;
Uint8 last_sample0 = sample0;
while (dst >= target) {
dst[1] = sample1;
dst[0] = sample0;
dst -= 2;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 2;
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_2c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7207 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 2;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 2;
dst[3] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 4;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_2c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7269 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 4;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 2;
dst[7] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[6] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[3] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_4c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2434 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 64;
const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
register int eps = 0;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Uint8 sample3 = src[3];
Uint8 sample2 = src[2];
Uint8 sample1 = src[1];
Uint8 sample0 = src[0];
Uint8 last_sample3 = sample3;
Uint8 last_sample2 = sample2;
Uint8 last_sample1 = sample1;
Uint8 last_sample0 = sample0;
while (dst >= target) {
dst[3] = sample3;
dst[2] = sample2;
dst[1] = sample1;
dst[0] = sample0;
dst -= 4;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 4;
sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_4c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7335 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 2;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 4;
dst[7] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[6] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[3] = (Uint8) sample3;
dst[2] = (Uint8) sample2;
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 8;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_4c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7415 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 4;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 4;
dst[15] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
dst[14] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
dst[13] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[12] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[7] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
dst[6] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
dst[3] = (Uint8) sample3;
dst[2] = (Uint8) sample2;
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_6c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2528 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 96;
const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
register int eps = 0;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Uint8 sample5 = src[5];
Uint8 sample4 = src[4];
Uint8 sample3 = src[3];
Uint8 sample2 = src[2];
Uint8 sample1 = src[1];
Uint8 sample0 = src[0];
Uint8 last_sample5 = sample5;
Uint8 last_sample4 = sample4;
Uint8 last_sample3 = sample3;
Uint8 last_sample2 = sample2;
Uint8 last_sample1 = sample1;
Uint8 last_sample0 = sample0;
while (dst >= target) {
dst[5] = sample5;
dst[4] = sample4;
dst[3] = sample3;
dst[2] = sample2;
dst[1] = sample1;
dst[0] = sample0;
dst -= 6;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 6;
sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_6c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7503 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 2;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample5 = (Sint16) src[5];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample5 = (Sint16) src[5];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 6;
dst[11] = (Uint8) ((sample5 + last_sample5) >> 1);
dst[10] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[9] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[8] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[7] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[6] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[5] = (Uint8) sample5;
dst[4] = (Uint8) sample4;
dst[3] = (Uint8) sample3;
dst[2] = (Uint8) sample2;
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 12;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_6c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7601 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 4;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample5 = (Sint16) src[5];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample5 = (Sint16) src[5];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 6;
dst[23] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
dst[22] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
dst[21] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
dst[20] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
dst[19] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[18] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[17] = (Uint8) ((sample5 + last_sample5) >> 1);
dst[16] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[15] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[14] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[13] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[12] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[11] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
dst[10] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
dst[9] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
dst[8] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
dst[7] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
dst[6] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
dst[5] = (Uint8) sample5;
dst[4] = (Uint8) sample4;
dst[3] = (Uint8) sample3;
dst[2] = (Uint8) sample2;
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 24;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_8c | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 2642 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, SDL_AudioCVT::rate_incr, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr);
#endif
const int srcsize = cvt->len_cvt - 128;
const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
register int eps = 0;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Uint8 sample7 = src[7];
Uint8 sample6 = src[6];
Uint8 sample5 = src[5];
Uint8 sample4 = src[4];
Uint8 sample3 = src[3];
Uint8 sample2 = src[2];
Uint8 sample1 = src[1];
Uint8 sample0 = src[0];
Uint8 last_sample7 = sample7;
Uint8 last_sample6 = sample6;
Uint8 last_sample5 = sample5;
Uint8 last_sample4 = sample4;
Uint8 last_sample3 = sample3;
Uint8 last_sample2 = sample2;
Uint8 last_sample1 = sample1;
Uint8 last_sample0 = sample0;
while (dst >= target) {
dst[7] = sample7;
dst[6] = sample6;
dst[5] = sample5;
dst[4] = sample4;
dst[3] = sample3;
dst[2] = sample2;
dst[1] = sample1;
dst[0] = sample0;
dst -= 8;
eps += srcsize;
if ((eps << 1) >= dstsize) {
src -= 8;
sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1);
sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1);
sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
eps -= dstsize;
}
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
SDL_AudioCVT::rate_incr
double rate_incr
Definition: SDL_audio.h:205
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_8c_x2 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7711 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 2;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 2;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample7 = (Sint16) src[7];
Sint16 last_sample6 = (Sint16) src[6];
Sint16 last_sample5 = (Sint16) src[5];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample7 = (Sint16) src[7];
const Sint16 sample6 = (Sint16) src[6];
const Sint16 sample5 = (Sint16) src[5];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 8;
dst[15] = (Uint8) ((sample7 + last_sample7) >> 1);
dst[14] = (Uint8) ((sample6 + last_sample6) >> 1);
dst[13] = (Uint8) ((sample5 + last_sample5) >> 1);
dst[12] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[7] = (Uint8) sample7;
dst[6] = (Uint8) sample6;
dst[5] = (Uint8) sample5;
dst[4] = (Uint8) sample4;
dst[3] = (Uint8) sample3;
dst[2] = (Uint8) sample2;
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 16;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

static void SDL_Upsample_U8_8c_x4 | ( | SDL_AudioCVT * | cvt,
|  | SDL_AudioFormat | format
| ) |  |

static

Definition at line 7827 of file SDL_audiotypecvt.c.

References SDL_AudioCVT::buf, SDL_AudioCVT::filter_index, SDL_AudioCVT::filters, SDL_AudioCVT::len_cvt, and SDLCALL.

{
#if DEBUG_CONVERT
fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n");
#endif
const int dstsize = cvt->len_cvt * 4;
Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 4;
const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
const Uint8 *target = ((const Uint8 *) cvt->buf);
Sint16 last_sample7 = (Sint16) src[7];
Sint16 last_sample6 = (Sint16) src[6];
Sint16 last_sample5 = (Sint16) src[5];
Sint16 last_sample4 = (Sint16) src[4];
Sint16 last_sample3 = (Sint16) src[3];
Sint16 last_sample2 = (Sint16) src[2];
Sint16 last_sample1 = (Sint16) src[1];
Sint16 last_sample0 = (Sint16) src[0];
while (dst >= target) {
const Sint16 sample7 = (Sint16) src[7];
const Sint16 sample6 = (Sint16) src[6];
const Sint16 sample5 = (Sint16) src[5];
const Sint16 sample4 = (Sint16) src[4];
const Sint16 sample3 = (Sint16) src[3];
const Sint16 sample2 = (Sint16) src[2];
const Sint16 sample1 = (Sint16) src[1];
const Sint16 sample0 = (Sint16) src[0];
src -= 8;
dst[31] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2);
dst[30] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2);
dst[29] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
dst[28] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
dst[27] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
dst[26] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
dst[25] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
dst[24] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
dst[23] = (Uint8) ((sample7 + last_sample7) >> 1);
dst[22] = (Uint8) ((sample6 + last_sample6) >> 1);
dst[21] = (Uint8) ((sample5 + last_sample5) >> 1);
dst[20] = (Uint8) ((sample4 + last_sample4) >> 1);
dst[19] = (Uint8) ((sample3 + last_sample3) >> 1);
dst[18] = (Uint8) ((sample2 + last_sample2) >> 1);
dst[17] = (Uint8) ((sample1 + last_sample1) >> 1);
dst[16] = (Uint8) ((sample0 + last_sample0) >> 1);
dst[15] = (Uint8) (((3 * sample7) + last_sample7) >> 2);
dst[14] = (Uint8) (((3 * sample6) + last_sample6) >> 2);
dst[13] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
dst[12] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
dst[7] = (Uint8) sample7;
dst[6] = (Uint8) sample6;
dst[5] = (Uint8) sample5;
dst[4] = (Uint8) sample4;
dst[3] = (Uint8) sample3;
dst[2] = (Uint8) sample2;
dst[1] = (Uint8) sample1;
dst[0] = (Uint8) sample0;
last_sample7 = sample7;
last_sample6 = sample6;
last_sample5 = sample5;
last_sample4 = sample4;
last_sample3 = sample3;
last_sample2 = sample2;
last_sample1 = sample1;
last_sample0 = sample0;
dst -= 32;
}
cvt->len_cvt = dstsize;
if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index] (cvt, format);
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1565
SDL_AudioCVT::buf
Uint8 * buf
Definition: SDL_audio.h:206
SDL_AudioCVT::filter_index
int filter_index
Definition: SDL_audio.h:212
SDL_AudioCVT::filters
SDL_AudioFilter filters[10]
Definition: SDL_audio.h:211
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
target
GLenum target
Definition: SDL_opengl_glext.h:1551
SDL_AudioCVT::len_cvt
int len_cvt
Definition: SDL_audio.h:208
src
GLenum src
Definition: SDL_opengl_glext.h:1737
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143

## Variable Documentation

const SDL_AudioRateFilters sdl_audio_rate_filters[]

Definition at line 15702 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioResampleCVT().

const SDL_AudioTypeFilters sdl_audio_type_filters[]

Definition at line 2195 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVT().