Commit 2f9f6572 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3gpp issue 971: Waveform discrepency when transitioning from...

Fix for 3gpp issue 971: Waveform discrepency when transitioning from concealing a lost frame to decoding a received frame with SBA bitstream

[x] Changed guard bits logic to avoid saturation
parent 6f1fdf53
Loading
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -790,15 +790,16 @@ void FEC_scale_syn_ivas_fx(
    /*-----------------------------------------------------------------*
     * Find the energy/gain at the end of the frame
     *-----------------------------------------------------------------*/
    IF( LT_16( getScaleFactor16( synth, L_frame ), 2 ) )
    tmp = sub( 3, getScaleFactor16( synth, L_frame ) );
    IF( tmp > 0 )
    {
        Scale_sig( synth, L_frame, -1 );
        frame_ener_fx( L_frame, clas, synth, pitch[sub( shr( L_frame, 6 ), 1 )], &L_enr2 /*Q0*/, 1, sub( Q_syn, 1 ), 3, 0 );
        Scale_sig( synth, L_frame, 1 );
        Word16 synth_tmp[L_FRAME16k];
        Copy_Scale_sig( synth, synth_tmp, L_frame, -tmp ); // Q_synth - tmp
        frame_ener_fx( L_frame, clas, synth_tmp, pitch[L_frame / L_SUBFR - 1], &L_enr2 /*Q0*/, 1, sub( Q_syn, tmp ), 3, 0 );
    }
    ELSE
    {
        frame_ener_fx( L_frame, clas, synth, pitch[sub( shr( L_frame, 6 ), 1 )], &L_enr2 /*Q0*/, 1, Q_syn, 3, 0 );
        frame_ener_fx( L_frame, clas, synth, pitch[L_frame / L_SUBFR - 1], &L_enr2 /*Q0*/, 1, Q_syn, 3, 0 );
    }

    test();