Commit d985fa93 authored by Adityaraj Jain's avatar Adityaraj Jain
Browse files

crash fix

parent 097e2392
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1031,18 +1031,19 @@ ivas_error ivas_jbm_dec_tc_fx(
        {
            num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate );
            SPAR_DEC_HANDLE hSpar = st_ivas->hSpar;
            Word16 Q_p_output = 14;
            move16();
            Word16 nchan_transport;
            // num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands;
            nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport;
            move16();
            nchan_out = nchan_transport;
            move16();
            Word16 Q_p_output = s_max( 3, sub( L_norm_arr( p_output_fx[sba_ch_idx], imult1616( output_frame, nchan_transport ) ), 1 ) );
            Q_p_output = s_min( Q_p_output, 19 ); // to restrict Q-factor of p_ouptut to Q30
            FOR( ch = 0; ch < nchan_transport; ch++ )
            {
                Scale_sig32( p_output_fx[sba_ch_idx + ch], output_frame, sub( Q_p_output, Q11 ) ); // Q_p_output
                Scale_sig32( p_output_fx[sba_ch_idx + ch], output_frame, Q_p_output ); // Q_p_output + Q11
            }
            Q_p_output = add( Q11, Q_p_output );
            hSpar->hMdDec->Q_mixer_mat = 31;
            move16();

+2 −14
Original line number Diff line number Diff line
@@ -2356,21 +2356,13 @@ static void param_mc_protoSignalComputation_fx(
            FOR( band = 0; band < num_freq_bands; band++ )
            {

#ifdef FIX_1737_proto_fac_overflow
                Word32 tmp_x = L_shl( Mpy_32_32( fac_fx, ( *( p_real_buffer_fx++ ) ) ), 4 ); // Q(26 + 4 + 6 - 31)  :: Q5
#else
                Word32 tmp_x = Mpy_32_32( fac_fx, ( *( p_real_buffer_fx++ ) ) ); // Q(30 + 6 - 31)  :: Q5
#endif

                *( p_proto_frame_fx ) = L_add( *( p_proto_frame_fx ), tmp_x );
                move32();
                p_proto_frame_fx++;

#ifdef FIX_1737_proto_fac_overflow
                tmp_x = L_shl( Mpy_32_32( fac_fx, ( *( p_imag_buffer_fx++ ) ) ), 4 ); // Q(26 + 4 + 6 - 31)  :: Q5
#else
                tmp_x = Mpy_32_32( fac_fx, ( *( p_imag_buffer_fx++ ) ) ); // Q(30 + 6 - 31)  :: Q5
#endif

                *( p_proto_frame_fx ) = L_add( *( p_proto_frame_fx ), tmp_x );
                move32();
@@ -3604,11 +3596,7 @@ static ivas_error param_mc_get_diff_proto_info_fx(
            {
                p_diff_proto_info->source_chan_idx[cur_diff_proto][p_diff_proto_info->num_source_chan_diff[cur_diff_proto]] = cur_transport_ch;
                move16();
#ifdef FIX_1737_proto_fac_overflow
                p_diff_proto_info->proto_fac_fx[cur_diff_proto][p_diff_proto_info->num_source_chan_diff[cur_diff_proto]] = *proto_fac_ptr; // (proto_fac_fx)Q26 = Q26
#else
                p_diff_proto_info->proto_fac_fx[cur_diff_proto][p_diff_proto_info->num_source_chan_diff[cur_diff_proto]] = L_shl( *proto_fac_ptr, 4 ); // (proto_fac_fx)Q26 + 4 = Q30
#endif
                move16();
                p_diff_proto_info->num_source_chan_diff[cur_diff_proto] = add( p_diff_proto_info->num_source_chan_diff[cur_diff_proto], 1 );
                move16();
+2 −1
Original line number Diff line number Diff line
@@ -517,13 +517,14 @@ void ivas_sba_mix_matrix_determiner_fx(
            temp_fx = output_fx[ch][i]; /*Q_output*/
            move32();
            temp_fx = L_shr( temp_fx + L_shl( 1, Q_p_output - 1 ), Q_p_output ); /*Q0*/
            //temp_fx = W_extract_l( W_shr( W_add( temp_fx, W_shl( 1, sub( Q_p_output, 1 ) ) ), Q_p_output ) ); /*Q0*/

            IF( GT_32( temp_fx, MAX16B ) )
            {
                temp_fx = MAX16B; /*Q0*/
                move32();
            }
            ELSE IF( LT_32( temp_fx, L_negate( PCM16_TO_FLT_FAC_FX ) ) )
            ELSE IF( LT_32( temp_fx, -( PCM16_TO_FLT_FAC_FX ) ) )
            {
                temp_fx = -( PCM16_TO_FLT_FAC_FX ); /*Q0*/
                move32();