Commit Graph

20 Commits

Author SHA1 Message Date
Justin Ruggles
157542ebc1 lavr: fix mixing matrix reduction when normalization is disabled
In some cases when an input contributes fully to the corresponding
output, other inputs may also contribute to the same output. This is the
case, for example, for the default 5.1 to stereo downmix matrix without
normalization.
2013-02-12 13:41:13 -05:00
Justin Ruggles
600b4c973f lavr: fix matrix reduction for upmixing in certain cases
Do not skip an output if the corresponding input contributes to other output
channels.
2013-02-12 13:41:13 -05:00
Justin Ruggles
a3735bb92a lavr: cosmetics: reindent 2013-02-12 13:41:13 -05:00
Justin Ruggles
1647da89dd lavr: make sure that the mix function is reset even if no mixing will be done
If the matrix reduction ends up with no mixing matrix needed, we need to still
reset the mix function accordingly and log the info to the user.
2013-02-12 13:41:09 -05:00
Justin Ruggles
646831e697 lavr: print out the mix matrix in ff_audio_mix_set_matrix()
This will print the new matrix if it is set after initialization.
2013-02-12 13:35:04 -05:00
Justin Ruggles
b90632d596 lavr: always reset mix function names and pointers in mix_function_init()
CC: libav-stable@libav.org
2013-01-17 19:27:01 -05:00
Justin Ruggles
f07ef2d9c9 lavr: call mix_function_init() in ff_audio_mix_set_matrix()
This is needed if a custom matrix is set by the user after opening the
AVAudioResampleContext because the matrix channel count can change if
different mixing coefficients are used.

CC:libav-stable@libav.org
2013-01-17 19:27:01 -05:00
Justin Ruggles
7ff3fd7ae4 lavr: log channel conversion description for any-to-any functions 2013-01-07 21:49:07 -05:00
Justin Ruggles
4164b0e8d3 lavr: mix: reduce the mixing matrix when possible
If the matrix results in an output channel not getting a contribution
from any input channel and the corresponding input channel does not
contribute to any outputs, we can skip the channel during mixing and
silence it after mixing.

If the matrix results in an input channel not contributing to any output
channels and it is not in the output mix, or if the input channel only
contributes fully to the same output channel, we can skip the channel
during mixing.

If the matrix results in an output channel only getting full
contribution from the corresponding input channel and that input channel
does not contribute to any other output channels, we can skip the
channel during mixing.
2013-01-07 21:49:06 -05:00
Hendrik Leppkes
0cf3505930 avresample: use valid log context in mixing functions
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-12-16 19:59:58 -05:00
Justin Ruggles
230acdde26 lavr: move AudioMix struct definition to audio_mix.c 2012-12-15 12:26:15 -05:00
Justin Ruggles
14758e3211 lavr: temporarily store custom matrix in AVAudioResampleContext
This allows AudioMix to be treated the same way as other conversion contexts
and removes the requirement to allocate it at the same time as the
AVAudioResampleContext.

The current matrix get/set functions are split between the public interface
and AudioMix private functions.
2012-12-11 14:00:32 -05:00
Martin Storsjö
1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
John Stebbins
4cf4028331 libavresample: add mix level normalization option
Provides an option to disable mix level normalization

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 23:36:56 +02:00
Justin Ruggles
8821ae649e lavr: fix handling of custom mix matrices
Adds some validation for changing parameters after setting the matrix and
fixes a bug in the conversion path setup.
2012-08-04 10:28:22 -04:00
Justin Ruggles
db0e7bd0bd lavr: mix: validate internal sample format in ff_audio_mix_init() 2012-07-08 15:22:11 -04:00
John Stebbins
3971be0eb5 Add Dolby/DPLII downmix support to libavresample
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-06-18 10:55:00 -04:00
Justin Ruggles
8dfc122719 lavr: add C functions for mixing 2 to 1 channels with s16p format 2012-05-29 15:16:20 -04:00
Justin Ruggles
4010d724e1 lavr: use 8.8 instead of 10.6 as the 16-bit fixed-point mixing coeff type 2012-05-01 13:52:59 -04:00
Justin Ruggles
c8af852b97 Add libavresample
This is a new library for audio sample format, channel layout, and sample rate
conversion.
2012-04-24 21:28:27 -04:00