Skip to content

Bug with TD-ITD shift in pre_proc_front_ivas_fx() produces delayed input to core compared to float

Basic info

  • Float reference:
  • Fixed point:
    • Encoder (fixed):7dad9ef38ab24ba9ee8492be7c2a2e5f21f9cb00
    • Decoder (fixed):

Bug description

While debugging a +10dB input item with high MLD, it was noticed that for some segments the difference between the two signals was very high. Some example snapshots of the difference signal float-BASOP are shown below:

Screenshot_2025-04-07_at_12.40.44

Screenshot_2025-04-07_at_12.41.26

After debugging the frames where this large difference is noticed, I found that the lag of the left channel input signal, that was shifted with the TD-ITD functionality to be aligned with the right, was re-introduced due to the following code at the beginning of function pre_proc_front_ivas_fx():

    Word16 Q_min = add( sub( 15, st->exp_old_inp_12k8 ), norm_arr( st->old_inp_12k8_fx, L_INP_MEM ) );
    Word16 input_frame_full = shl( input_frame, 1 ); //(old frame input length + new frame input length)
    Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) );
    Q_min = s_max( -1, Q_min );
    Copy_Scale_sig_32_16( st->input32_fx - input_frame, st->input_fx - input_frame, input_frame_full, sub( Q_min, st->q_inp32 ) ); // Q_min
    st->q_inp = Q_min;
    move16();
    st->q_old_inp = Q_min;
    move16();

As an example for frame 847, the st->input with the st->input_fx before applying the copy-scale of st->input32_fx and after applying it is shown in the plot below:

td_itd_error

As can be seen from the plot, after applying the copy-scale the lag of the left channel is re-introduced. Additionally, it can be seen that the extrapolation for the shifting of the channel does not seem to be the same, which also needs to be investigated.

Disabling the update of the input channel as above it is confirmed that the large differences are gone:

Screenshot_2025-04-07_at_18.31.28

Screenshot_2025-04-07_at_18.32.08

This may not only affect MDCT stereo with ITD operation modes, but also DFT and consequently unified stereo modes.

Ways to reproduce

Box folder: ...\Box_EXTERNAL_IVAS_BASOP_VERIFICATION\issues\issue-1463

./IVAS_cod -stereo -max_band SWB 48000 32 stereo-noisy_speech-p800-1-cat5-lab_d-20ms_aligned_files_concatenated_32.10dB.wav bit.192
./IVAS_dec stereo 32 bit.192 stereo-noisy_speech-p800-1-cat5-lab_d-20ms_aligned_files_concatenated_32.10dB.dec.wav
Edited by fotopoulou