Commit c9539e4c authored by vaclav's avatar vaclav
Browse files

issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors; under...

issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors; under NONBE_1118_EVS_LR_HQ_BITERROR
parent 0acdf0fd
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -173,9 +173,9 @@
#define NONBE_1279_COUNTER_OVERFLOW                     /* VA: issue 1279: Avoid possible overflow of counter st->Nb_ACELP_frames */
#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ 
#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD      /* VA/Eri: issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */


#define NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL        /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold to be aligned with BASOP*/
#define NONBE_1118_EVS_LR_HQ_BITERROR                   /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+10 −0
Original line number Diff line number Diff line
@@ -264,6 +264,16 @@ void hq_lr_dec(
        exp = sub( exp, 30 );
        Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */
        Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) );
#ifdef NONBE_1118_EVS_LR_HQ_BITERROR

        /* safety check in case of bit errors */
        if ( Ep_fx[i] > 536788991 /* max(Q30) */ )
        {
            st->BER_detect = 1;
            set_f( yout, 0, inner_frame );
            return;
        }
#endif
    }

    FOR( i = 0; i < bands; i++ )