Commit dae405df authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for LTV crashes

parent f05dc386
Loading
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2658,14 +2658,16 @@ static void ivas_calc_p_coeffs_per_band_enc_fx(
            factor = L_max( factor, tmp ); // q_factor
        }

        tmp = L_shl_sat( IVAS_FIX_EPS_Q40, sub( q_factor, 40 ) );
        tmp = L_shl_sat( 189 /* 1e-20 in Q74 */, sub( q_factor, 74 ) );

        Word16 factor_exp = 0;
        move16();
        IF( LE_32( factor, tmp ) )
        {
            factor = 1250000000;
            factor_exp = Q31 - ( -4 );
            factor = 22204; // (1 / 1e-20) in Q(-52)
            factor_exp = Q15 - ( -52 );
            move32();
            move16();
        }
        ELSE
        {
@@ -2688,7 +2690,7 @@ static void ivas_calc_p_coeffs_per_band_enc_fx(
                    {
                        q_tmp = W_norm( W_tmp );
                    }
                    cov_uu_re[i - num_dmx][j - num_dmx] = W_extract_h( W_shl( W_mult0_32_32( cov_uu_re[i - num_dmx][j - num_dmx], factor ), q_tmp ) ); /*q_cov_uu_re+15-factor_exp+q_tmp-32*/
                    cov_uu_re[i - num_dmx][j - num_dmx] = W_extract_h( W_shl( W_tmp, q_tmp ) ); /*q_cov_uu_re+15-factor_exp+q_tmp-32*/
                    move32();
                    q_cov_uu_re_per_value[i - num_dmx][j - num_dmx] = sub( add( add( q_cov_uu_re, sub( 15, factor_exp ) ), q_tmp ), 32 );
                    move16();
+6 −6
Original line number Diff line number Diff line
@@ -987,7 +987,7 @@ void core_signal_analysis_high_bitrate_ivas_fx(
            /* Outter left folding */
            FOR( i = 0; i < folding_offset; i++ )
            {
                tcx20Win[folding_offset + i] = sub( tcx20Win[folding_offset + i], tcx20Win[folding_offset - 1 - i] ); // q_tcx20Win
                tcx20Win[folding_offset + i] = sub_sat( tcx20Win[folding_offset + i], tcx20Win[folding_offset - 1 - i] ); // q_tcx20Win
                move16();
            }

@@ -1002,14 +1002,14 @@ void core_signal_analysis_high_bitrate_ivas_fx(
                {
                    L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                    L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im );                           // (Q16 + q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                    tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                    // q_tcx20Win
                    tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                // q_tcx20Win
                    move32();
                }
                FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */
                {
                    L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                    L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re );                                          // (Q16 + q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                    tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                    // q_tcx20Win
                    tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                // q_tcx20Win
                    move32();
                }
            }
@@ -1018,7 +1018,7 @@ void core_signal_analysis_high_bitrate_ivas_fx(
            tmp = shr( right_overlap, 1 );
            FOR( i = 0; i < tmp; i++ )
            {
                tcx20Win[L_subframe + folding_offset - 1 - i] = add( tcx20Win[L_subframe + folding_offset - 1 - i], tcx20Win[L_subframe + folding_offset + i] ); // q_tcx20Win
                tcx20Win[L_subframe + folding_offset - 1 - i] = add_sat( tcx20Win[L_subframe + folding_offset - 1 - i], tcx20Win[L_subframe + folding_offset + i] ); // q_tcx20Win
                move16();
            }

@@ -1122,14 +1122,14 @@ void core_signal_analysis_high_bitrate_ivas_fx(
                    {
                        L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                        L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im );                           // (Q16, Q15) -> Q16 + q_tcx20Win
                        tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                    // q_tcx20Win
                        tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                // q_tcx20Win
                        move32();
                    }
                    FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */
                    {
                        L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                        L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re );                                          // (Q16 + q_tcx20Win, Q15) -> Q16 + q_tcx20Win
                        tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                    // q_tcx20Win
                        tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_h( L_tmp ) );                                // q_tcx20Win
                        move32();
                    }
                }
+2 −2
Original line number Diff line number Diff line
@@ -550,7 +550,7 @@ Word16 pvq_core_enc_ivas_fx(
    get_max_pulses_fx( sfm_start, sfm_end, ord, npulses, nb_sfm, pulse_vector, maxpulse );

    /* Fine gain prediction */
    fine_gain_pred_fx( sfm_start, sfm_end, sfmsize, ord, npulses, maxpulse, R, nb_sfm,
    ivas_fine_gain_pred_fx( sfm_start, sfm_end, sfmsize, ord, npulses, maxpulse, R, nb_sfm,
                            coefs_quant, pulse_vector, fg_pred, core );

    fine_gain_quant_fx( hBstr, ord, nb_sfm, gain_bits_array, fg_pred, gopt );