Commit 20cd84fa authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Reverted factEQ_fx precision improvement.

parent 8c599303
Loading
Loading
Loading
Loading
Loading
+2 −25
Original line number Diff line number Diff line
@@ -992,19 +992,7 @@ static void ivas_binaural_obtain_DMX_fx(
                set32_fx( imagDMX[chOutIdx][k], 0, CLDFB_NO_CHANNELS_MAX );
            }
        }
#ifdef FIX_1835_REVERB_ACTIVATION
        Word16 scaleFactor = s_min( getScaleFactor32( RealBuffer[0], CLDFB_SLOTS_PER_SUBFRAME * CLDFB_NO_CHANNELS_MAX ),
                                    getScaleFactor32( ImagBuffer[0], CLDFB_SLOTS_PER_SUBFRAME * CLDFB_NO_CHANNELS_MAX ) );
        FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
        {
            scaleFactor = s_min( getScaleFactor32( RealBuffer[chIdx], CLDFB_SLOTS_PER_SUBFRAME * CLDFB_NO_CHANNELS_MAX ),
                                 getScaleFactor32( ImagBuffer[chIdx], CLDFB_SLOTS_PER_SUBFRAME * CLDFB_NO_CHANNELS_MAX ) );
        }
        if ( scaleFactor > 6 )
            scaleFactor -= 6; // Adding headroom for subsequent calculations
        else
            scaleFactor = 0;
#endif

        FOR( chOutIdx = 0; chOutIdx < BINAURAL_CHANNELS; chOutIdx++ )
        {
            set32_fx( P_in_fx, 0, hBinRenderer->conv_band );
@@ -1024,10 +1012,6 @@ static void ivas_binaural_obtain_DMX_fx(
                        move32();
                        imagDMX[chOutIdx][k][bandIdx] = L_add( imagDMX[chOutIdx][k][bandIdx], temp2_fx ); // Q_in
                        move32();
#ifdef FIX_1835_REVERB_ACTIVATION
                        temp1_fx = L_shl( temp1_fx, scaleFactor );
                        temp2_fx = L_shl( temp2_fx, scaleFactor );
#endif
                        P_in_fx[bandIdx] = L_add( P_in_fx[bandIdx], L_add( Mpy_32_32( temp1_fx, temp1_fx ), Mpy_32_32( temp2_fx, temp2_fx ) ) ); // Q31-2*Q_in
                        move32();
                    }
@@ -1040,17 +1024,10 @@ static void ivas_binaural_obtain_DMX_fx(
                move32();
                FOR( k = 0; k < numTimeSlots; k++ )
                {
#ifdef FIX_1835_REVERB_ACTIVATION
                    temp1_fx = L_shl( realDMX[chOutIdx][k][bandIdx], scaleFactor );
                    move32();
                    temp2_fx = L_shl( imagDMX[chOutIdx][k][bandIdx], scaleFactor );
                    move32();
#else
                    temp1_fx = realDMX[chOutIdx][k][bandIdx];
                    move32();
                    temp2_fx = imagDMX[chOutIdx][k][bandIdx];
                    move32();
#endif
                    P_out_fx = L_add( P_out_fx, L_add( Mpy_32_32( temp1_fx, temp1_fx ), Mpy_32_32( temp2_fx, temp2_fx ) ) ); // Q31-2*Q_in
                }
                test();
@@ -1063,7 +1040,7 @@ static void ivas_binaural_obtain_DMX_fx(
                {
                    Word16 div = divide3232( P_in_fx[bandIdx], P_out_fx );
#ifdef FIX_1835_REVERB_ACTIVATION
                    Word16 exp = 0; // divide3232 gives Q15 + following Q16 shift
                    Word16 exp = 0; // divide3232 returns Q15 + following Q16 shift
#else
                    Word16 exp = norm_l( div );
#endif