Go to the source code of this file.
|
static int | psrc_set_converter (SRC_PRIVATE *psrc, int converter_type) |
|
SRC_STATE * | src_new (int converter_type, int channels, int *error) |
|
SRC_STATE * | src_callback_new (src_callback_t func, int converter_type, int channels, int *error, void *cb_data) |
|
SRC_STATE * | src_delete (SRC_STATE *state) |
|
int | src_process (SRC_STATE *state, SRC_DATA *data) |
|
long | src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) |
|
int | src_set_ratio (SRC_STATE *state, double new_ratio) |
|
int | src_get_channels (SRC_STATE *state) |
|
int | src_reset (SRC_STATE *state) |
|
const char * | src_get_name (int converter_type) |
|
const char * | src_get_description (int converter_type) |
|
const char * | src_get_version (void) |
|
int | src_is_valid_ratio (double ratio) |
|
int | src_error (SRC_STATE *state) |
|
const char * | src_strerror (int error) |
|
int | src_simple (SRC_DATA *src_data, int converter, int channels) |
|
void | src_short_to_float_array (const short *in, float *out, int len) |
|
void | src_float_to_short_array (const float *in, short *out, int len) |
|
void | src_int_to_float_array (const int *in, float *out, int len) |
|
void | src_float_to_int_array (const float *in, int *out, int len) |
|
◆ psrc_set_converter()
Definition at line 519 of file samplerate.c.
int sinc_set_converter(SRC_PRIVATE *psrc, int src_enum)
int zoh_set_converter(SRC_PRIVATE *psrc, int src_enum)
int linear_set_converter(SRC_PRIVATE *psrc, int src_enum)
Referenced by src_new().
◆ src_callback_new()
Definition at line 49 of file samplerate.c.
68 ((
SRC_PRIVATE*) src_state)->user_callback_data = cb_data ;
SRC_STATE * src_new(int converter_type, int channels, int *error)
struct SRC_STATE_tag SRC_STATE
int src_reset(SRC_STATE *state)
◆ src_callback_read()
Definition at line 153 of file samplerate.c.
157 long output_frames_gen ;
178 memset (&src_data, 0,
sizeof (src_data)) ;
194 output_frames_gen = 0 ;
195 while (output_frames_gen < frames)
243 return output_frames_gen ;
src_callback_t callback_func
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void * user_callback_data
int src_process(SRC_STATE *state, SRC_DATA *data)
static int is_bad_src_ratio(double ratio)
◆ src_delete()
◆ src_error()
◆ src_float_to_int_array()
Definition at line 493 of file samplerate.c.
494 {
double scaled_value ;
499 scaled_value =
in [
len] * (8.0 * 0x10000000) ;
501 {
out [
len] = 0x7fffffff ;
505 {
out [
len] = -1 - 0x7fffffff ;
#define CPU_CLIPS_POSITIVE
_Check_return_ __CRT_INLINE long lrint(_In_ double x)
#define CPU_CLIPS_NEGATIVE
Referenced by PerformSampleRateConversion().
◆ src_float_to_short_array()
Definition at line 460 of file samplerate.c.
461 {
double scaled_value ;
466 scaled_value =
in [
len] * (8.0 * 0x10000000) ;
#define CPU_CLIPS_POSITIVE
_Check_return_ __CRT_INLINE long lrint(_In_ double x)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
#define CPU_CLIPS_NEGATIVE
Referenced by PerformSampleRateConversion().
◆ src_get_channels()
Definition at line 269 of file samplerate.c.
int(* vari_process)(struct SRC_PRIVATE_tag *psrc, SRC_DATA *data)
int(* const_process)(struct SRC_PRIVATE_tag *psrc, SRC_DATA *data)
◆ src_get_description()
Definition at line 324 of file samplerate.c.
const char * linear_get_description(int src_enum)
static const WCHAR desc[]
const char * sinc_get_description(int src_enum)
const char * zoh_get_description(int src_enum)
◆ src_get_name()
Definition at line 308 of file samplerate.c.
static const WCHAR desc[]
const char * linear_get_name(int src_enum)
const char * zoh_get_name(int src_enum)
const char * sinc_get_name(int src_enum)
◆ src_get_version()
◆ src_int_to_float_array()
◆ src_is_valid_ratio()
Definition at line 345 of file samplerate.c.
static int is_bad_src_ratio(double ratio)
◆ src_new()
◆ src_process()
Definition at line 89 of file samplerate.c.
115 if (
data->input_frames < 0)
116 data->input_frames = 0 ;
117 if (
data->output_frames < 0)
118 data->output_frames = 0 ;
136 data->input_frames_used = 0 ;
137 data->output_frames_gen = 0 ;
int(* vari_process)(struct SRC_PRIVATE_tag *psrc, SRC_DATA *data)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
int(* const_process)(struct SRC_PRIVATE_tag *psrc, SRC_DATA *data)
static int is_bad_src_ratio(double ratio)
Referenced by PerformSampleRateConversion(), src_callback_read(), and src_simple().
◆ src_reset()
◆ src_set_ratio()
Definition at line 250 of file samplerate.c.
int(* vari_process)(struct SRC_PRIVATE_tag *psrc, SRC_DATA *data)
int(* const_process)(struct SRC_PRIVATE_tag *psrc, SRC_DATA *data)
static int is_bad_src_ratio(double ratio)
◆ src_short_to_float_array()
◆ src_simple()
Definition at line 432 of file samplerate.c.
SRC_STATE * src_new(int converter_type, int channels, int *error)
struct SRC_STATE_tag SRC_STATE
SRC_STATE * src_delete(SRC_STATE *state)
int src_process(SRC_STATE *state, SRC_DATA *data)
◆ src_strerror()
Definition at line 365 of file samplerate.c.
371 return "Malloc failed." ;
373 return "SRC_STATE pointer is NULL." ;
375 return "SRC_DATA pointer is NULL." ;
377 return "SRC_DATA->data_out or SRC_DATA->data_in is NULL." ;
379 return "Internal error. No private data." ;
385 return "src_process() called without reset after end_of_input." ;
387 return "Internal error. No process pointer." ;
389 return "Internal error. SHIFT_BITS too large." ;
391 return "Internal error. Filter length too large." ;
393 return "Bad converter number." ;
395 return "Channel count must be >= 1." ;
397 return "Internal error. Bad buffer length. Please report this." ;
399 return "Internal error. Input data / internal buffer size difference. Please report this." ;
401 return "Internal error. Private pointer is NULL. Please report this." ;
403 return "Input and output data arrays overlap." ;
405 return "Supplied callback function pointer is NULL." ;
407 return "Calling mode differs from initialisation mode (ie process v callback)." ;
409 return "Callback function pointer is NULL in src_callback_read ()." ;
411 return "This converter only allows constant conversion ratios." ;
413 return "Internal error : Bad length in prepare_data ()." ;
415 return "Error : Someone is trampling on my internal state." ;
418 return "Placeholder. No error defined for this error number." ;
#define SRC_MAX_RATIO_STR