Typedefs | |
typedef struct ReSampleContext | ReSampleContext |
Functions | |
ReSampleContext * | av_audio_resample_init (int output_channels, int input_channels, int output_rate, int input_rate, enum AVSampleFormat sample_fmt_out, enum AVSampleFormat sample_fmt_in, int filter_length, int log2_phase_count, int linear, double cutoff) |
Initialize audio resampling context. | |
int | audio_resample (ReSampleContext *s, short *output, short *input, int nb_samples) |
void | audio_resample_close (ReSampleContext *s) |
Free resample context. | |
struct AVResampleContext * | av_resample_init (int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff) |
Initialize an audio resampler. | |
int | av_resample (struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx) |
Resample an array of samples using a previously configured context. | |
void | av_resample_compensate (struct AVResampleContext *c, int sample_delta, int compensation_distance) |
Compensate samplerate/timestamp drift. | |
void | av_resample_close (struct AVResampleContext *c) |
typedef struct ReSampleContext ReSampleContext |
int audio_resample | ( | ReSampleContext * | s, | |
short * | output, | |||
short * | input, | |||
int | nb_samples | |||
) |
Definition at line 282 of file resample.c.
void audio_resample_close | ( | ReSampleContext * | s | ) |
Free resample context.
s | a non-NULL pointer to a resample context previously created with av_audio_resample_init() |
Definition at line 420 of file resample.c.
ReSampleContext* av_audio_resample_init | ( | int | output_channels, | |
int | input_channels, | |||
int | output_rate, | |||
int | input_rate, | |||
enum AVSampleFormat | sample_fmt_out, | |||
enum AVSampleFormat | sample_fmt_in, | |||
int | filter_length, | |||
int | log2_phase_count, | |||
int | linear, | |||
double | cutoff | |||
) |
Initialize audio resampling context.
output_channels | number of output channels | |
input_channels | number of input channels | |
output_rate | output sample rate | |
input_rate | input sample rate | |
sample_fmt_out | requested output sample format | |
sample_fmt_in | input sample format | |
filter_length | length of each FIR filter in the filterbank relative to the cutoff frequency | |
log2_phase_count | log2 of the number of entries in the polyphase filterbank | |
linear | if 1 then the used FIR filter will be linearly interpolated between the 2 closest, if 0 the closest will be used | |
cutoff | cutoff frequency, 1.0 corresponds to half the output sampling rate |
Definition at line 201 of file resample.c.
int av_resample | ( | struct AVResampleContext * | c, | |
short * | dst, | |||
short * | src, | |||
int * | consumed, | |||
int | src_size, | |||
int | dst_size, | |||
int | update_ctx | |||
) |
Resample an array of samples using a previously configured context.
src | an array of unconsumed samples | |
consumed | the number of samples of src which have been consumed are returned here | |
src_size | the number of unconsumed samples available | |
dst_size | the amount of space in samples available in dst | |
update_ctx | If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. |
Definition at line 236 of file resample2.c.
Referenced by audio_resample().
void av_resample_close | ( | struct AVResampleContext * | c | ) |
void av_resample_compensate | ( | struct AVResampleContext * | c, | |
int | sample_delta, | |||
int | compensation_distance | |||
) |
Compensate samplerate/timestamp drift.
The compensation is done by changing the resampler parameters, so no audible clicks or similar distortions occur
compensation_distance | distance in output samples over which the compensation should be performed | |
sample_delta | number of output samples which should be output less |
note, due to rounding the actual compensation might be slightly different, especially if the compensation_distance is large and the in_rate used during init is small
Definition at line 230 of file resample2.c.
Referenced by av_resample(), and swri_resample_TMPL().
struct AVResampleContext* av_resample_init | ( | int | out_rate, | |
int | in_rate, | |||
int | filter_length, | |||
int | log2_phase_count, | |||
int | linear, | |||
double | cutoff | |||
) | [read] |
Initialize an audio resampler.
Note, if either rate is not an integer then simply scale both rates up so they are.
filter_length | length of each FIR filter in the filterbank relative to the cutoff freq | |
log2_phase_count | log2 of the number of entries in the polyphase filterbank | |
linear | If 1 then the used FIR filter will be linearly interpolated between the 2 closest, if 0 the closest will be used | |
cutoff | cutoff frequency, 1.0 corresponds to half the output sampling rate |
Definition at line 191 of file resample2.c.
Referenced by av_audio_resample_init().