Skip to content

Saturation possible for 32kbps stereo PLC

Git SHA:e7a2525e

Using an internal test file (which will be shared separately), an assert is triggered during lost frame concealment in the TCX stereo decoder. Reproduce with (error pattern file can be found here):

./IVAS_cod -stereo 32000 16 input_signal.wav bit
eid-xor -fer -vbr bit ep_10pct_fer.g192 bit_err
./IVAS_cod stereo 16 bit_err out.wav

This triggers an assert at basop32.c:1665 due to an overflow happening. The relevant context is this code from tonalMDCTconcealment_fx.c:1660:

                tmp = div_l( nrgNoiseInLastFrame, round_fx( nrgWhiteNoise ) );

The saturation happens in round_fx. The variable nrgWhiteNoise contains the energy of a generated white noise spectrum which is accumulated and used in this line to calculate a normalization factor for the whole spectrum that intends to scale the spectrum to a certain energy (i.e. nrgNoiseInLastFrame). This energy accumulation should ideally not saturate to achieve the intended scaling.