Commit 56c40ab0 authored by Vidhya V P's avatar Vidhya V P
Browse files

Fix for crash in DTX cases with SBA bitrate switch

parent e072645b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -221,6 +221,9 @@ ivas_error pre_proc_front_ivas(
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
    const int16_t front_vad_dtx_flag                            /* i  : front-VAD DTX flag to overwrite VAD decision*/
   ,const int32_t ivas_total_brate                             /* i  : IVAS total bitrate                       */
#ifdef SBA_BR_SWITCHING_RECONFIG
   ,const int16_t flag_sba_bitrate_switch                       /* i  : SBA bitrate switch flag                       */
#endif
);

ivas_error pre_proc_ivas(
+10 −1
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@ ivas_error pre_proc_front_ivas(
    const int16_t front_vad_dtx_flag                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    ,
    const int32_t ivas_total_brate /* i  : IVAS total bitrate - for setting the DTX */
#ifdef SBA_BR_SWITCHING_RECONFIG
    ,
    const int16_t flag_sba_bitrate_switch
#endif
)
{
    float *inp_12k8, *new_inp_12k8;        /* pointers to current frame and new data       */
@@ -450,7 +454,12 @@ ivas_error pre_proc_front_ivas(
        st->vad_flag = front_vad_flag;
        st->localVAD = front_vad_flag;
    }

#ifdef SBA_BR_SWITCHING_RECONFIG
    if ( flag_sba_bitrate_switch )
    {
        st->vad_flag = 1;
    }
#endif
    if ( ( hCPE != NULL && !( lr_vad_enabled && st->idchan == 0 ) ) || hSCE != NULL )
    {
        *vad_flag_dtx = dtx_hangover_addition( st, st->vad_flag, st->lp_speech - st->lp_noise, 0, vad_hover_flag, NULL, NULL
+6 −1
Original line number Diff line number Diff line
@@ -437,7 +437,12 @@ ivas_error ivas_cpe_enc(
        error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &Etot[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n],
                                     &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n],
                                     fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0,
                                     ivas_total_brate );
                                     ivas_total_brate
#ifdef SBA_BR_SWITCHING_RECONFIG
                                     ,
                                     st_ivas->flag_sba_bitrate_switch
#endif
        );
        if ( error != IVAS_ERR_OK )
        {
            return error;
+2 −0
Original line number Diff line number Diff line
@@ -346,6 +346,8 @@ ivas_error ivas_init_encoder(
#ifdef SBA_BR_SWITCHING_2
    st_ivas->sba_reinit_flag = 0;
#endif
#else
    st_ivas->flag_sba_bitrate_switch = 0;
#endif
    /*-----------------------------------------------------------------*
     * Allocate and initialize SCE/CPE and other handles
+6 −1
Original line number Diff line number Diff line
@@ -151,7 +151,12 @@ ivas_error ivas_ism_enc(
                                     &Etot[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0],
                                     &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0],
                                     fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0,
                                     st_ivas->hEncoderConfig->ivas_total_brate );
                                     st_ivas->hEncoderConfig->ivas_total_brate 
#ifdef SBA_BR_SWITCHING_RECONFIG
            ,
            0
#endif
        );
        if ( error != IVAS_ERR_OK )
        {
            return error;
Loading