Commit b0d4b78f authored by Arthur Tritthart's avatar Arthur Tritthart
Browse files

deactivated macro FIX_ISSUE_1966 and changed code sequence to runtime code,...

deactivated macro FIX_ISSUE_1966 and changed code sequence to runtime code, that should be BE to EVS. Actually, this is a bug fix, that should be corrected in EVS.
parent 64768dfd
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@
#define FIX_1521_SBA_LOUDNESS_STEREO                    /* FhG: issue 1521: Fix loudness for SBA to stereo rendering */
#define FIX_1559                                        /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */

#define FIX_ISSUE_1966                                  /* FhG: Basop issue 1966: shift phase range to [-2PI..+2PI[, handle 4 quadrants */
/*#define FIX_ISSUE_1966*/                              /* FhG: Basop issue 1966: shift phase range to [-2PI..+2PI[, handle 4 quadrants */
                                                        /* FhG: Basop issue 1966: use 32-bit variables for F0 and thresholdModification */
/* ##################### End NON-BE switches ########################### */

+46 −40
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ static void CalcMDXT( const TonalMDCTConcealPtr hTonalMDCTConc, const Word16 typ
static void CalcPowerSpec( const Word32 *mdctSpec, const Word16 mdctSpec_exp, const Word32 *mdstSpec, const Word16 mdstSpec_exp, const Word16 nSamples, const Word16 floorPowerSpectrum, Word32 *powerSpec, Word16 *powerSpec_exp );
static void CalcPowerSpecAndDetectTonalComponents_fx( TonalMDCTConcealPtr const hTonalMDCTConc, Word32 secondLastMDST[], Word16 secondLastMDST_exp, Word32 secondLastMDCT[], Word16 secondLastMDCT_exp, Word32 const pitchLag, const PsychoacousticParameters *psychParamsCurrent, Word16 element_mode );
static void FindPhases( TonalMDCTConcealPtr const hTonalMDCTConc, Word32 secondLastMDCT[], Word32 secondLastMDST[], Word16 diff_exp );
static void FindPhaseDifferences( TonalMDCTConcealPtr const hTonalMDCTConc, Word32 powerSpectrum[] );
static void FindPhaseDifferences( TonalMDCTConcealPtr const hTonalMDCTConc, Word32 powerSpectrum[], const Word16 element_mode );


/*******************************************************/
@@ -598,7 +598,8 @@ static void FindPhases(
/* o: Phase difference [-pi;pi]         2Q13*/
static void FindPhaseDifferences(
    TonalMDCTConcealPtr const hTonalMDCTConc, /* i  : Pointer to internal structure        */
    Word32 powerSpectrum[] )                  /* i  : Power spectrum data Qx                 */
    Word32 powerSpectrum[],                   /* i  : Power spectrum data Qx                 */
    const Word16 element_mode )
{
    Word16 i, k;
    Word16 *phaseDiff;
@@ -627,7 +628,16 @@ static void FindPhaseDifferences(
        {
            phaseDiff[i] = 0; /*(float)tan(0.0f*EVS_PI/bandwidth);*/
            move16();
#ifdef FIX_ISSUE_1966
            IF( EQ_16 (element_mode, EVS_MONO ) )
            {
                if ( s_and( k, 1 ) != 0 )
                {
                    phaseDiff[i] = -12868 /*-EVS_PI 3Q12*/;
                    move16();
                }
            }
            ELSE
            {
                if ( EQ_16( s_and( k, 3 ), 1 ) )
                {
                    phaseDiff[i] = 12868 /* 1*EVS_PI 3Q12*/;
@@ -643,14 +653,7 @@ static void FindPhaseDifferences(
                    phaseDiff[i] = -12868 /*-1*EVS_PI 3Q12*/;
                    move16();
                }

#else
            if ( s_and( k, 1 ) != 0 )
            {
                phaseDiff[i] = -12868 /*-EVS_PI 3Q12*/;
                move16();
            }
#endif
        }
        ELSE
        {
@@ -658,7 +661,16 @@ static void FindPhaseDifferences(
            {
                phaseDiff[i] = 12868 /*EVS_PI 3Q12*/; /*(float)tan(2.0f*PI/bandwidth);*/
                move16();
#ifdef FIX_ISSUE_1966
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
                    if ( s_and( k, 1 ) != 0 )
                    {
                        phaseDiff[i] = 0 /*0 Q13*/; /*2Q13*/
                        move16();
                    }
                }
                ELSE
                {
                    if ( EQ_16( s_and( k, 3 ), 1 ) )
                    {
                        phaseDiff[i] = -25736 /*-2*EVS_PI 3Q12*/;
@@ -674,13 +686,7 @@ static void FindPhaseDifferences(
                        phaseDiff[i] = 0 /* 0*EVS_PI 3Q12*/;
                        move16();
                    }
#else
                if ( s_and( k, 1 ) != 0 )
                {
                    phaseDiff[i] = 0 /*0 Q13*/; /*2Q13*/
                    move16();
                }
#endif
            }
            ELSE
            {
@@ -832,7 +838,7 @@ static void CalcPowerSpecAndDetectTonalComponents_fx(
                              floorPowerSpectrum, psychParamsCurrent, element_mode );
    FindPhases( hTonalMDCTConc, secondLastMDCT, secondLastMDST, sub( secondLastMDST_exp, secondLastMDCT_exp ) );

    FindPhaseDifferences( hTonalMDCTConc, powerSpectrum );
    FindPhaseDifferences( hTonalMDCTConc, powerSpectrum, element_mode );

    IF( hTonalMDCTConc->pTCI->numIndexes > 0 )
    {