possible Overflow in stereo leading to a click/pop
Basic info
- Float reference:
- Encoder (float): 73d5e7cd
- Decoder (float):
- Fixed point:
- Encoder (fixed): 55f431d5
- Decoder (fixed):
Bug description
In the residual coding section of the in stereo dtf domain, there is a function scaling 16 bit vector to 32 bits vector. the left shift asked is 17 bit. This can work when the input is using 14 bits or less only. In the case here, the input that has to be copied contains value > 16384, which leads to a "wrap around" in the output vector as shown in the figure above.
From top to bottom (figure shows the first 8 frames of the file):
- Float left channel
- Float right channel
- Fixed point left channel
- Fixed point right channel
- element mode
- core
- spectrum
The code concerned here is :
FOR( Word16 i = 0; i < CPE_CHANNELS; i++ )
{
Copy_Scale_sig_16_32_no_sat( old_inp_12k8_16fx[i], old_inp_12k8_fx[i], L_INP_12k8, Q16 + Q1 ); <<<***********
}
stereo_dft_enc_res_fx( hCPE->hStereoDft, old_inp_12k8_fx[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, max_bits );
I tried using saturation inside the function Copy_Scale_sig_16_32_no_sat, and that solves the issue, but I'm not sure that is the way to go there, as left shifting by 17 bits looks a bit strange to me.
tagging @fotopoulou and @multrus for awareness
Ways to reproduce
Box folder: ...\Box_EXTERNAL_IVAS_BASOP_VERIFICATION\issues\issue-1334
IVAS_cod -stereo 32000 48 C:\Temp\dm1ba1s15.wav bit
IVAS_dec STEREO 48 bit syn