OMASA ltv crashes for bitrate switching to TD stereo
This is a spin-off from #831 (closed).
The OMASA crashes with long test-vector in case of bitrate switching. Using the following command-line:
IVAS_cod -q -ism_masa 3 1 ltv48_OMASA_3ISM_1TC_ISM1.csv ltv48_OMASA_3ISM_1TC_ISM2.csv ltv48_OMASA_3ISM_1TC_ISM3.csv ltv48_OMASA_3ISM_1TC.met sw_13k2_512k_2fr_start_48k_omasatechs_3ism.bin 48 ltv48_OMASA_3ISM_1TC.wav bit
there is a crash in frame 2392 which involves a switching from 48 kbps to 13.2kbps.
The problem comes from the fact that the previous frame at 48 kbps is coded using TD stereo which is kept also in the first 13.2 kbps frame. However, TD stereo should be avoided in MASA/OMASA at 13.2kbps.
A possible fix is as follows:
if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO || ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ivas_total_brate < MASA_STEREO_MIN_BITRATE )
#ifdef DEBUGGING
|| ( hCPE->stereo_mode_cmdl == IVAS_CPE_DFT || hCPE->stereo_mode_cmdl == IVAS_CPE_TD )
#endif
)
{
stereo_switching_flag = 0;
#ifdef FIX1
if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ivas_total_brate < MASA_STEREO_MIN_BITRATE )
{
element_mode = IVAS_CPE_DFT;
}
#endif
}
Tagging @malenovsky for possible comments.
Edited by vaclav