audio resampling More...
Go to the source code of this file.
Data Structures | |
struct | ResampleContext |
Defines | |
#define | FILTER_SHIFT 15 |
#define | FELEM int16_t |
#define | FELEM2 int32_t |
#define | FELEML int64_t |
#define | FELEM_MAX INT16_MAX |
#define | FELEM_MIN INT16_MIN |
#define | WINDOW_TYPE 9 |
Typedefs | |
typedef struct ResampleContext | ResampleContext |
Functions | |
static double | bessel (double x) |
0th order modified bessel function of the first kind. | |
static int | build_filter (FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type) |
builds a polyphase filterbank. | |
ResampleContext * | swri_resample_init (ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff) |
void | swri_resample_free (ResampleContext **c) |
int | swr_set_compensation (struct SwrContext *s, int sample_delta, int compensation_distance) |
Activate resampling compensation. | |
int | swri_resample (ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx) |
int | swri_multiple_resample (ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed) |
audio resampling
Definition in file resample.c.
#define FELEM int16_t |
Definition at line 34 of file resample.c.
Referenced by swri_resample(), and swri_resample_init().
#define FELEM2 int32_t |
Definition at line 35 of file resample.c.
Referenced by swri_resample().
#define FELEM_MAX INT16_MAX |
Definition at line 37 of file resample.c.
Referenced by build_filter().
#define FELEM_MIN INT16_MIN |
Definition at line 38 of file resample.c.
Referenced by build_filter().
#define FELEML int64_t |
Definition at line 36 of file resample.c.
Referenced by swri_resample().
#define FILTER_SHIFT 15 |
Definition at line 32 of file resample.c.
Referenced by build_filter(), swri_resample(), and swri_resample_init().
#define WINDOW_TYPE 9 |
Definition at line 39 of file resample.c.
Referenced by swri_resample_init().
typedef struct ResampleContext ResampleContext |
static double bessel | ( | double | x | ) | [static] |
0th order modified bessel function of the first kind.
Definition at line 78 of file resample.c.
Referenced by build_filter().
static int build_filter | ( | FELEM * | filter, |
double | factor, | ||
int | tap_count, | ||
int | phase_count, | ||
int | scale, | ||
int | type | ||
) | [static] |
builds a polyphase filterbank.
factor | resampling factor |
scale | wanted sum of coefficients for each filter |
type | 0->cubic, 1->blackman nuttall windowed sinc, 2..16->kaiser windowed sinc beta=2..16 |
Definition at line 112 of file resample.c.
Referenced by swri_resample_init().
int swr_set_compensation | ( | struct SwrContext * | s, |
int | sample_delta, | ||
int | compensation_distance | ||
) |
Activate resampling compensation.
Definition at line 248 of file resample.c.
Referenced by audio_decode_frame(), and do_audio_out().
int swri_multiple_resample | ( | ResampleContext * | c, |
AudioData * | dst, | ||
int | dst_size, | ||
AudioData * | src, | ||
int | src_size, | ||
int * | consumed | ||
) |
Definition at line 360 of file resample.c.
Referenced by resample().
int swri_resample | ( | ResampleContext * | c, |
int16_t * | dst, | ||
const int16_t * | src, | ||
int * | consumed, | ||
int | src_size, | ||
int | dst_size, | ||
int | update_ctx | ||
) |
Definition at line 271 of file resample.c.
Referenced by swri_multiple_resample().
void swri_resample_free | ( | ResampleContext ** | c | ) |
Definition at line 241 of file resample.c.
Referenced by swr_free(), and swr_init().
ResampleContext* swri_resample_init | ( | ResampleContext * | c, |
int | out_rate, | ||
int | in_rate, | ||
int | filter_size, | ||
int | phase_shift, | ||
int | linear, | ||
double | cutoff | ||
) | [read] |
Definition at line 202 of file resample.c.
Referenced by swr_init().