Commit b496715c authored by multrus's avatar multrus
Browse files

fix for overflow; brings float inline with BASOP

parent 70afcc91
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define CODE_IMPROVEMENTS                               /* FhG: Small code improvements that do not change the functionality */
#define FIX_1348_OVERFLOW                               /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */

/* #################### End BE switches ################################## */

+8 −0
Original line number Diff line number Diff line
@@ -262,7 +262,15 @@ void hq_lr_dec(
        frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */
        L_tmp = Pow2( 30, frac1 );
        exp = sub( exp, 30 );
#ifdef FIX_1348_OVERFLOW
#ifdef BASOP_NOGLOB
        Ep_fx[i] = L_shl_o( L_tmp, sub( exp, 6 ), &Overflow ); /* Q -6 */
#else
        Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */
#endif
#else
        Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) );                        /* Q -6 */
#endif
        Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) );
    }