21 #include "libavutil/opt.h"
24 #include "libavutil/avassert.h"
25 #include "libavutil/channel_layout.h"
30 #define C15DB 1.189207115
32 #define C_15DB 0.840896415
33 #define C_30DB M_SQRT1_2
34 #define C_45DB 0.594603558
40 #define OFFSET(x) offsetof(SwrContext,x)
41 #define PARAM AV_OPT_FLAG_AUDIO_PARAM
102 {
"precision" ,
"set soxr resampling precision (in bits)"
104 {
"cheby" ,
"enable soxr Chebyshev passband & higher-precision irrational ratio approximation"
106 {
"min_comp" ,
"set minimum difference between timestamps and audio data (in seconds) below which no timestamp compensation of either kind is applied"
108 {
"min_hard_comp" ,
"set minimum difference between timestamps and audio data (in seconds) to trigger padding/trimming the data."
110 {
"comp_duration" ,
"set duration (in seconds) over which data is stretched/squeezed to make it match the timestamps."
112 {
"max_soft_comp" ,
"set maximum factor by which data is stretched/squeezed to make it match the timestamps."
114 {
"async" ,
"simplified 1 parameter audio timestamp matching, 0(disabled), 1(filling and trimming), >1(maximum stretch/squeeze in samples per second)"
116 {
"first_pts" ,
"Assume the first pts should be this value (in samples)."
162 #define LICENSE_PREFIX "libswresample license: "
190 int log_offset,
void *
log_ctx){
218 memset(a, 0,
sizeof(*a));
256 memset(s->
in.
ch, 0,
sizeof(s->
in.
ch));
286 extern struct Resampler const soxr_resampler;
299 av_log(s,
AV_LOG_WARNING,
"Input channel layout has a different number of channels than the number of used channels, ignoring layout\n");
303 if(!s-> in_ch_layout)
349 if (s->
async > 1.0001) {
355 s->
resample = s->
resampler->
init(s->
resample, s->
out_sample_rate, s->
in_sample_rate, s->
filter_size, s->
phase_shift, s->
linear_interp, s->
cutoff, s->
int_sample_fmt, s->
filter_type, s->
kaiser_beta, s->
precision, s->
cheby);
367 #define RSC 1 //FIXME finetune
375 if(!s->
in.ch_count){
382 char l1[1024], l2[1024];
386 "but there is not enough information to do it\n", l1, l2);
400 s-> in_sample_fmt, s->
in.ch_count, NULL, 0);
449 if(count < 0 || count > INT_MAX/2/a->
bps/a->
ch_count)
452 if(a->
count >= count)
485 memcpy(out->
ch[ch], in->
ch[ch], count*out->
bps);
493 memset(out->
ch, 0,
sizeof(out->
ch));
496 out->
ch[i]= in_arg[i];
499 out->
ch[i]= in_arg[0] + i*out->
bps;
507 in_arg[i]= out->
ch[i];
509 in_arg[0]= out->
ch[0];
521 out->
ch[ch]= in->
ch[ch] + count*out->
bps;
523 for(ch=out->
ch_count-1; ch>=0; ch--)
533 const AudioData * in_param,
int in_count){
573 in_count -= consumed;
593 copy(&tmp, &in, count);
658 out_count=
FFMIN(out_count, in_count);
660 copy(out, in, out_count);
663 else if(preout==postin) preout= midbuf= postin=
out;
664 else if(preout==midbuf) preout= midbuf=
out;
674 out_count=
resample(s, midbuf, out_count, postin, in_count);
681 out_count=
resample(s, preout, out_count, midbuf, in_count);
684 if(preout != out && out_count){
688 int dither_count=
FFMAX(out_count, 1<<16);
708 int len1= out_count&~15;
709 int off = len1 * preout->
bps;
712 for(ch=0; ch<preout->
ch_count; ch++)
714 if(out_count != len1)
715 for(ch=0; ch<preout->
ch_count; ch++)
718 for(ch=0; ch<preout->
ch_count; ch++)
738 const uint8_t *in_arg [SWR_CH_MAX],
int in_count){
745 #define MAX_DROP_STEP 16384
804 if(in_count > out_count) {
816 size =
FFMIN(in_count, out_count);
826 copy(&tmp, in, in_count);
853 #define MAX_SILENCE_STEP 16384
885 if (!s || compensation_distance < 0)
887 if (!compensation_distance && sample_delta)
926 int comp = av_clipf(fdelta, -max_soft_compensation, max_soft_compensation) *
duration ;
927 av_log(s,
AV_LOG_VERBOSE,
"compensating audio timestamp drift:%f compensation:%d in:%d\n", fdelta, comp, duration);
struct AudioConvert * in_convert
input conversion context
const AVClass * av_class
AVClass used for AVOption and av_log()
struct AudioConvert * full_convert
full conversion context (single conversion for input and output)
AudioData temp
temporary storage when writing into the input buffer isnt possible
int out_sample_rate
output sample rate
enum SwrFilterType filter_type
swr resampling filter type
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
enum AVSampleFormat int_sample_fmt
internal sample format (AV_SAMPLE_FMT_FLTP or AV_SAMPLE_FMT_S16P)
Audio buffer used for intermediate storage between conversion phases.
enum AVResampleDitherMethod method
multiple_resample_func multiple_resample
#define AV_LOG_WARNING
Something somehow does not look correct.
Number of sample formats. DO NOT USE if linking dynamically.
#define LIBAVUTIL_VERSION_INT
int count
number of samples
struct SwrContext * swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)
Allocate SwrContext if needed and set/reset common parameters.
int ch_count
number of channels
void swri_audio_convert_free(AudioConvert **ctx)
Free audio sample format converter context.
float soft_compensation_duration
swr duration over which soft compensation is applied
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
int rematrix_custom
flag to indicate that a custom matrix has been defined
int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int in_buffer_index
cached buffer position
int64_t swr_next_pts(struct SwrContext *s, int64_t pts)
Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...
AudioData in_buffer
cached audio data (convert and resample purpose)
int resample_in_constraint
1 if the input end was reach before the output end, 0 otherwise
struct ResampleContext * resample
resampling context
struct SwrContext * swr_alloc(void)
Allocate SwrContext.
static void reversefill_audiodata(AudioData *out, uint8_t *in_arg[SWR_CH_MAX])
float async
swr simple 1 parameter async, similar to ffmpegs -async
const char * swresample_license(void)
Return the swr license.
const int * channel_map
channel index (or -1 if muted channel) map
enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt)
Get the planar alternative form of the given sample format.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int log_level_offset
logging level offset
struct Resampler const * resampler
resampler virtual function table
int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance)
Activate resampling compensation.
av_cold int swri_rematrix_init(SwrContext *s)
float max_soft_compensation
swr maximum soft compensation in seconds over soft_compensation_duration
AudioConvert * swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, int flags)
Create an audio sample format converter context.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
enum AVSampleFormat fmt
sample format
void * log_ctx
parent logging context
AudioData out
converted output audio data
int swri_realloc_audio(AudioData *a, int count)
int phase_shift
log2 of the number of entries in the resampling polyphase filterbank
AudioData in
input audio data
uint8_t * native_simd_one
float min_hard_compensation
swr minimum below which no silence inject / sample drop will happen
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in, int in_count)
Convert audio.
struct Resampler const swri_resampler
#define AV_LOG_VERBOSE
Detailed information.
enum AVSampleFormat out_sample_fmt
output sample format
const OptionDef options[]
int in_buffer_count
cached buffer length
AudioData postin
post-input audio data: used for rematrix/resample
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Blackman Nuttall Windowed Sinc.
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=av_sample_fmt_is_planar(in_fmt);out_planar=av_sample_fmt_is_planar(out_fmt);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);ff_audio_convert_init_arm(ac);ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_dlog(ac->avr,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
float slev
surround mixing level
int output_sample_bits
the number of used output bits, needed to scale dither correctly
static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_count, AudioData *in, int in_count)
double cutoff
resampling cutoff frequency (swr: 6dB point; soxr: 0dB point).
static const uint8_t dither[8][8]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static void buf_set(AudioData *out, AudioData *in, int count)
out may be equal in.
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
float clev
center mixing level
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
int64_t swr_get_delay(struct SwrContext *s, int64_t base)
Gets the delay the next input sample will experience relative to the next output sample.
mix_2_1_func_type * mix_2_1_simd
resample_flush_func flush
#define LIBSWRESAMPLE_VERSION_INT
#define LIBSWRESAMPLE_VERSION_MICRO
int64_t firstpts
first PTS
AudioData preout
pre-output audio data: used for rematrix/resample
#define SWR_FLAG_RESAMPLE
Force resampling even if equal sample rate.
AudioData midbuf
intermediate audio data (postin/preout)
int flags
miscellaneous flags such as SWR_FLAG_RESAMPLE
static const char * context_to_name(void *ptr)
static void free_temp(AudioData *a)
void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt)
int swr_drop_output(struct SwrContext *s, int count)
Drops the specified number of output samples.
int drop_output
number of output samples to drop
int linear_interp
if 1 then the resampling FIR filter will be linearly interpolated
void swri_noise_shaping_int32(SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count)
double precision
soxr resampling precision (in bits)
AudioData noise
noise used for dithering
int64_t out_ch_layout
output channel layout
enum AVMatrixEncoding matrix_encoding
matrixed stereo encoding
int in_sample_rate
input sample rate
int rematrix
flag to indicate if rematrixing is needed (basically if input and output layouts mismatch) ...
set_compensation_func set_compensation
static void copy(AudioData *out, AudioData *in, int count)
void swri_noise_shaping_double(SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count)
AVSampleFormat
Audio Sample Formats.
int filter_size
length of each FIR filter in the resampling filterbank relative to the cutoff frequency ...
uint8_t * data[AVRESAMPLE_MAX_CHANNELS]
data plane pointers
void swr_free(struct SwrContext **s)
Free the given SwrContext and set the pointer to NULL.
float min_compensation
swr minimum below which no compensation will happen
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
Set a customized input channel mapping.
Describe the class of an AVClass context structure.
struct DitherContext dither
void swri_noise_shaping_float(SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count)
static void fill_audiodata(AudioData *out, uint8_t *in_arg[SWR_CH_MAX])
static int resample(SwrContext *s, AudioData *out_param, int out_count, const AudioData *in_param, int in_count)
enum AVSampleFormat in_sample_fmt
input sample format
Audio format conversion routines.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int flushed
1 if data is to be flushed and no further input is expected
static const AVClass av_class
int64_t in_ch_layout
input channel layout
#define SWR_CH_MAX
Maximum number of channels.
int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt)
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
int cheby
soxr: if 1 then passband rolloff will be none (Chebyshev) & irrational ratio approximation precision ...
float lfe_mix_level
LFE mixing level.
#define FFMPEG_CONFIGURATION
const char * swresample_configuration(void)
Return the swr build-time configuration.
void swri_noise_shaping_int16(SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count)
int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len)
Convert between audio sample formats.
unsigned swresample_version(void)
Return the LIBSWRESAMPLE_VERSION_INT constant.
av_cold void swri_rematrix_free(SwrContext *s)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=av_sample_fmt_is_planar(in_fmt);out_planar=av_sample_fmt_is_planar(out_fmt);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);ff_audio_convert_init_arm(ac);ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_dlog(ac->avr,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
float rematrix_maxval
maximum value for rematrixing output
struct AudioConvert * out_convert
output conversion context
float rematrix_volume
rematrixing volume coefficient
static void set_audiodata_fmt(AudioData *a, enum AVSampleFormat fmt)
int kaiser_beta
swr beta value for Kaiser window (only applicable if filter_type == AV_FILTER_TYPE_KAISER) ...
mix_2_1_func_type * mix_2_1_f
int64_t firstpts_in_samples
swr first pts in samples
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
int planar
1 if planar audio, 0 otherwise
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AudioData drop_temp
temporary used to discard output
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
const AVClass * swr_get_class(void)
Get the AVClass for swrContext.
uint8_t * ch[SWR_CH_MAX]
samples buffer per channel
int used_ch_count
number of used input channels (mapped channel count if channel_map, otherwise in.ch_count) ...
int swr_inject_silence(struct SwrContext *s, int count)
Injects the specified number of silence samples.
#define AV_NOPTS_VALUE
Undefined timestamp value.
AudioData silence
temporary with silence
int resample_first
1 if resampling must come first, 0 if rematrixing
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout)
Return a description of a channel layout.
struct Resampler const soxr_resampler
int64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.