Commit 966df910 authored by Manuel Jander's avatar Manuel Jander
Browse files

Change NONBE_FIX_2493_CHECK_EXTRACT_L_E_LPC_a_isp_conversion fix to just...

Change NONBE_FIX_2493_CHECK_EXTRACT_L_E_LPC_a_isp_conversion fix to just saturate and avoid any deviation because this function is very error sensitive, even again higher precision.
parent d15b07ab
Loading
Loading
Loading
Loading
Loading
+6 −19
Original line number Diff line number Diff line
@@ -291,14 +291,8 @@ void E_LPC_a_isp_conversion( const Word16 a[], Word16 isp[], const Word16 old_is
                tmp = div_s( (Word16) 16383, tmp );
                t0 = L_mult( x, tmp );
#ifdef NONBE_FIX_2493_CHECK_EXTRACT_L_E_LPC_a_isp_conversion
                t0 = L_shr( t0, sub( 20 - 6, exp ) );

                /* Restore Sign */
                if ( y < 0 )
                    t0 = L_negate( t0 );

                t0 = Mpy_32_16_1( t0, ylow );
                t0 = L_shr( t0, 1 ); /* result in Q15 */
                t0 = L_shr_sat( t0, sub( 20 - 16, exp ) );
                tmp = extract_h( t0 ); /* y = (xhigh-xlow)/(yhigh-ylow) in Q11 */
#else
                t0 = L_shr( t0, sub( 20, exp ) );
#ifdef FIX_2493_CHECK_EXTRACT_L
@@ -306,14 +300,13 @@ void E_LPC_a_isp_conversion( const Word16 a[], Word16 isp[], const Word16 old_is
#else
                tmp = extract_l( t0 ); /* y = (xhigh-xlow)/(yhigh-ylow) in Q11 */
#endif

#endif
                /* Restore Sign */
                if ( y < 0 )
                    tmp = negate( tmp );

                t0 = L_mult( ylow, tmp ); /* result in Q26 */
                t0 = L_shr( t0, 11 );     /* result in Q15 */
#endif
#ifdef FIX_2493_CHECK_EXTRACT_L
                xlow = sub( xlow, extract_l2( t0 ) ); /* xint = xlow - ylow*y */
#else
@@ -1168,20 +1161,15 @@ void E_LPC_a_lsp_conversion(
                tmp = div_s( (Word16) 16383 / 2, tmp );
                t0 = L_mult( x, tmp );
#ifdef NONBE_FIX_2493_CHECK_EXTRACT_L_E_LPC_a_isp_conversion
                t0 = L_shr( t0, sub( 20 - 6, exp ) );

                /* Restore Sign */
                if ( y < 0 )
                    t0 = L_negate( t0 );

                t0 = Mpy_32_16_1( t0, ylow );
                t0 = L_shr( t0, 1 ); /* result in Q15 */
                t0 = L_shr_sat( t0, sub( 20 - 16, exp ) );
                tmp = extract_h( t0 ); /* y = (xhigh-xlow)/(yhigh-ylow) in Q11 */
#else
                t0 = L_shr( t0, sub( 20, exp ) );
#ifdef FIX_2493_CHECK_EXTRACT_L
                tmp = extract_l2( t0 ); /* y = (xhigh-xlow)/(yhigh-ylow) in Q11 */
#else
                tmp = extract_l( t0 ); /* y = (xhigh-xlow)/(yhigh-ylow) in Q11 */
#endif
#endif

                /* Restore Sign */
@@ -1190,7 +1178,6 @@ void E_LPC_a_lsp_conversion(

                t0 = L_mult( ylow, tmp ); /* result in Q26 */
                t0 = L_shr( t0, 11 );     /* result in Q15 */
#endif
#ifdef FIX_2493_CHECK_EXTRACT_L
                xlow = sub( xlow, extract_l2( t0 ) ); /* xint = xlow - ylow*y */
#else
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@
#define NONBE_FIX_2493_CHECK_EXTRACT_L_WB_BWE_gain_pred_fx /* FhG: Fix extract_l overflow inside WB_BWE_gain_pred_fx() (EVS). Saturation, not a optimal fix. */
#define NONBE_FIX_2493_CHECK_EXTRACT_L_cftmdl_16fx      /* FhG: Fix extract_l overflow inside cftmdl_16fx() (EVS). Saturation, not a optimal fix. */
#define NONBE_FIX_2493_EXTRACT_L_acelp_core_dec_fx      /* FhG: Fix extract_l overflow inside acelp_core_dec_fx() */
#define NONBE_FIX_2493_CHECK_EXTRACT_L_E_LPC_a_isp_conversion /* FhG: Fix extract_l overflow inside E_LPC_a_isp_conversion() (EVS) */
#define NONBE_FIX_2493_CHECK_EXTRACT_L_E_LPC_a_isp_conversion /* FhG: Fix extract_l overflow inside E_LPC_a_isp_conversion() (EVS). Saturation, not a optimal fix. */
#define NONBE_FIX_2493_CHECK_EXTRACT_L_acelp_fast_fx    /* FhG: Fix extract_l overflow inside acelp_fast_fx(). Saturation, not a optimal fix. */
#define NONBE_FIX_2493_CHECK_EXTRACT_L_envelop_modify_fx /* FhG: Fix extract_l overflow inside envelop_modify_fx() */
#define NONBE_FIX_2493_CHECK_EXTRACT_L_swb_tbe_enc_fx   /* FhG: Fix extract_l overflow inside swb_tbe_enc_fx() */