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

Fix for EVS bit-inexactness issue and Float code bitexactness

parent f42e79b1
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -962,8 +962,8 @@ ivas_error core_switching_pre_dec_fx(
#endif
        {
            set16_fx(hHQ_core->old_out_fx, 0, output_frame);
            hHQ_core->Q_old_wtda_LB = 0;
            hHQ_core->Q_old_wtda = 0;
            hHQ_core->Q_old_wtda_LB = 15;
            hHQ_core->Q_old_wtda = 15;
#ifdef IVAS_CODE_SWITCHING
            set_f(st->hHQ_core->old_outLB, 0, L_FRAME16k);
#endif
+5 −5
Original line number Diff line number Diff line
@@ -343,13 +343,13 @@ void hq_core_dec(
        index = tcx_cfg->tcx_last_overlap_mode;

        /* LB synthesis */
        IMDCT( t_audio_q, hTcxDec->syn_Overl, hTcxDec->syn_Overl_TDAC, wtda_audio, tcx_cfg->tcx_aldo_window_1_trunc, tcx_cfg->tcx_aldo_window_2, tcx_cfg->tcx_mdct_window_half, tcx_cfg->tcx_mdct_window_minimum, tcx_cfg->tcx_mdct_window_trans, tcx_cfg->tcx_mdct_window_half_length, tcx_cfg->tcx_mdct_window_min_length, index,
        IMDCT( t_audio_q, hTcxDec->syn_Overl_float, hTcxDec->syn_Overl_TDAC_float, wtda_audio, tcx_cfg->tcx_aldo_window_1_trunc_flt, tcx_cfg->tcx_aldo_window_2_flt, tcx_cfg->tcx_mdct_window_half_flt, tcx_cfg->tcx_mdct_window_minimum_flt, tcx_cfg->tcx_mdct_window_trans_flt, tcx_cfg->tcx_mdct_window_half_length, tcx_cfg->tcx_mdct_window_min_length, index,
               MDCT_IV, left_rect, tcx_offset, overlap, L_frame, L_frameTCX, max( L_frameTCX, L_spec ) >> 1, L_frame_glob, 0, st->bfi, hHQ_core->old_outLB, 0, st, 0, acelp_zir );

        mvr2r( wtda_audio + ( overlap >> 1 ) - tcx_offset, output, L_frame_glob );

        /* FB synthesis */
        IMDCT( t_audio_q, hTcxDec->syn_OverlFB, hTcxDec->syn_Overl_TDACFB, wtda_audio, tcx_cfg->tcx_aldo_window_1_FB_trunc, tcx_cfg->tcx_aldo_window_2_FB, tcx_cfg->tcx_mdct_window_halfFB, tcx_cfg->tcx_mdct_window_minimumFB, tcx_cfg->tcx_mdct_window_transFB, tcx_cfg->tcx_mdct_window_half_lengthFB, tcx_cfg->tcx_mdct_window_min_lengthFB, index,
        IMDCT( t_audio_q, hTcxDec->syn_OverlFB_float, hTcxDec->syn_Overl_TDACFB_float, wtda_audio, tcx_cfg->tcx_aldo_window_1_FB_trunc_flt, tcx_cfg->tcx_aldo_window_2_FB_flt, tcx_cfg->tcx_mdct_window_halfFB_flt, tcx_cfg->tcx_mdct_window_minimumFB_flt, tcx_cfg->tcx_mdct_window_transFB_flt, tcx_cfg->tcx_mdct_window_half_lengthFB, tcx_cfg->tcx_mdct_window_min_lengthFB, index,
               MDCT_IV, left_rect, tcx_offsetFB, overlapFB, L_frameTCX, L_frameTCX, max( L_frameTCX, L_spec ) >> 1, L_frameTCX_glob, 0, st->bfi, hHQ_core->old_out, 1, st, FSCALE_DENOM * L_frameTCX_glob / L_frame_glob, acelp_zir );

        mvr2r( wtda_audio + ( overlapFB >> 1 ) - tcx_offsetFB, synth, L_frameTCX_glob );
@@ -442,7 +442,7 @@ void hq_core_dec(

    if ( !st->bfi && st->prev_bfi && st->last_total_brate >= HQ_48k && st->last_codec_mode == MODE2 && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hPlcInfo->concealment_method == TCX_NONTONAL && st->hPlcInfo->nbLostCmpt < 4 )
    {
        waveform_adj2( st->hPlcInfo, st->hTonalMDCTConc->secondLastPcmOut, synth, 0, st->hPlcInfo->nbLostCmpt + 1, st->bfi );
        waveform_adj2( st->hPlcInfo, st->hTonalMDCTConc->secondLastPcmOut_float, synth, 0, st->hPlcInfo->nbLostCmpt + 1, st->bfi );
    }

    if ( output_frame >= L_FRAME16k )
@@ -482,8 +482,8 @@ void hq_core_dec(
    }
    mvr2r( &st->old_pitch_buf[st->L_frame / L_SUBFR], st->old_pitch_buf, st->L_frame / L_SUBFR );
    set_f( &st->old_pitch_buf[st->L_frame / L_SUBFR], (float) L_SUBFR, st->L_frame / L_SUBFR );
    mvr2r( &st->mem_pitch_gain[2], &st->mem_pitch_gain[st->L_frame / L_SUBFR + 2], st->L_frame / L_SUBFR );
    set_zero( &st->mem_pitch_gain[2], st->L_frame / L_SUBFR );
    mvr2r( &st->mem_pitch_gain_float[2], &st->mem_pitch_gain_float[st->L_frame / L_SUBFR + 2], st->L_frame / L_SUBFR );
    set_zero( &st->mem_pitch_gain_float[2], st->L_frame / L_SUBFR );

    /* Move LB excitation to old_exc memory in case of switch HQ->ACELP */
    if ( st->element_mode > EVS_MONO )
+1 −1
Original line number Diff line number Diff line
@@ -1217,7 +1217,7 @@ void HQ_core_dec_init_fx(
    set16_fx(hHQ_core->old_out_LB_fx, 0, L_FRAME32k);          
    set32_fx(hHQ_core->oldOut_fx, 0, L_FRAME48k);             
    set32_fx(hHQ_core->old_outLB_fx, 0, L_FRAME32k);          
    hHQ_core->Q_old_wtda = 0;                                 
    hHQ_core->Q_old_wtda = 15;
    hHQ_core->Q_old_postdec = 0;                              
    hHQ_core->Q_old_wtda_LB = 0;
    hHQ_core->Q_old_out = 0;