Commit 7f89d0d5 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_2371_REMOVE_UNUSED_ISAR_FCNS

parent 448b4fb2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -84,7 +84,6 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */
#define FIX_2371_REMOVE_UNUSED_ISAR_FCNS                /* Dolby: basop issue 2371: remove unused ISAR-related functions */      
#define FIX_2384_INIT_DEQUANT_COV                       /* FhG: basop issue 2384: only read initialized values from Cy_buf_e[k] in ivas_param_mc_dequantize_cov_fx() during renormalization */
#define FIX_2383_INIT_Q_A_ITF                           /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
+0 −204
Original line number Diff line number Diff line
@@ -83,37 +83,6 @@ static inline Word16 LogAdd_fx(
    return iRetVal;
}

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS

/*------------------------------------------------------------------------------------------*
 * Function LogAdd()
 *
 *
 *------------------------------------------------------------------------------------------*/

static inline Word32 LogAdd(
    const Word32 iVal1,
    const Word32 iVal2 )
{
    Word32 iRetVal;

    if ( iVal1 > iVal2 )
    {
        iRetVal = iVal1 - iVal2;
        iRetVal = ( iRetVal < ( LOG_ADD_TABLE_LENGTH - 1 ) ) ? iRetVal : ( LOG_ADD_TABLE_LENGTH - 1 );
        iRetVal = iVal1 + c_aiLogAddTable[iRetVal];
    }
    else
    {
        iRetVal = iVal2 - iVal1;
        iRetVal = ( iRetVal < ( LOG_ADD_TABLE_LENGTH - 1 ) ) ? iRetVal : ( LOG_ADD_TABLE_LENGTH - 1 );
        iRetVal = iVal2 + c_aiLogAddTable[iRetVal];
    }

    return iRetVal;
}

#endif

/*------------------------------------------------------------------------------------------*
 * Function PerceptualModel()
@@ -178,66 +147,6 @@ void PerceptualModel_fx(
    return;
}

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS

/*------------------------------------------------------------------------------------------*
 * Function PerceptualModel()
 *
 *
 *------------------------------------------------------------------------------------------*/

void PerceptualModel(
    const Word32 iMaxQuantBands,
    const Word32 *piRMSEnvelope,
    Word32 *piExcitation,
    Word32 *piSMR )
{
    Word32 n;

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        Word32 iSLOffset;

        piExcitation[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n];

        /* Calculate sensation level offset */
        iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT;
        // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0;

        /* Offset envelope by sensation level offset */
        piExcitation[n] -= iSLOffset;

        /* Convert to loudness domain (x^0.3) */
        piExcitation[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT;
    }

    /* Spread excitation function */
    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        Word32 k;
        const Word32 *piSpread;

        piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48];
        piSMR[n] = piExcitation[n] + piSpread[n];
        for ( k = 0; k < iMaxQuantBands; k++ )
        {
            if ( k != n )
            {
                piSMR[n] = LogAdd( piSMR[n], piExcitation[k] + piSpread[k] );
            }
        }
    }

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        piSMR[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT;
        piSMR[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n] - piSMR[n];
    }

    return;
}

#endif


/*------------------------------------------------------------------------------------------*
@@ -246,119 +155,6 @@ void PerceptualModel(
 *
 *------------------------------------------------------------------------------------------*/

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS

void PerceptualModelStereo(
    const Word32 iMaxQuantBands,
    const Word32 *piMSFlags,
    const Word32 *piRMSEnvelope0,
    const Word32 *piRMSEnvelope1,
    Word32 *piExcitation0,
    Word32 *piExcitation1,
    Word32 *piSMR0,
    Word32 *piSMR1 )
{
    Word32 n;

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        Word32 iMaxRMSEnv;
        Word32 iSLOffset;

        iMaxRMSEnv = piRMSEnvelope0[n];

        piExcitation0[n] = PERCEPTUAL_MODEL_SCALE * iMaxRMSEnv + c_aiBandwidthAdjust48[n]; /* piRMSEnvelope0[n] */

        /* Calculate sensation level offset */
        iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation0[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT;
        // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0;

        /*  Offset envelope by sensation level offset */
        piExcitation0[n] -= iSLOffset;

        /* Convert to loudness domain (x^0.3) */
        piExcitation0[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation0[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT;
    }

    /* Spread excitation function */
    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        Word32 k;
        const Word32 *piSpread;

        piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48];
        piSMR0[n] = piExcitation0[n] + piSpread[n];
        for ( k = 0; k < iMaxQuantBands; k++ )
        {
            if ( k != n )
            {
                piSMR0[n] = LogAdd( piSMR0[n], piExcitation0[k] + piSpread[k] );
            }
        }
    }

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        Word32 iMaxRMSEnv;
        Word32 iSLOffset;

        iMaxRMSEnv = piRMSEnvelope1[n];

        piExcitation1[n] = PERCEPTUAL_MODEL_SCALE * iMaxRMSEnv + c_aiBandwidthAdjust48[n]; /* piRMSEnvelope1[n] */

        /* Calculate sensation level offset */
        iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation1[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT;
        // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0;

        /*  Offset envelope by sensation level offset */
        piExcitation1[n] -= iSLOffset;

        /* Convert to loudness domain (x^0.3) */
        piExcitation1[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation1[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT;
    }

    /* Spread excitation function */
    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        Word32 k;
        const Word32 *piSpread;

        piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48];
        piSMR1[n] = piExcitation1[n] + piSpread[n];
        for ( k = 0; k < iMaxQuantBands; k++ )
        {
            if ( k != n )
            {
                piSMR1[n] = LogAdd( piSMR1[n], piExcitation1[k] + piSpread[k] );
            }
        }
    }

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        if ( piMSFlags[n] == 1 )
        {
            piSMR0[n] = ( piSMR0[n] > piSMR1[n] ) ? piSMR0[n] : piSMR1[n];
            piSMR1[n] = piSMR0[n];
        }
    }

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        piSMR0[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR0[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT;
        piSMR0[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope0[n] + c_aiBandwidthAdjust48[n] - piSMR0[n];
    }

    for ( n = 0; n < iMaxQuantBands; n++ )
    {
        piSMR1[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR1[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT;
        piSMR1[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope1[n] + c_aiBandwidthAdjust48[n] - piSMR1[n];
    }

    return;
}

#endif

void PerceptualModelStereo_fx(
    const Word32 iMaxQuantBands,
+0 −18
Original line number Diff line number Diff line
@@ -359,24 +359,6 @@ Word16 ReadPredictors_fx(
    return iBitsRead;
}

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS
/* PLC_IMPROVEMENT */
void SetDecodingPassed(
    PredictionDecoder *psPredictionDecoder )
{
    Word32 n, ch;

    for ( ch = 0; ch < psPredictionDecoder->iChannels; ch++ )
    {
        for ( n = 0; n < psPredictionDecoder->iNumSubSets; n++ )
        {
            psPredictionDecoder->ppiDecodingFailed[ch][n] = 0;
        }
    }

    return;
}
#endif


Word32 AnyDecodingUnresolved(
+0 −12
Original line number Diff line number Diff line
@@ -772,18 +772,6 @@ Word32 EncodeLCLDFrame(
    return 0;
}

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS
/*------------------------------------------------------------------------------------------*
 * Function GetNumGroups()
 *
 *
 *------------------------------------------------------------------------------------------*/

Word32 GetNumGroups( LCLDEncoder *psLCLDEncoder )
{
    return psLCLDEncoder->piNumGroups[0];
}
#endif

/*------------------------------------------------------------------------------------------*
 * Local functions
+0 −30
Original line number Diff line number Diff line
@@ -65,11 +65,6 @@ Word32 EncodeLCLDFrame(
    Word16 *q_final
);

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS
Word32 GetNumGroups(
    LCLDEncoder *psLCLDEncoder
);
#endif

typedef struct LCLD_DECODER LCLDDecoder;

@@ -176,14 +171,6 @@ Word32 CountMSBits(
 * PereptualModel prototypes
 *----------------------------------------------------------------------------------*/

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS
extern void PerceptualModel(
    const Word32 iMaxQuantBands,
    const Word32 *piRMSEnvelope,
    Word32 *piExcitation,
    Word32 *piSMR 
);
#endif

extern void PerceptualModel_fx(
    const Word32 iMaxQuantBands,
@@ -203,18 +190,6 @@ extern void PerceptualModelStereo_fx(
    Word32 *piSMR1 
);

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS
extern void PerceptualModelStereo(
    const Word32 iMaxQuantBands,
    const Word32 *piMSFlags,
    const Word32 *piRMSEnvelope0,
    const Word32 *piRMSEnvelope1,
    Word32 *piExcitation0,
    Word32 *piExcitation1,
    Word32 *piSMR0,
    Word32 *piSMR1 
);
#endif

/*----------------------------------------------------------------------------------*
 * PredEncoder/PredDecoder prototypes
@@ -346,11 +321,6 @@ Word32 **GetDecodingFailedPrevStatus(
    LCLDDecoder *psLCLDDecoder
);

#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS
void SetDecodingPassed(
    PredictionDecoder *psPredictionDecoder
);
#endif

void UpdateDecodingUnresolved(
    PredictionDecoder *psPredictionDecoder