Merge remote-tracking branch 'qatar/master'
* qatar/master: lavr: fix mixing matrix reduction when normalization is disabled lavr: fix matrix reduction for upmixing in certain cases lavr: cosmetics: reindent Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
845fa2f5c9
@ -572,11 +572,22 @@ static void reduce_matrix(AudioMix *am, const double *matrix, int stride)
|
|||||||
int skip = 1;
|
int skip = 1;
|
||||||
|
|
||||||
for (o = 0; o < am->out_channels; o++) {
|
for (o = 0; o < am->out_channels; o++) {
|
||||||
|
int i0;
|
||||||
if ((o != i && matrix[o * stride + i] != 0.0) ||
|
if ((o != i && matrix[o * stride + i] != 0.0) ||
|
||||||
(o == i && matrix[o * stride + i] != 1.0)) {
|
(o == i && matrix[o * stride + i] != 1.0)) {
|
||||||
skip = 0;
|
skip = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* if the input contributes fully to the output, also check that no
|
||||||
|
other inputs contribute to this output */
|
||||||
|
if (o == i) {
|
||||||
|
for (i0 = 0; i0 < am->in_channels; i0++) {
|
||||||
|
if (i0 != i && matrix[o * stride + i0] != 0.0) {
|
||||||
|
skip = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (skip) {
|
if (skip) {
|
||||||
am->input_skip[i] = 1;
|
am->input_skip[i] = 1;
|
||||||
@ -607,6 +618,7 @@ static void reduce_matrix(AudioMix *am, const double *matrix, int stride)
|
|||||||
corresponding input channel */
|
corresponding input channel */
|
||||||
for (o = 0; o < FFMIN(am->in_channels, am->out_channels); o++) {
|
for (o = 0; o < FFMIN(am->in_channels, am->out_channels); o++) {
|
||||||
int skip = 1;
|
int skip = 1;
|
||||||
|
int o0;
|
||||||
|
|
||||||
for (i = 0; i < am->in_channels; i++) {
|
for (i = 0; i < am->in_channels; i++) {
|
||||||
if ((o != i && matrix[o * stride + i] != 0.0) ||
|
if ((o != i && matrix[o * stride + i] != 0.0) ||
|
||||||
@ -615,6 +627,15 @@ static void reduce_matrix(AudioMix *am, const double *matrix, int stride)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* check if the corresponding input channel makes a contribution to
|
||||||
|
any other output channel */
|
||||||
|
i = o;
|
||||||
|
for (o0 = 0; o0 < am->out_channels; o0++) {
|
||||||
|
if (o0 != i && matrix[o0 * stride + i] != 0.0) {
|
||||||
|
skip = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (skip) {
|
if (skip) {
|
||||||
am->output_skip[o] = 1;
|
am->output_skip[o] = 1;
|
||||||
am->out_matrix_channels--;
|
am->out_matrix_channels--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user