Commit 1b3a8fac authored by norvell's avatar norvell Committed by Sandesh Venkatesh
Browse files

Rename switch to FIX_732_MS_PERIODOG_FLOOR

parent 3b9fb3d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@
#ifndef BASOP_NOGLOB_DEV_USE_GLOBALS
#define BASOP_NOGLOB_DECLARE_LOCAL
#endif
#define FIX_732                                 /* Eri: Fix for precision issue in CNG generation -- still work in progress */
#define FIX_732_MS_PERIODOG_FLOOR                /* Eri: Issue-732: Dynamic range of msPeriodog leads to minimum value 1e-5 being truncated to zero. This uses the smallest non-zero value instead. */

#define FIX_867_CLDFB_NRG_SCALE

+6 −20
Original line number Diff line number Diff line
@@ -1117,6 +1117,7 @@ Word16 ApplyFdCng_fx(
                        *cngNoiseLevel_exp = hFdCngCom->sidNoiseEstExp;
                        move16();
                    }

                    s2 = -( ( WORD32_BITS - 1 ) );
                    move16();
                    /* Shape the SID noise levels in each FFT bin */
@@ -1296,14 +1297,6 @@ Word16 ApplyFdCng_fx(
    }


    dbgwrite( hFdCngDec->bandNoiseShape, sizeof( Word32 ), 320, 1, "bandNoiseShape.int" );
    dbgwrite( &hFdCngDec->bandNoiseShape_exp, sizeof( short ), 1, 1, "bandNoiseShape_exp.short" );

    dbgwrite( cngNoiseLevel, sizeof( Word32 ), 340, 1, "cngNoiseLevel.int" );
    dbgwrite( cngNoiseLevel_exp, sizeof( short ), 1, 1, "cngNoiseLevel_exp.short" );
    dbgwrite( &frame, sizeof( int ), 1, 1, "frame.int" );


    return 0;
}

@@ -1507,7 +1500,7 @@ void perform_noise_estimation_dec_ivas_fx(
    Word32 enr, enr_tot, enr_tot0;
    Word16 enr_e, enr_ratio, alpha;
    Word32 *msPeriodog;
#ifdef FIX_732
#ifdef FIX_732_MS_PERIODOG_FLOOR
    Word32 msPeriodog_floor;
#endif
    Word32 *msNoiseEst;
@@ -1715,14 +1708,14 @@ void perform_noise_estimation_dec_ivas_fx(

                msPeriodog[p] = L_add( msPeriodog[p], L_tmp ); /*Q31 - hFdCngDec->msPeriodog_exp*/
                move32();
#ifdef FIX_732
#ifdef FIX_732_MS_PERIODOG_FLOOR
                msPeriodog_floor = L_max( 1, L_shr( 21474 /*Q31*/, hFdCngDec->msPeriodog_exp ) );
                IF( LT_32( msPeriodog[p], msPeriodog_floor ) )
#else
                IF( LT_32( msPeriodog[p], L_shr( 21474 /*Q31*/, hFdCngDec->msPeriodog_exp ) ) )
#endif
                {
#ifdef FIX_732
#ifdef FIX_732_MS_PERIODOG_FLOOR
                    msPeriodog[p] = msPeriodog_floor;
#else
                    msPeriodog[p] = L_shr( 21474 /*Q31*/, hFdCngDec->msPeriodog_exp ); /*Q31 - hFdCngDec->msPeriodog_exp*/
@@ -2100,13 +2093,6 @@ void perform_noise_estimation_dec_ivas_fx(
        /* Expand partitions into bins of power spectrum */
        scalebands_fx( msNoiseEst, part, nFFTpart, hFdCngDec->midband_shaping, nFFTpart, sub( stopFFTbin, startBand ), hFdCngDec->bandNoiseShape, 1 );
        hFdCngDec->bandNoiseShape_exp = hFdCngDec->msNoiseEst_exp;

        dbgwrite( msNoiseEst, sizeof( int ), 62, 1, "msNoiseEst.int" );
        dbgwrite( &hFdCngDec->msNoiseEst_exp, sizeof( short ), 1, 1, "msNoiseEst_exp.short" );
        dbgwrite( msPeriodog, sizeof( int ), 62, 1, "msPeriodog.int" );
        dbgwrite( &hFdCngDec->msPeriodog_exp, sizeof( short ), 1, 1, "msPeriodog_exp.short" );


        move16();
        Copy32( hFdCngDec->bandNoiseShape, &hFdCngDec->smoothed_psd_fx[startBand], sub( stopFFTbin, startBand ) ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/
        hFdCngDec->smoothed_psd_exp = hFdCngDec->bandNoiseShape_exp;