Commit 0d950830 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '1762-usage-of-w_mac_32_32-one_in_q30' into 'main'

Resolve "Usage of W_mac_32_32() + ONE_IN_Q30"

Closes #1762

See merge request !1820
parents 92d42d8a 97bae97b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -122,4 +122,6 @@

#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE                    /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */

#define FIX_1762_COMPILER_ISSUE                 /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */

#endif
+4 −0
Original line number Diff line number Diff line
@@ -642,7 +642,11 @@ void ivas_analy_sp_fx(
        move32();

        /* PS[i] = ( Bin_E[i] + 1e-5f + Bin_E[i + L_FFT / 2] + 1e-5f ) / 2.0f; */
#ifndef FIX_1762_COMPILER_ISSUE
        PS[i] = W_extract_h( W_add( W_mac_32_32( W_mult_32_32( Bin_E[i], ONE_IN_Q30 ), Bin_E[i + L_FFT / 2], ONE_IN_Q30 ), W_shr( W_shl( add_const, 32 ), sub( 31, *q_Bin_E ) ) ) ); // *q_Bin_E
#else
        PS[i] = W_extract_h( W_add( W_shl( W_add( W_deposit32_l( Bin_E[i] ), W_deposit32_l( Bin_E[i + L_FFT / 2] ) ), 31 ), W_shr( W_shl( add_const, 32 ), sub( 31, *q_Bin_E ) ) ) ); // *q_Bin_E
#endif
        move32();

        /* Bin_E[i] = (float) ( 10.0f * log( PS[i] ) ); */
+7 −3
Original line number Diff line number Diff line
@@ -324,7 +324,11 @@ void find_tilt_ivas_fx(
    }
    lp_bckr = W_shl_sat_l( sum, -16 );                        // q_bckr
    /*hp_bckr = 0.5f * (bckr[max_band-1] + bckr[max_band]);*/ /* estimated noise E in last 2 critical bands */
#ifndef FIX_1762_COMPILER_ISSUE
    hp_bckr = W_extract_h( W_mac_32_32( W_mult_32_32( bckr[max_band - 1], ONE_IN_Q30 ), bckr[max_band], ONE_IN_Q30 ) ); // q_bckr
#else
    hp_bckr = W_extract_h( W_shl( W_add( W_deposit32_l( bckr[max_band - 1] ), W_deposit32_l( bckr[max_band] ) ), 31 ) ); // q_bckr
#endif
    if ( hp_bckr == 0 ) /* Avoid division by zero. */
    {
        hp_bckr = L_deposit_l( 1 );