Switching artifact in MDCT -> DFT stereo switching
During MDCT to DFT stereo switching, severe artifacts may appear in the synthesis signal. The issue lies in the stereo_switching_enc() function, where the DFT analysis/synthesis overlap memory hCPE->input_mem[] should be updated during MDCT stereo frames. However, the following condition prevents this update:
/* update DFT analysis overlap memory */
if ( hCPE->element_mode > IVAS_CPE_DFT && hCPE's->input_mem[0] != NULL
&& hCPE->element_mode != IVAS_CPE_MDCT
)
{
for ( n = 0; n < CPE_CHANNELS; n++ )
{
mvr2r( sts[n]->input + input_frame - dft_ovl, hCPE->input_mem[n], dft_ovl );
}
}
As a result, the old_inp_12k8[] buffer ends up with discontinuities in its middle section, corresponding to the overlap part of the DFT analysis/synthesis window. This ultimately leads to artifacts in the synthesis signal, as shown in the following graph:
The problem can be reproduced with
./IVAS_cod -dtx -stereo sw_13k2_to_128k_10fr.bin 48 p800-2-c1d_short.wav bit
./IVAS_dec STEREO 48 bit syn
Here's the input signal: p800-2-c1d_short
Edited by Ghost User
