Commit 8cd1cc04 authored by Nicolas Roussin's avatar Nicolas Roussin
Browse files

Optimize matrixDiagMul_fx format fix.

parent 1e26af97
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@

*******************************************************************************************************/

#include "move.h"
#include <stdint.h>
#include "options.h"
#include "ivas_cnst.h"
@@ -40,6 +39,7 @@
#include "ivas_stat_enc.h"
#include <math.h>
#include "wmc_auto.h"
#include "move.h"
#include "ivas_prot_fx.h"


+18 −2
Original line number Diff line number Diff line
@@ -3932,7 +3932,10 @@ static void matrixDiagMul_fx(
    Word16 *q_Out )
{
    Word16 chA, chB;
    Word16 size = i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS );
    
#ifdef OPT_2185_MATRIX_OUT_SCALING
    Word32 not_zero = 0;
#endif

    FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ )
    {
@@ -3942,17 +3945,30 @@ static void matrixDiagMul_fx(
            imOut_fx[chA][chB] = Mpy_32_32( imIn_fx[chA][chB], D_fx[chB] );
            move32();
            move32();
#ifdef OPT_2185_MATRIX_OUT_SCALING
            not_zero = L_or( not_zero, reOut_fx[chA][chB] );
            not_zero = L_or( not_zero, imOut_fx[chA][chB] );
#endif
        }
    }

    *q_Out = sub( add( q_In, q_D ), 31 );
    move16();

#ifdef OPT_2185_MATRIX_OUT_SCALING
    if ( !not_zero )
    {
        *q_Out = Q31;
        move16();
    }
#else
    Word16 size = i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS );
    if ( L_and( is_zero_arr( reOut_fx[0], size ), is_zero_arr( imOut_fx[0], size ) ) )
    {
        *q_Out = Q31;
        move16();
    }
#endif
    

    return;
}