Commit 4505e8b3 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

simplyfy

parent e721745e
Loading
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -1714,8 +1714,8 @@ void minimum_statistics_fx(
    Word16 *msPeriodogBufPtr,      /* i/o: Counter                                                   */
    HANDLE_FD_CNG_COM hFdCngCom,   /* i/o: FD_CNG structure containing all buffers and variables */
    const Word16 enc_dec,          /* i  : encoder/decoder indicator */
    const Word16 element_mode,     /* i  : IVAS element mode type    */
    const Word16 isIVAS )
    const Word16 element_mode      /* i  : element mode type    */
)
{
    Word16 i, j, k, s, s1, s2, s3;
    Word16 len2;
@@ -1754,7 +1754,7 @@ void minimum_statistics_fx(
    Word16 *msNoiseEst_buffer16 = (Word16 *) msNoiseEst_buffer;


    if ( EQ_16( isIVAS, 0 ) )
    if ( EQ_16( element_mode, 0 ) )
    {
        (void) enc_dec;
    }
@@ -1779,7 +1779,7 @@ void minimum_statistics_fx(
    {
        Copy( msPeriodog, msPsd, len );            /* 6Q9 */
        Copy( msPeriodog, msPsdFirstMoment, len ); /* 6Q9 */
        IF( isIVAS == 0 )
        IF( element_mode == 0 )
        {

            Copy( msPeriodog, msNoiseFloor_buffer16, len ); /* 6Q9 */
@@ -1901,7 +1901,7 @@ void minimum_statistics_fx(

            /* msPeriodogSum[cnt] with format 16Q15 */
            Word16 msNoiseFloor16tmp[NPART_SHAPING];
            IF( isIVAS == 0 )
            IF( element_mode == 0 )
            {
                snr = dotp_s_fx( msNoiseFloor_buffer16 + start, psize + start, current_len, CNG_HS );
            }
@@ -1940,7 +1940,7 @@ void minimum_statistics_fx(
                test();
                test();
                test();
                IF( ( scalar == 0 ) || ( ( isIVAS == 0 ) ? ( msNoiseFloor_buffer16[j] == 0 ) : ( msNoiseFloor_buffer32[j] == 0 ) ) )
                IF( ( scalar == 0 ) || ( ( element_mode == 0 ) ? ( msNoiseFloor_buffer16[j] == 0 ) : ( msNoiseFloor_buffer32[j] == 0 ) ) )
                {
                    msAlpha[j] = msAlphaHatMin2;
                    move32();
@@ -1951,7 +1951,7 @@ void minimum_statistics_fx(
                    s1 = WORD16_BITS - 1;
                    move16();

                    IF( isIVAS == 0 )
                    IF( element_mode == 0 )
                    {
                        if ( msNoiseFloor_buffer16[j] != 0 )
                        {
@@ -2076,9 +2076,9 @@ void minimum_statistics_fx(
                move16();
                test();
                test();
                IF( ( isIVAS == 0 ) ? ( msNoiseFloor_buffer16[j] != 0 ) : ( msNoiseFloor_buffer32[j] != 0 ) )
                IF( ( element_mode == 0 ) ? ( msNoiseFloor_buffer16[j] != 0 ) : ( msNoiseFloor_buffer32[j] != 0 ) )
                {
                    IF( isIVAS == 0 )
                    IF( element_mode == 0 )
                    {
                        tmp = L_mult( msNoiseFloor_buffer16[j], msNoiseFloor_buffer16[j] );
                    }
@@ -2197,7 +2197,7 @@ void minimum_statistics_fx(
                }
            }
            /* Get the current noise floor */
            IF( isIVAS == 0 )
            IF( element_mode == 0 )
            {
                Copy_Scale_sig_32_16( msCurrentMinOut, msNoiseFloor_buffer16, len, -16 );
            }
@@ -2262,7 +2262,7 @@ void minimum_statistics_fx(
                set32_fx( msCurrentMin, 2147483647l /*1.0 Q31*/, len );

                /* Get the current noise floor */
                IF( isIVAS == 0 )
                IF( element_mode == 0 )
                {
                    Copy_Scale_sig_32_16( msCurrentMinOut, msNoiseFloor_buffer16, len, -16 );
                }
@@ -2328,7 +2328,7 @@ void minimum_statistics_fx(
        }

        /* Smooth noise estimate during CNG phases */
        IF( isIVAS == 0 )
        IF( element_mode == 0 )
        {
            FOR( j = 0; j < len; j++ )
            {
@@ -2348,7 +2348,7 @@ void minimum_statistics_fx(
        }
    }

    IF( isIVAS > 0 )
    IF( element_mode > 0 )
    {
        IF( EQ_16( enc_dec, DEC ) && EQ_16( element_mode, IVAS_CPE_TD ) )
        {
@@ -2376,7 +2376,7 @@ void minimum_statistics_fx(
        {
            scalar = L_mac( scalar, msPeriodogBuf[i], 6554 /*1.0/MSBUFLEN Q15*/ );
        }
        IF( isIVAS == 0 )
        IF( element_mode == 0 )
        {
            scalar16 = round_fx( scalar );
            if ( GT_16( msNoiseEst_buffer16[j], scalar16 ) /*0.0 Q15*/ )
@@ -2393,7 +2393,7 @@ void minimum_statistics_fx(
                move32();
            }
        }
        assert( ( ( isIVAS == 0 ) ? ( msNoiseEst_buffer16[j] >= 0 ) : ( msNoiseEst_buffer32[j] >= 0 ) ) );
        assert( ( ( element_mode == 0 ) ? ( msNoiseEst_buffer16[j] >= 0 ) : ( msNoiseEst_buffer32[j] >= 0 ) ) );
    }
}

+2 −2
Original line number Diff line number Diff line
@@ -4611,8 +4611,8 @@ void minimum_statistics_fx(
    Word16 *msPeriodogBufPtr,      /* i/o: Counter                                                   */
    HANDLE_FD_CNG_COM hFdCngCom,   /* i/o: FD_CNG structure containing all buffers and variables */
    const Word16 enc_dec,          /* i  : encoder/decoder indicator */
    const Word16 element_mode,     /* i  : IVAS element mode type    */
    const Word16 isIVAS );
    const Word16 element_mode      /* i  : element mode type    */
);
#else
void minimum_statistics(
    Word16 len,                    /* i  : Total number of partitions (CLDFB or FFT)                   */
+2 −8
Original line number Diff line number Diff line
@@ -1304,8 +1304,7 @@ void perform_noise_estimation_dec_fx(
            &( hFdCngDec->msPeriodogBufPtr ),
            hFdCngDec->hFdCngCom,
            DEC,
            EVS_MONO,
            0 );
            EVS_MONO );
#else
        minimum_statistics(
            npart,
@@ -2127,12 +2126,7 @@ void perform_noise_estimation_dec_ivas_fx(
            hFdCngDec->msPeriodogBuf,
            &( hFdCngDec->msPeriodogBufPtr ),
            hFdCngDec->hFdCngCom,
            DEC, element_mode
#ifdef FIX_2485_HARMONIZE_minimum_statistics
            ,
            1
#endif
        );
            DEC, element_mode );

        FOR( i = 0; i < hFdCngDec->npart_shaping; i++ )
        {
+0 −1
Original line number Diff line number Diff line
@@ -2143,7 +2143,6 @@ void perform_noise_estimation_enc_fx(
        &( hFdCngEnc->msPeriodogBufPtr ),
        hFdCngEnc->hFdCngCom,
        ENC,
        ( hCPE == NULL ) ? EVS_MONO : hCPE->element_mode,
        element_mode );