Commit 524f2c28 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_981_fix' into 'main'

Fix for 3GPP issue 981: Stereo decoding with JBM: energy difference in right...

See merge request !759
parents e86e4759 fa3f2e24
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -6407,7 +6407,13 @@ void TonalMDCTConceal_SaveTimeSignal(
    TonalMDCTConcealPtr hTonalMDCTConc,
    Word16 *timeSignal,
    Word16 nNewSamples );
#ifdef IVAS_FLOAT_FIXED
void TonalMDCTConceal_SaveTimeSignal_ivas_fx(
    TonalMDCTConcealPtr hTonalMDCTConc,
    Word16 *timeSignal,
    Word16 q_timeSignal,
    Word16 nNewSamples );
#endif
// decision_matrix_dec_fx.c
void decision_matrix_dec_fx(
+4 −0
Original line number Diff line number Diff line
@@ -1050,6 +1050,8 @@ void open_decoder_LPD_fx(
        move16();
        st->tonalMDCTconceal.lastPcmOut = 0x0;
        move16();
        st->tonalMDCTconceal.q_lastPcmOut = Q15;
        move16();
        st->tonalMDCTconceal.lastBlockData.tonalConcealmentActive = 0;
        move16();
        st->tonalMDCTconceal.lastBlockData.nSamples = 0;
@@ -2121,6 +2123,8 @@ void open_decoder_LPD_ivas_fx(
        move16();
        st->hTonalMDCTConc->lastPcmOut = 0x0;
        move16();
        st->hTonalMDCTConc->q_lastPcmOut = Q15;
        move16();
        st->hTonalMDCTConc->lastBlockData.tonalConcealmentActive = 0;
        move16();
        st->hTonalMDCTConc->lastBlockData.nSamples = 0;
+14 −0
Original line number Diff line number Diff line
@@ -507,6 +507,13 @@ void hq_core_dec_fx(
        st_fx->plcInfo.recovery_gain = shl( st_fx->plcInfo.recovery_gain, *Q_synth );
        move16();
#endif
        IF( st_fx->tonalMDCTconceal.q_lastPcmOut != 0 )
        {
            Scale_sig( st_fx->tonalMDCTconceal.secondLastPcmOut, shr( st_fx->plcInfo.FrameSize, 1 ), negate( st_fx->tonalMDCTconceal.q_lastPcmOut ) );
            Scale_sig( st_fx->tonalMDCTconceal.lastPcmOut, st_fx->plcInfo.FrameSize, negate( st_fx->tonalMDCTconceal.q_lastPcmOut ) );
            st_fx->tonalMDCTconceal.q_lastPcmOut = 0;
            move16();
        }
        waveform_adj2_fix( st_fx->tonalMDCTconceal.secondLastPcmOut,
                           synth,
                           st_fx->plcInfo.data_noise,
@@ -1136,6 +1143,13 @@ void ivas_hq_core_dec_fx(
        st_fx->plcInfo.recovery_gain = shl( st_fx->plcInfo.recovery_gain, *Q_synth );
#endif
        move16();
        IF( st_fx->tonalMDCTconceal.q_lastPcmOut != 0 )
        {
            Scale_sig( st_fx->tonalMDCTconceal.secondLastPcmOut, shr( st_fx->plcInfo.FrameSize, 1 ), negate( st_fx->tonalMDCTconceal.q_lastPcmOut ) );
            Scale_sig( st_fx->tonalMDCTconceal.lastPcmOut, st_fx->plcInfo.FrameSize, negate( st_fx->tonalMDCTconceal.q_lastPcmOut ) );
            st_fx->tonalMDCTconceal.q_lastPcmOut = 0;
            move16();
        }
        waveform_adj2_fix( st_fx->tonalMDCTconceal.secondLastPcmOut,
                           synth,
                           st_fx->plcInfo.data_noise,
+7 −1
Original line number Diff line number Diff line
@@ -1295,7 +1295,13 @@ ivas_error ivas_core_dec_fx(
            IF( EQ_16( st->core, ACELP_CORE ) && !st->bfi && st->prev_bfi && GE_32( st->last_total_brate, HQ_48k ) && EQ_16( st->last_codec_mode, MODE2 ) && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) && LT_16( st->hPlcInfo->nbLostCmpt, 4 ) )
            {
                tmps = NS2SA_FX2( output_Fs, DELAY_CLDFB_NS );

                IF( st->tonalMDCTconceal.q_lastPcmOut != 0 )
                {
                    Scale_sig( st->tonalMDCTconceal.secondLastPcmOut, shr( st->plcInfo.FrameSize, 1 ), negate( st->tonalMDCTconceal.q_lastPcmOut ) );
                    Scale_sig( st->tonalMDCTconceal.lastPcmOut, st->plcInfo.FrameSize, negate( st->tonalMDCTconceal.q_lastPcmOut ) );
                    st->tonalMDCTconceal.q_lastPcmOut = 0;
                    move16();
                }
                waveform_adj2_fix( st->hTonalMDCTConc->secondLastPcmOut, synth_16_fx[n] + tmps, st->plcInfo.data_noise, &st->plcInfo.outx_new_n1_fx,
                                   &st->plcInfo.nsapp_gain_fx, &st->plcInfo.nsapp_gain_n_fx, &st->plcInfo.recovery_gain, st->plcInfo.step_concealgain_fx,
                                   st->plcInfo.Pitch_fx, st->plcInfo.FrameSize, tmps, add( st->hPlcInfo->nbLostCmpt, 1 ), st->bfi );
+1 −3
Original line number Diff line number Diff line
@@ -2117,9 +2117,7 @@ void ivas_mdct_core_reconstruct_fx(
            test();
            IF( ( bfi == 0 ) && st->hTonalMDCTConc != NULL )
            {
                Word16 synth_tmp[L_FRAME48k];
                Copy_Scale_sig( synthFB_fx, synth_tmp, st->hTonalMDCTConc->nSamples, 2 );
                TonalMDCTConceal_SaveTimeSignal( st->hTonalMDCTConc, synth_tmp, L_frameTCX[ch] );
                TonalMDCTConceal_SaveTimeSignal_ivas_fx( st->hTonalMDCTConc, synthFB_fx, q_win, L_frameTCX[ch] );
            }
            decoder_tcx_post_ivas_fx( st, synth_fx, synthFB_fx, q_win, NULL, bfi, MCT_flag );

Loading