FFmpeg
|
Functions | |
attribute_deprecated 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. More... | |
attribute_deprecated int | audio_resample (ReSampleContext *s, short *output, short *input, int nb_samples) |
attribute_deprecated void | audio_resample_close (ReSampleContext *s) |
Free resample context. More... | |
attribute_deprecated 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. More... | |
attribute_deprecated 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. More... | |
attribute_deprecated void | av_resample_compensate (struct AVResampleContext *c, int sample_delta, int compensation_distance) |
Compensate samplerate/timestamp drift. More... | |
attribute_deprecated void | av_resample_close (struct AVResampleContext *c) |
attribute_deprecated 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 203 of file resample.c.
attribute_deprecated int audio_resample | ( | ReSampleContext * | s, |
short * | output, | ||
short * | input, | ||
int | nb_samples | ||
) |
Definition at line 284 of file resample.c.
attribute_deprecated 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 430 of file resample.c.
attribute_deprecated 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.
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 192 of file resample2.c.
Referenced by av_audio_resample_init().
attribute_deprecated 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 237 of file resample2.c.
Referenced by audio_resample().
attribute_deprecated 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 |
example: av_resample_compensate(c, 10, 500) here instead of 510 samples only 500 samples would be output
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 231 of file resample2.c.
attribute_deprecated void av_resample_close | ( | struct AVResampleContext * | c | ) |
Definition at line 226 of file resample2.c.
Referenced by audio_resample_close().