Skip to content

Crash in stereo_cna_update_params_fx()

in 0c11047f, with the following bitstream:

harmonics_-stereo_sw_13k2_to_128k_10fr.bin_32.bit

the decoder crash in the function stereo_cna_update_params_fx() at line 1471:

            temp_x_inv = ISqrt32((Word32)enrL_fx, &x_inv_q);
            temp_y_inv = ISqrt32((Word32)enrR_fx, &y_inv_q);
            energy_xy_fx = Mpy_32_32(temp_x_inv, temp_y_inv);
            temp_res_q = x_inv_q + y_inv_q;
            headroom_left_dotLR_fx = W_norm(dotLR_fx);
            dotLR_fx_q = OUTPUT_Q * 2;
            IF(headroom_left_dotLR_fx < 32)
            {
              dotLR_fx = W_shr(dotLR_fx, 32 - headroom_left_dotLR_fx);
              dotLR_fx_q = dotLR_fx_q - (32 - headroom_left_dotLR_fx);
            }
            dotLR_fx = Mpy_32_32((Word32)dotLR_fx, energy_xy_fx);
            dotLR_fx_q = dotLR_fx_q + (31 - temp_res_q) - 31;
            dotLR_fx = (Word64)L_shl_sat((Word32)dotLR_fx, 31 - dotLR_fx_q);
            /* estimate L/R correlation factor and ILD in time domain */
            c_LR_fx = extract_h((Word32)dotLR_fx);

            temp_res_q = 0;
            c_fx = BASOP_Util_Divide3232_Scale((Word32)enrL_fx, (Word32)enrR_fx, &temp_res_q);
            c_q = 15 - temp_res_q + (y_q - x_q);

>>>>        Word32 one_in_c_q = L_shl(1 , c_q);   <<<<<< 
            Word32 num_c_fx = L_sub(c_fx, one_in_c_q);
            Word32 denom_c_fx = L_add(c_fx, one_in_c_q);
            Word16 num_c_headroom = norm_l(L_sub(c_fx, one_in_c_q));
            Word16 denom_c_headroom = norm_l(L_add(c_fx, one_in_c_q));

Where highlighted, c_q is equal to 45, so there is a major dynamic issue here. Many basop operations are missing, so maybe the code is under development, but in I preferred to raise the issue already now.