13
0

Fix EBU-R128 loudness analysis for mono signals

This removes the special case which assumed unity gain
when reproducing mono files on a stereo system.

ITU-R BS.1770 however specifies a channel weight of 0dB for
left, right and centre, regardless of the total channel count.

Tech 3344 6.16 mentions a 3dB attenuation to maintain the
loudness level of a mono audio signal in multi-channel signals,
and Tech 3343-2016 further specifies that "Ideally, a downmix
operation should be loudness-agnostic".
This commit is contained in:
Robin Gareus 2023-02-02 17:57:02 +01:00
parent 160ed4d056
commit 26270db8ae
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -349,11 +349,9 @@ Ebu_r128_proc::detect_process (int nfram)
z3 += y;
sj += y * y;
}
if (_nchan == 1) {
si = 2 * sj;
} else {
si += _chan_gain[i] * sj;
}
si += _chan_gain[i] * sj;
S->_z1 = !isfinite_local (z1) ? 0 : z1;
S->_z2 = !isfinite_local (z2) ? 0 : z2;
S->_z3 = !isfinite_local (z3) ? 0 : z3;