Skip to content

Decoder crashes in Hilbert_transform during bit-rate switching for low-level content

with c7b43a06 and this bitstream :

P800-2-cat1-d-input_-dtx_-stereo_sw_13k2_to_128k_10fr.bin_48.bit.zip

at frame 1191 in the function Hilbert_transform_fx() from file swb_tbe_com_fx.c at Ln660.

        FOR( i = 0; i < length; i++ )
        {
            L_tmp = Mult_32_16( tmp_R[i + 4], Hilbert_coeffs_fx[hb_filter_stage][0 + offset] );        /*Qx+15 */
            L_tmp = Madd_32_16( L_tmp, tmp_R[i + 2], Hilbert_coeffs_fx[hb_filter_stage][2 + offset] ); /*Qx+15 */
            L_tmp = Madd_32_16( L_tmp, tmp_R[i], Hilbert_coeffs_fx[hb_filter_stage][4 + offset] );     /*Qx+15 */
 --->>      tmpi_R[i] = L_shl( L_tmp, 1 );
            move32(); /*Qx+16 */

            L_tmp = Mult_32_16( tmp_I[i + 4 + offset], Hilbert_coeffs_fx[hb_filter_stage + 1][0] );        /*Qx+15 */
            L_tmp = Madd_32_16( L_tmp, tmp_I[i + 2 + offset], Hilbert_coeffs_fx[hb_filter_stage + 1][2] ); /*Qx+15 */
            L_tmp = Madd_32_16( L_tmp, tmp_I[i + offset], Hilbert_coeffs_fx[hb_filter_stage + 1][4] );     /*Qx+15 */
   --->>    tmpi_I[i] = L_shl( L_tmp, 1 );
            move32(); /*Qx+16 */

if using L_shl_sat is appropriate, then it should be done at lines 671 and 676 as well. But I think it should be good to understand why it is crashing there on low level signal. maybe the scaling of the signal has been too aggressive and it could be better to fix that instead of allowing saturation.

Edited by vaillancour