FFmpeg
Loading...
Searching...
No Matches
swresample.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
3 *
4 * This file is part of libswresample
5 *
6 * libswresample is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * libswresample is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with libswresample; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef SWRESAMPLE_SWRESAMPLE_H
22#define SWRESAMPLE_SWRESAMPLE_H
23
24/**
25 * @file
26 * @ingroup lswr
27 * libswresample public header
28 */
29
30/**
31 * @defgroup lswr libswresample
32 * @{
33 *
34 * Audio resampling, sample format conversion and mixing library.
35 *
36 * Interaction with lswr is done through SwrContext, which is
37 * allocated with swr_alloc() or swr_alloc_set_opts2(). It is opaque, so all parameters
38 * must be set with the @ref avoptions API.
39 *
40 * The first thing you will need to do in order to use lswr is to allocate
41 * SwrContext. This can be done with swr_alloc() or swr_alloc_set_opts2(). If you
42 * are using the former, you must set options through the @ref avoptions API.
43 * The latter function provides the same feature, but it allows you to set some
44 * common options in the same statement.
45 *
46 * For example the following code will setup conversion from planar float sample
47 * format to interleaved signed 16-bit integer, downsampling from 48kHz to
48 * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
49 * matrix). This is using the swr_alloc() function.
50 * @code
51 * SwrContext *swr = swr_alloc();
52 * av_opt_set_chlayout(swr, "in_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1, 0);
53 * av_opt_set_chlayout(swr, "out_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, 0);
54 * av_opt_set_int(swr, "in_sample_rate", 48000, 0);
55 * av_opt_set_int(swr, "out_sample_rate", 44100, 0);
56 * av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
57 * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
58 * @endcode
59 *
60 * The same job can be done using swr_alloc_set_opts2() as well:
61 * @code
62 * SwrContext *swr = NULL;
63 * int ret = swr_alloc_set_opts2(&swr, // we're allocating a new context
64 * &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, // out_ch_layout
65 * AV_SAMPLE_FMT_S16, // out_sample_fmt
66 * 44100, // out_sample_rate
67 * &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1, // in_ch_layout
68 * AV_SAMPLE_FMT_FLTP, // in_sample_fmt
69 * 48000, // in_sample_rate
70 * 0, // log_offset
71 * NULL); // log_ctx
72 * @endcode
73 *
74 * Once all values have been set, it must be initialized with swr_init(). If
75 * you need to change the conversion parameters, you can change the parameters
76 * using @ref avoptions, as described above in the first example; or by using
77 * swr_alloc_set_opts2(), but with the first argument the allocated context.
78 * You must then call swr_init() again.
79 *
80 * The conversion itself is done by repeatedly calling swr_convert().
81 * Note that the samples may get buffered in swr if you provide insufficient
82 * output space or if sample rate conversion is done, which requires "future"
83 * samples. Samples that do not require future input can be retrieved at any
84 * time by using swr_convert() (in_count can be set to 0).
85 * At the end of conversion the resampling buffer can be flushed by calling
86 * swr_convert() with NULL in and 0 in_count.
87 *
88 * The samples used in the conversion process can be managed with the libavutil
89 * @ref lavu_sampmanip "samples manipulation" API, including av_samples_alloc()
90 * function used in the following example.
91 *
92 * The delay between input and output, can at any time be found by using
93 * swr_get_delay().
94 *
95 * The following code demonstrates the conversion loop assuming the parameters
96 * from above and caller-defined functions get_input() and handle_output():
97 * @code
98 * uint8_t **input;
99 * int in_samples;
100 *
101 * while (get_input(&input, &in_samples)) {
102 * uint8_t *output;
103 * int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
104 * in_samples, 44100, 48000, AV_ROUND_UP);
105 * av_samples_alloc(&output, NULL, 2, out_samples,
106 * AV_SAMPLE_FMT_S16, 0);
107 * out_samples = swr_convert(swr, &output, out_samples,
108 * input, in_samples);
109 * handle_output(output, out_samples);
110 * av_freep(&output);
111 * }
112 * @endcode
113 *
114 * When the conversion is finished, the conversion
115 * context and everything associated with it must be freed with swr_free().
116 * A swr_close() function is also available, but it exists mainly for
117 * compatibility with libavresample, and is not required to be called.
118 *
119 * There will be no memory leak if the data is not completely flushed before
120 * swr_free().
121 */
122
123#include <stdint.h>
125#include "libavutil/frame.h"
126#include "libavutil/samplefmt.h"
127
129#ifndef HAVE_AV_CONFIG_H
130/* When included as part of the ffmpeg build, only include the major version
131 * to avoid unnecessary rebuilds. When included externally, keep including
132 * the full version information. */
134#endif
135
136/**
137 * @name Option constants
138 * These constants are used for the @ref avoptions interface for lswr.
139 * @{
140 *
141 */
142
143#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
144//TODO use int resample ?
145//long term TODO can we enable this dynamically?
146
147/** Dithering algorithms */
164
165/** Resampling Engines */
167 SWR_ENGINE_SWR, /**< SW Resampler */
168 SWR_ENGINE_SOXR, /**< SoX Resampler */
169 SWR_ENGINE_NB, ///< not part of API/ABI
170};
171
172/** Resampling Filter Types */
175 SWR_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall windowed sinc */
176 SWR_FILTER_TYPE_KAISER, /**< Kaiser windowed sinc */
177};
178
179/**
180 * @}
181 */
182
183/**
184 * The libswresample context. Unlike libavcodec and libavformat, this structure
185 * is opaque. This means that if you would like to set options, you must use
186 * the @ref avoptions API and cannot directly set values to members of the
187 * structure.
188 */
189typedef struct SwrContext SwrContext;
190
191/**
192 * Get the AVClass for SwrContext. It can be used in combination with
193 * AV_OPT_SEARCH_FAKE_OBJ for examining options.
194 *
195 * @see av_opt_find().
196 * @return the AVClass of SwrContext
197 */
198const AVClass *swr_get_class(void);
199
200/**
201 * @name SwrContext constructor functions
202 * @{
203 */
204
205/**
206 * Allocate SwrContext.
207 *
208 * If you use this function you will need to set the parameters (manually or
209 * with swr_alloc_set_opts2()) before calling swr_init().
210 *
211 * @see swr_alloc_set_opts2(), swr_init(), swr_free()
212 * @return NULL on error, allocated context otherwise
213 */
214struct SwrContext *swr_alloc(void);
215
216/**
217 * Initialize context after user parameters have been set.
218 * @note The context must be configured using the AVOption API.
219 *
220 * @see av_opt_set_int()
221 * @see av_opt_set_dict()
222 *
223 * @param[in,out] s Swr context to initialize
224 * @return AVERROR error code in case of failure.
225 */
226int swr_init(struct SwrContext *s);
227
228/**
229 * Check whether an swr context has been initialized or not.
230 *
231 * @param[in] s Swr context to check
232 * @see swr_init()
233 * @return positive if it has been initialized, 0 if not initialized
234 */
235int swr_is_initialized(struct SwrContext *s);
236
237/**
238 * Allocate SwrContext if needed and set/reset common parameters.
239 *
240 * This function does not require *ps to be allocated with swr_alloc(). On the
241 * other hand, swr_alloc() can use swr_alloc_set_opts2() to set the parameters
242 * on the allocated context.
243 *
244 * @param ps Pointer to an existing Swr context if available, or to NULL if not.
245 * On success, *ps will be set to the allocated context.
246 * @param out_ch_layout output channel layout (e.g. AV_CHANNEL_LAYOUT_*)
247 * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_*).
248 * @param out_sample_rate output sample rate (frequency in Hz)
249 * @param in_ch_layout input channel layout (e.g. AV_CHANNEL_LAYOUT_*)
250 * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_*).
251 * @param in_sample_rate input sample rate (frequency in Hz)
252 * @param log_offset logging level offset
253 * @param log_ctx parent logging context, can be NULL
254 *
255 * @see swr_init(), swr_free()
256 * @return 0 on success, a negative AVERROR code on error.
257 * On error, the Swr context is freed and *ps set to NULL.
258 */
259int swr_alloc_set_opts2(struct SwrContext **ps,
262 int log_offset, void *log_ctx);
263/**
264 * @}
265 *
266 * @name SwrContext destructor functions
267 * @{
268 */
269
270/**
271 * Free the given SwrContext and set the pointer to NULL.
272 *
273 * @param[in] s a pointer to a pointer to Swr context
274 */
275void swr_free(struct SwrContext **s);
276
277/**
278 * Closes the context so that swr_is_initialized() returns 0.
279 *
280 * The context can be brought back to life by running swr_init(),
281 * swr_init() can also be used without swr_close().
282 * This function is mainly provided for simplifying the usecase
283 * where one tries to support libavresample and libswresample.
284 *
285 * @param[in,out] s Swr context to be closed
286 */
287void swr_close(struct SwrContext *s);
288
289/**
290 * @}
291 *
292 * @name Core conversion functions
293 * @{
294 */
295
296/** Convert audio.
297 *
298 * in and in_count can be set to 0 to flush the last few samples out at the
299 * end.
300 *
301 * If more input is provided than output space, then the input will be buffered.
302 * You can avoid this buffering by using swr_get_out_samples() to retrieve an
303 * upper bound on the required number of output samples for the given number of
304 * input samples. Conversion will run directly without copying whenever possible.
305 *
306 * @param s allocated Swr context, with parameters set
307 * @param out output buffers, only the first one need be set in case of packed audio
308 * @param out_count amount of space available for output in samples per channel
309 * @param in input buffers, only the first one need to be set in case of packed audio
310 * @param in_count number of input samples available in one channel
311 *
312 * @return number of samples output per channel, negative value on error
313 */
314int swr_convert(struct SwrContext *s, uint8_t * const *out, int out_count,
315 const uint8_t * const *in , int in_count);
316
317/**
318 * Convert the next timestamp from input to output
319 * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
320 *
321 * @note There are 2 slightly differently behaving modes.
322 * @li When automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
323 * in this case timestamps will be passed through with delays compensated
324 * @li When automatic timestamp compensation is used, (min_compensation < FLT_MAX)
325 * in this case the output timestamps will match output sample numbers.
326 * See ffmpeg-resampler(1) for the two modes of compensation.
327 *
328 * @param[in] s initialized Swr context
329 * @param[in] pts timestamp for the next input sample, INT64_MIN if unknown
330 * @see swr_set_compensation(), swr_drop_output(), and swr_inject_silence() are
331 * function used internally for timestamp compensation.
332 * @return the output timestamp for the next output sample
333 */
335
336/**
337 * @}
338 *
339 * @name Low-level option setting functions
340 * These functions provide a means to set low-level options that is not possible
341 * with the AVOption API.
342 * @{
343 */
344
345/**
346 * Activate resampling compensation ("soft" compensation). This function is
347 * internally called when needed in swr_next_pts().
348 *
349 * @param[in,out] s allocated Swr context. If it is not initialized,
350 * or SWR_FLAG_RESAMPLE is not set, swr_init() is
351 * called with the flag set.
352 * @param[in] sample_delta delta in PTS per sample
353 * @param[in] compensation_distance number of samples to compensate for
354 * @return >= 0 on success, AVERROR error codes if:
355 * @li @c s is NULL,
356 * @li @c compensation_distance is less than 0,
357 * @li @c compensation_distance is 0 but sample_delta is not,
358 * @li compensation unsupported by resampler, or
359 * @li swr_init() fails when called.
360 */
361int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
362
363/**
364 * Set a customized input channel mapping.
365 *
366 * @param[in,out] s allocated Swr context, not yet initialized
367 * @param[in] channel_map customized input channel mapping (array of channel
368 * indexes, -1 for a muted channel)
369 * @return >= 0 on success, or AVERROR error code in case of failure.
370 */
371int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
372
373/**
374 * Generate a channel mixing matrix.
375 *
376 * This function is the one used internally by libswresample for building the
377 * default mixing matrix. It is made public just as a utility function for
378 * building custom matrices.
379 *
380 * AV_CHAN_UNUSED entries in custom layouts are ignored: their input columns or
381 * output rows are set to zero.
382 *
383 * @param in_layout input channel layout
384 * @param out_layout output channel layout
385 * @param center_mix_level mix level for the center channel
386 * @param surround_mix_level mix level for the surround channel(s)
387 * @param lfe_mix_level mix level for the low-frequency effects channel
388 * @param rematrix_maxval if 1.0, coefficients will be normalized to prevent
389 * overflow. if INT_MAX, coefficients will not be
390 * normalized.
391 * @param[out] matrix mixing coefficients; matrix[i + stride * o] is
392 * the weight of input channel i in output channel o.
393 * @param stride distance between adjacent input channels in the
394 * matrix array
395 * @param matrix_encoding matrixed stereo downmix mode (e.g. dplii)
396 * @param log_ctx parent logging context, can be NULL
397 * @return 0 on success, negative AVERROR code on failure
398 */
399int swr_build_matrix2(const AVChannelLayout *in_layout, const AVChannelLayout *out_layout,
400 double center_mix_level, double surround_mix_level,
401 double lfe_mix_level, double maxval,
402 double rematrix_volume, double *matrix,
404 void *log_context);
405
406/**
407 * Set a customized remix matrix.
408 *
409 * @param s allocated Swr context, not yet initialized
410 * @param matrix remix coefficients; matrix[i + stride * o] is
411 * the weight of input channel i in output channel o
412 * @param stride offset between lines of the matrix
413 * @return >= 0 on success, or AVERROR error code in case of failure.
414 */
415int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
416
417/**
418 * @}
419 *
420 * @name Sample handling functions
421 * @{
422 */
423
424/**
425 * Drops the specified number of output samples.
426 *
427 * This function, along with swr_inject_silence(), is called by swr_next_pts()
428 * if needed for "hard" compensation.
429 *
430 * @param s allocated Swr context
431 * @param count number of samples to be dropped
432 *
433 * @return >= 0 on success, or a negative AVERROR code on failure
434 */
435int swr_drop_output(struct SwrContext *s, int count);
436
437/**
438 * Injects the specified number of silence samples.
439 *
440 * This function, along with swr_drop_output(), is called by swr_next_pts()
441 * if needed for "hard" compensation.
442 *
443 * @param s allocated Swr context
444 * @param count number of samples to be dropped
445 *
446 * @return >= 0 on success, or a negative AVERROR code on failure
447 */
448int swr_inject_silence(struct SwrContext *s, int count);
449
450/**
451 * Gets the delay the next input sample will experience relative to the next output sample.
452 *
453 * Swresample can buffer data if more input has been provided than available
454 * output space, also converting between sample rates needs a delay.
455 * This function returns the sum of all such delays.
456 * The exact delay is not necessarily an integer value in either input or
457 * output sample rate. Especially when downsampling by a large value, the
458 * output sample rate may be a poor choice to represent the delay, similarly
459 * for upsampling and the input sample rate.
460 *
461 * @param s swr context
462 * @param base timebase in which the returned delay will be:
463 * @li if it's set to 1 the returned delay is in seconds
464 * @li if it's set to 1000 the returned delay is in milliseconds
465 * @li if it's set to the input sample rate then the returned
466 * delay is in input samples
467 * @li if it's set to the output sample rate then the returned
468 * delay is in output samples
469 * @li if it's the least common multiple of in_sample_rate and
470 * out_sample_rate then an exact rounding-free delay will be
471 * returned
472 * @returns the delay in 1 / @c base units.
473 */
475
476/**
477 * Find an upper bound on the number of samples that the next swr_convert
478 * call will output, if called with in_samples of input samples. This
479 * depends on the internal state, and anything changing the internal state
480 * (like further swr_convert() calls) will may change the number of samples
481 * swr_get_out_samples() returns for the same number of input samples.
482 *
483 * @param in_samples number of input samples.
484 * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts()
485 * or swr_set_compensation() invalidates this limit
486 * @note it is recommended to pass the correct available buffer size
487 * to all functions like swr_convert() even if swr_get_out_samples()
488 * indicates that less would be used.
489 * @returns an upper bound on the number of samples that the next swr_convert
490 * will output or a negative value to indicate an error
491 */
492int swr_get_out_samples(struct SwrContext *s, int in_samples);
493
494/**
495 * @}
496 *
497 * @name Configuration accessors
498 * @{
499 */
500
501/**
502 * Return the @ref LIBSWRESAMPLE_VERSION_INT constant.
503 *
504 * This is useful to check if the build-time libswresample has the same version
505 * as the run-time one.
506 *
507 * @returns the unsigned int-typed version
508 */
509unsigned swresample_version(void);
510
511/**
512 * Return the swr build-time configuration.
513 *
514 * @returns the build-time @c ./configure flags
515 */
516const char *swresample_configuration(void);
517
518/**
519 * Return the swr license.
520 *
521 * @returns the license of libswresample, determined at build-time
522 */
523const char *swresample_license(void);
524
525/**
526 * @}
527 *
528 * @name AVFrame based API
529 * @{
530 */
531
532/**
533 * Convert the samples in the input AVFrame and write them to the output AVFrame.
534 *
535 * Input and output AVFrames must have channel_layout, sample_rate and format set.
536 *
537 * If the output AVFrame does not have the data pointers allocated the nb_samples
538 * field will be set using av_frame_get_buffer()
539 * is called to allocate the frame.
540 *
541 * The output AVFrame can be NULL or have fewer allocated samples than required.
542 * In this case, any remaining samples not written to the output will be added
543 * to an internal FIFO buffer, to be returned at the next call to this function
544 * or to swr_convert().
545 *
546 * If converting sample rate, there may be data remaining in the internal
547 * resampling delay buffer. swr_get_delay() tells the number of
548 * remaining samples. To get this data as output, call this function or
549 * swr_convert() with NULL input.
550 *
551 * If the SwrContext configuration does not match the output and
552 * input AVFrame settings the conversion does not take place and depending on
553 * which AVFrame is not matching AVERROR_OUTPUT_CHANGED, AVERROR_INPUT_CHANGED
554 * or the result of a bitwise-OR of them is returned.
555 *
556 * @see swr_delay()
557 * @see swr_convert()
558 * @see swr_get_delay()
559 *
560 * @param swr audio resample context
561 * @param output output AVFrame
562 * @param input input AVFrame
563 * @return 0 on success, AVERROR on failure or nonmatching
564 * configuration.
565 */
567 AVFrame *output, const AVFrame *input);
568
569/**
570 * Configure or reconfigure the SwrContext using the information
571 * provided by the AVFrames.
572 *
573 * The original resampling context is reset even on failure.
574 * The function calls swr_close() internally if the context is open.
575 *
576 * @see swr_close();
577 *
578 * @param swr audio resample context
579 * @param out output AVFrame
580 * @param in input AVFrame
581 * @return 0 on success, AVERROR on failure.
582 */
583int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in);
584
585/**
586 * @}
587 * @}
588 */
589
590#endif /* SWRESAMPLE_SWRESAMPLE_H */
static FILE * out
static const uint8_t channel_map[8][8]
#define s(width, name)
Definition cbs_vp9.c:198
Public libavutil channel layout APIs header.
long long int64_t
Definition coverity.c:34
reference-counted frame API
AVMatrixEncoding
AVSampleFormat
Audio sample formats.
Definition samplefmt.h:55
const char * swresample_license(void)
Return the swr license.
Definition version.c:41
struct SwrContext * swr_alloc(void)
Allocate SwrContext.
Definition options.c:148
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
Set a customized input channel mapping.
Definition swresample.c:47
SwrFilterType
Resampling Filter Types.
Definition swresample.h:173
SwrDitherType
Dithering algorithms.
Definition swresample.h:148
int swr_drop_output(struct SwrContext *s, int count)
Drops the specified number of output samples.
Definition swresample.c:840
int swr_inject_silence(struct SwrContext *s, int count)
Injects the specified number of silence samples.
Definition swresample.c:851
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:879
int swr_build_matrix2(const AVChannelLayout *in_layout, const AVChannelLayout *out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double maxval, double rematrix_volume, double *matrix, ptrdiff_t stride, enum AVMatrixEncoding matrix_encoding, void *log_context)
Generate a channel mixing matrix.
Definition rematrix.c:572
int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in)
Configure or reconfigure the SwrContext using the information provided by the AVFrames.
int swr_alloc_set_opts2(struct SwrContext **ps, const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, const AVChannelLayout *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:54
void swr_free(struct SwrContext **s)
Free the given SwrContext and set the pointer to NULL.
Definition swresample.c:137
SwrEngine
Resampling Engines.
Definition swresample.h:166
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,...
Definition swresample.c:887
void swr_close(struct SwrContext *s)
Closes the context so that swr_is_initialized() returns 0.
Definition swresample.c:152
const AVClass * swr_get_class(void)
Get the AVClass for SwrContext.
Definition options.c:143
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:929
int swr_is_initialized(struct SwrContext *s)
Check whether an swr context has been initialized or not.
Definition swresample.c:721
int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance)
Activate resampling compensation ("soft" compensation).
Definition swresample.c:909
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.
const char * swresample_configuration(void)
Return the swr build-time configuration.
Definition version.c:36
int swr_convert(struct SwrContext *s, uint8_t *const *out, int out_count, const uint8_t *const *in, int in_count)
Convert audio.
Definition swresample.c:725
int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
Definition swresample.c:156
unsigned swresample_version(void)
Return the LIBSWRESAMPLE_VERSION_INT constant.
Definition version.c:30
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
Set a customized remix matrix.
Definition rematrix.c:71
@ SWR_FILTER_TYPE_BLACKMAN_NUTTALL
Blackman Nuttall windowed sinc.
Definition swresample.h:175
@ SWR_FILTER_TYPE_CUBIC
Cubic.
Definition swresample.h:174
@ SWR_FILTER_TYPE_KAISER
Kaiser windowed sinc.
Definition swresample.h:176
@ SWR_DITHER_RECTANGULAR
Definition swresample.h:150
@ SWR_DITHER_NS_MODIFIED_E_WEIGHTED
Definition swresample.h:157
@ SWR_DITHER_NS_LIPSHITZ
Definition swresample.h:155
@ SWR_DITHER_TRIANGULAR_HIGHPASS
Definition swresample.h:152
@ SWR_DITHER_NB
not part of API/ABI
Definition swresample.h:162
@ SWR_DITHER_NS_HIGH_SHIBATA
Definition swresample.h:161
@ SWR_DITHER_NS_IMPROVED_E_WEIGHTED
Definition swresample.h:158
@ SWR_DITHER_NS_F_WEIGHTED
Definition swresample.h:156
@ SWR_DITHER_NS_SHIBATA
Definition swresample.h:159
@ SWR_DITHER_TRIANGULAR
Definition swresample.h:151
@ SWR_DITHER_NS
not part of API/ABI
Definition swresample.h:154
@ SWR_DITHER_NS_LOW_SHIBATA
Definition swresample.h:160
@ SWR_DITHER_NONE
Definition swresample.h:149
@ SWR_ENGINE_SWR
SW Resampler.
Definition swresample.h:167
@ SWR_ENGINE_SOXR
SoX Resampler.
Definition swresample.h:168
@ SWR_ENGINE_NB
not part of API/ABI
Definition swresample.h:169
Libswresample version macros.
Libswresample version macros.
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
Definition log.h:76
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
The libswresample context.
float rematrix_volume
rematrixing volume coefficient
AudioData in
input audio data
float lfe_mix_level
LFE mixing level.
int out_sample_rate
output sample rate
int in_sample_rate
input sample rate
void * log_ctx
parent logging context
AVChannelLayout out_ch_layout
output channel layout
int matrix_encoding
matrixed stereo encoding
enum AVSampleFormat in_sample_fmt
input sample format
AVChannelLayout in_ch_layout
input channel layout
enum AVSampleFormat out_sample_fmt
output sample format
#define stride
static int64_t pts
uint8_t base
Definition vp3data.h:128