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.
int skip = 1;
for (o = 0; o < am->out_channels; o++) {
+ int i0;
if ((o != i && matrix[o * stride + i] != 0.0) ||
(o == i && matrix[o * stride + i] != 1.0)) {
skip = 0;
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) {
am->input_skip[i] = 1;