Skip to content

EVS: potential bug in SWB-BWE excitation rescaling in DTX

In the EVS part, ACELP decoder, there is likely a bug in the rescaling of the SWB-BWE excitation in DTX. The length of the BWE excitation signal is currently set to st_fx->L_frame * HIBND_ACB_L_FAC which is fine for L_frame = 256. However, L_frame could be also 320 and then the length is set too long (800 instead of 640).

I think that the length of the BWE excitation signal should be always set to L_FRAME32k (640 samples).

A potential fix is as follows (function acelp_core_dec_fx()):

IF( st->core_brate == FRAME_NO_DATA || EQ_32( st->core_brate, SID_2k40 ) )
{
    /* decode CNG parameters */
    IF( st->cng_type == LP_CNG )
    {
        ...
    }
    ELSE
    {
        ...
    }
    ...
#ifdef FIX
    Rescale_exc( hMusicPF->dct_post_old_exc_fx, exc_fx, bwe_exc_fx, st_fx->hGSCDec->last_exc_dct_in_fx, st_fx->L_frame,
                 L_FRAME32k, 0, &( st_fx->Q_exc ), st_fx->Q_subfr, NULL, 0, INACTIVE );
#else
    Rescale_exc( hMusicPF->dct_post_old_exc_fx, exc_fx, bwe_exc_fx, st_fx->hGSCDec->last_exc_dct_in_fx, st_fx->L_frame,
                 st_fx->L_frame * HIBND_ACB_L_FAC, 0, &( st_fx->Q_exc ), st_fx->Q_subfr, NULL, 0, INACTIVE );
#endif
Edited by vaclav