21 #ifndef SWRESAMPLE_SWRESAMPLE_H 22 #define SWRESAMPLE_SWRESAMPLE_H 125 #include "libavutil/samplefmt.h" 136 #define SWR_FLAG_RESAMPLE 1 137 //TODO use int resample ? 143 SWR_DITHER_RECTANGULAR,
144 SWR_DITHER_TRIANGULAR,
145 SWR_DITHER_TRIANGULAR_HIGHPASS,
148 SWR_DITHER_NS_LIPSHITZ,
149 SWR_DITHER_NS_F_WEIGHTED,
150 SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
151 SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
152 SWR_DITHER_NS_SHIBATA,
153 SWR_DITHER_NS_LOW_SHIBATA,
154 SWR_DITHER_NS_HIGH_SHIBATA,
253 int log_offset,
void *
log_ctx);
307 const uint8_t **
in ,
int in_count);
389 double center_mix_level,
double surround_mix_level,
void swr_close(struct SwrContext *s)
Closes the context so that swr_is_initialized() returns 0.
Definition: swresample.c:148
int out_sample_rate
output sample rate
Definition: swresample_internal.h:105
This structure describes decoded (raw) audio or video data.
Definition: frame.h:218
SoX Resampler.
Definition: swresample.h:161
SwrFilterType
Resampling Filter Types.
Definition: swresample.h:166
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...
Definition: swresample.c:909
int swr_build_matrix(uint64_t in_layout, uint64_t out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double rematrix_maxval, double rematrix_volume, double *matrix, int stride, enum AVMatrixEncoding matrix_encoding, void *log_ctx)
Generate a channel mixing matrix.
Definition: rematrix.c:119
const int * channel_map
channel index (or -1 if muted channel) map
Definition: swresample_internal.h:113
int swr_get_out_samples(struct SwrContext *s, int in_samples)
Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples.
Definition: swresample.c:867
int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance)
Activate resampling compensation ("soft" compensation).
Definition: swresample.c:889
struct SwrContext * swr_alloc(void)
Allocate SwrContext.
Definition: options.c:149
SwrDitherType
Dithering algorithms.
Definition: swresample.h:141
void * log_ctx
parent logging context
Definition: swresample_internal.h:98
AudioData out
converted output audio data
Definition: swresample_internal.h:152
AudioData in
input audio data
Definition: swresample_internal.h:148
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in, int in_count)
Convert audio.
Kaiser windowed sinc.
Definition: swresample.h:169
enum AVSampleFormat out_sample_fmt
output sample format
Definition: swresample_internal.h:101
SwrEngine
Resampling Engines.
Definition: swresample.h:159
Blackman Nuttall windowed sinc.
Definition: swresample.h:168
int matrix_encoding
matrixed stereo encoding
Definition: swresample_internal.h:112
Definition: swresample_internal.h:95
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.
Definition: swresample.c:859
not part of API/ABI
Definition: swresample.h:162
reference-counted frame API
not part of API/ABI
Definition: swresample.h:155
audio channel layout utility functions
int swr_drop_output(struct SwrContext *s, int count)
Drops the specified number of output samples.
Definition: swresample.c:820
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
Set a customized remix matrix.
Definition: rematrix.c:64
int64_t out_ch_layout
output channel layout
Definition: swresample_internal.h:103
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.
Definition: swresample.c:59
not part of API/ABI
Definition: swresample.h:147
int in_sample_rate
input sample rate
Definition: swresample_internal.h:104
const AVClass * swr_get_class(void)
Get the AVClass for SwrContext.
Definition: options.c:144
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
void swr_free(struct SwrContext **s)
Free the given SwrContext and set the pointer to NULL.
Definition: swresample.c:137
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
Set a customized input channel mapping.
Definition: swresample.c:52
Describe the class of an AVClass context structure.
Definition: log.h:67
const char * swresample_license(void)
Return the swr license.
Definition: swresample.c:46
enum AVSampleFormat in_sample_fmt
input sample format
Definition: swresample_internal.h:99
Libswresample version macros.
Cubic.
Definition: swresample.h:167
double matrix[SWR_CH_MAX][SWR_CH_MAX]
floating point rematrixing coefficients
Definition: swresample_internal.h:171
SW Resampler.
Definition: swresample.h:160
int64_t in_ch_layout
input channel layout
Definition: swresample_internal.h:102
int swr_convert_frame(SwrContext *swr, AVFrame *output, const AVFrame *input)
Convert the samples in the input AVFrame and write them to the output AVFrame.
Definition: swresample_frame.c:123
float lfe_mix_level
LFE mixing level.
Definition: swresample_internal.h:109
int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in)
Configure or reconfigure the SwrContext using the information provided by the AVFrames.
Definition: swresample_frame.c:26
unsigned swresample_version(void)
Return the LIBSWRESAMPLE_VERSION_INT constant.
Definition: swresample.c:35
float rematrix_maxval
maximum value for rematrixing output
Definition: swresample_internal.h:111
float rematrix_volume
rematrixing volume coefficient
Definition: swresample_internal.h:110
int swr_is_initialized(struct SwrContext *s)
Check whether an swr context has been initialized or not.
Definition: swresample.c:702
const char * swresample_configuration(void)
Return the swr build-time configuration.
Definition: swresample.c:41
int swr_inject_silence(struct SwrContext *s, int count)
Injects the specified number of silence samples.
Definition: swresample.c:831
int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
Definition: swresample.c:152