FFmpeg
4.0
|
#include "libavutil/samplefmt.h"
#include "avresample.h"
#include "internal.h"
#include "audio_data.h"
Go to the source code of this file.
Functions | |
void | ff_audio_convert_set_func (AudioConvert *ac, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int ptr_align, int samples_align, const char *descr, void *conv) |
Set conversion function if the parameters match. More... | |
AudioConvert * | ff_audio_convert_alloc (AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) |
Allocate and initialize AudioConvert context for sample format conversion. More... | |
void | ff_audio_convert_free (AudioConvert **ac) |
Free AudioConvert. More... | |
int | ff_audio_convert (AudioConvert *ac, AudioData *out, AudioData *in) |
Convert audio data from one sample format to another. More... | |
void | ff_audio_convert_init_aarch64 (AudioConvert *ac) |
void | ff_audio_convert_init_arm (AudioConvert *ac) |
void | ff_audio_convert_init_x86 (AudioConvert *ac) |
void ff_audio_convert_set_func | ( | AudioConvert * | ac, |
enum AVSampleFormat | out_fmt, | ||
enum AVSampleFormat | in_fmt, | ||
int | channels, | ||
int | ptr_align, | ||
int | samples_align, | ||
const char * | descr, | ||
void * | conv | ||
) |
Set conversion function if the parameters match.
This compares the parameters of the conversion function to the parameters in the AudioConvert context. If the parameters do not match, no changes are made to the active functions. If the parameters do match and the alignment is not constrained, the function is set as the generic conversion function. If the parameters match and the alignment is constrained, the function is set as the optimized conversion function.
ac | AudioConvert context |
out_fmt | output sample format |
in_fmt | input sample format |
channels | number of channels, or 0 for any number of channels |
ptr_align | buffer pointer alignment, in bytes |
samples_align | buffer size alignment, in samples |
descr | function type description (e.g. "C" or "SSE") |
conv | conversion function pointer |
Definition at line 70 of file audio_convert.c.
Referenced by ff_audio_convert_init_aarch64(), ff_audio_convert_init_arm(), and ff_audio_convert_init_x86().
AudioConvert* ff_audio_convert_alloc | ( | AVAudioResampleContext * | avr, |
enum AVSampleFormat | out_fmt, | ||
enum AVSampleFormat | in_fmt, | ||
int | channels, | ||
int | sample_rate, | ||
int | apply_map | ||
) |
Allocate and initialize AudioConvert context for sample format conversion.
avr | AVAudioResampleContext |
out_fmt | output sample format |
in_fmt | input sample format |
channels | number of channels |
sample_rate | sample rate (used for dithering) |
apply_map | apply channel map during conversion |
Referenced by avresample_open(), and ff_dither_alloc().
void ff_audio_convert_free | ( | AudioConvert ** | ac | ) |
Free AudioConvert.
The AudioConvert must have been previously allocated with ff_audio_convert_alloc().
ac | AudioConvert struct |
Referenced by avresample_close(), and ff_dither_free().
int ff_audio_convert | ( | AudioConvert * | ac, |
AudioData * | out, | ||
AudioData * | in | ||
) |
Convert audio data from one sample format to another.
For each call, the alignment of the input and output AudioData buffers are examined to determine whether to use the generic or optimized conversion function (when available).
The number of samples to convert is determined by in->nb_samples. The output buffer must be large enough to handle this many samples. out->nb_samples is set by this function before a successful return.
ac | AudioConvert context |
out | output audio data |
in | input audio data |
Referenced by avresample_convert(), and ff_convert_dither().
void ff_audio_convert_init_aarch64 | ( | AudioConvert * | ac | ) |
Definition at line 34 of file audio_convert_init.c.
void ff_audio_convert_init_arm | ( | AudioConvert * | ac | ) |
Definition at line 34 of file audio_convert_init.c.
void ff_audio_convert_init_x86 | ( | AudioConvert * | ac | ) |
Definition at line 146 of file audio_convert_init.c.