aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample/swresample.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-18 01:08:50 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-27 12:54:00 +0200
commit23c0779cda8cedfa5e722677aecba18801a31278 (patch)
treee862661811f1488b5c0eaaf8459207ce91adda27 /libswresample/swresample.h
parent740f5105d5bdc6c9bab1a6aa0ccd3a3362d12daf (diff)
downloadffmpeg-23c0779cda8cedfa5e722677aecba18801a31278.tar.gz
swresample: Add swr_build_matrix()
API and Doxy documentation is taken from avresample_build_matrix() Fixes: Ticket5780 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswresample/swresample.h')
-rw-r--r--libswresample/swresample.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/libswresample/swresample.h b/libswresample/swresample.h
index a09563b80a..a8db5c2490 100644
--- a/libswresample/swresample.h
+++ b/libswresample/swresample.h
@@ -120,6 +120,7 @@
*/
#include <stdint.h>
+#include "libavutil/channel_layout.h"
#include "libavutil/frame.h"
#include "libavutil/samplefmt.h"
@@ -366,6 +367,36 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
/**
+ * Generate a channel mixing matrix.
+ *
+ * This function is the one used internally by libswresample for building the
+ * default mixing matrix. It is made public just as a utility function for
+ * building custom matrices.
+ *
+ * @param in_layout input channel layout
+ * @param out_layout output channel layout
+ * @param center_mix_level mix level for the center channel
+ * @param surround_mix_level mix level for the surround channel(s)
+ * @param lfe_mix_level mix level for the low-frequency effects channel
+ * @param rematrix_maxval if 1.0, coefficients will be normalized to prevent
+ * overflow. if INT_MAX, coefficients will not be
+ * normalized.
+ * @param[out] matrix mixing coefficients; matrix[i + stride * o] is
+ * the weight of input channel i in output channel o.
+ * @param stride distance between adjacent input channels in the
+ * matrix array
+ * @param matrix_encoding matrixed stereo downmix mode (e.g. dplii)
+ * @param log_ctx parent logging context, can be NULL
+ * @return 0 on success, negative AVERROR code on failure
+ */
+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);
+
+/**
* Set a customized remix matrix.
*
* @param s allocated Swr context, not yet initialized