一、函数
废弃:使用 libswresample代替
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) |
参数:output_channels:输出通道数
input_channels:输入通道数
output_rate:输出采样率
input_rate:输入采样率
sample_fmt_out:请求输出示例格式
sample_fmt_in:输入样品格式
filter_length:滤波器组中每个FIR滤波器的长度相对于截止频率
log2_phase_count:log2的多相滤波器组中的条目数
linear:如果1,则所使用的FIR滤波器将在最接近的2之间进行线性内插,如果0将最接近使用
cutoff:截止频率,1.0对应于输出采样率的一半
返回:分配的ReSampleContext,如果发生错误则为NULL
attribute_deprecated int | audio_resample (ReSampleContext *s, short *output, short *input, int nb_samples) |
attribute_deprecated void | audio_resample_close (ReSampleContext *s) |
参数:s:前一个使用av_audio_resample_init()创建的重新抽样上下文的非NULL指针
attribute_deprecated struct AVResampleContext * | av_resample_init (int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff) |
注意,如果任一速率不是一个整数,那么简单地将这两个速率缩放到一起就可以了。
参数:filter_length:滤波器组中每个FIR滤波器的长度相对于截止频率
log2_phase_count:log2的多相滤波器组中的条目数
linear:如果1,则所使用的FIR滤波器将在最接近的2之间被线性内插,如果0将被使用最接近的
cutoff:截止频率,1.0对应于输出采样率的一半
attribute_deprecated int | av_resample (struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx) |
参数:src:一系列未消耗的样品
consumed:已经在这里返回已经消耗的src的样本数
src_size:未使用样品的数量
dst_size:dst中可用样本的空间量
update_ctx:如果这是0,那么上下文将不会被修改,这样几个通道可以用相同的上下文重新采样。
返回:如果发生错误,以dst或-1写入的样本数
attribute_deprecated void | av_resample_compensate (struct AVResampleContext *c, int sample_delta, int compensation_distance) |
补偿通过更改重新采样器参数来完成,因此不会发生可听到的点击或类似的失真
参数:sample_delta:应在其上进行补偿的输出样本中的距离
compensation_distance:应输出的输出样本数量较少
示例:av_resample_compensate(c,10,500)而不是510样本,只输出500个样本
注意,由于四舍五入,实际补偿可能略有不同,特别是如果补偿距离大,init中使用的in_rate小
attribute_deprecated void | av_resample_close (struct AVResampleContext *c) |