Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -67,6 +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_867_CLDFB_NRG_SCALE Loading lib_dec/fd_cng_dec_fx.c +24 −1 Original line number Diff line number Diff line Loading @@ -1117,8 +1117,11 @@ Word16 ApplyFdCng_fx( *cngNoiseLevel_exp = hFdCngCom->sidNoiseEstExp; move16(); } #ifdef FIX_732 s2 = ( sub( WORD32_BITS, 1 ) ); #else s2 = -( ( WORD32_BITS - 1 ) ); #endif move16(); /* Shape the SID noise levels in each FFT bin */ j = 0; Loading Loading @@ -1158,7 +1161,11 @@ Word16 ApplyFdCng_fx( facTabExp[k] = -( ( WORD32_BITS - 1 ) ); move16(); } #ifdef FIX_732 s2 = s_min( s2, facTabExp[k] ); #else s2 = s_max( s2, facTabExp[k] ); #endif } if ( EQ_16( s2, -31 ) ) { Loading @@ -1171,7 +1178,11 @@ Word16 ApplyFdCng_fx( s = s_max( s_min( s, ( WORD32_BITS - 1 ) ), -( ( WORD32_BITS - 1 ) ) ); FOR( ; j <= hFdCngCom->part[k]; j++ ) { #ifdef FIX_732 cngNoiseLevel[j] = L_shl_sat( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #else cngNoiseLevel[j] = L_shl( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #endif move32(); } } Loading Loading @@ -1209,7 +1220,11 @@ Word16 ApplyFdCng_fx( { IF( !( LT_16( hFdCngCom->msFrCnt_init_counter, hFdCngCom->msFrCnt_init_thresh ) ) ) { #ifdef FIX_732 s2 = ( sub( WORD32_BITS, 1 ) ); #else s2 = -( ( WORD32_BITS - 1 ) ); #endif /* Shape the SID noise levels in each FFT bin */ j = 0; move16(); Loading Loading @@ -1248,7 +1263,11 @@ Word16 ApplyFdCng_fx( facTabExp[k] = -( WORD32_BITS - 1 ); move16(); } #ifdef FIX_732 s2 = s_min( s2, facTabExp[k] ); #else s2 = s_max( s2, facTabExp[k] ); #endif } IF( EQ_16( s2, -31 ) ) { Loading @@ -1261,7 +1280,11 @@ Word16 ApplyFdCng_fx( s = s_max( s_min( s, sub( WORD32_BITS, 1 ) ), negate( sub( WORD32_BITS, 1 ) ) ); FOR( ; j <= hFdCngCom->part[k]; j++ ) { #ifdef FIX_732 cngNoiseLevel[j] = L_shl_sat( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #else cngNoiseLevel[j] = L_shl( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #endif move32(); } } Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -67,6 +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_867_CLDFB_NRG_SCALE Loading
lib_dec/fd_cng_dec_fx.c +24 −1 Original line number Diff line number Diff line Loading @@ -1117,8 +1117,11 @@ Word16 ApplyFdCng_fx( *cngNoiseLevel_exp = hFdCngCom->sidNoiseEstExp; move16(); } #ifdef FIX_732 s2 = ( sub( WORD32_BITS, 1 ) ); #else s2 = -( ( WORD32_BITS - 1 ) ); #endif move16(); /* Shape the SID noise levels in each FFT bin */ j = 0; Loading Loading @@ -1158,7 +1161,11 @@ Word16 ApplyFdCng_fx( facTabExp[k] = -( ( WORD32_BITS - 1 ) ); move16(); } #ifdef FIX_732 s2 = s_min( s2, facTabExp[k] ); #else s2 = s_max( s2, facTabExp[k] ); #endif } if ( EQ_16( s2, -31 ) ) { Loading @@ -1171,7 +1178,11 @@ Word16 ApplyFdCng_fx( s = s_max( s_min( s, ( WORD32_BITS - 1 ) ), -( ( WORD32_BITS - 1 ) ) ); FOR( ; j <= hFdCngCom->part[k]; j++ ) { #ifdef FIX_732 cngNoiseLevel[j] = L_shl_sat( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #else cngNoiseLevel[j] = L_shl( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #endif move32(); } } Loading Loading @@ -1209,7 +1220,11 @@ Word16 ApplyFdCng_fx( { IF( !( LT_16( hFdCngCom->msFrCnt_init_counter, hFdCngCom->msFrCnt_init_thresh ) ) ) { #ifdef FIX_732 s2 = ( sub( WORD32_BITS, 1 ) ); #else s2 = -( ( WORD32_BITS - 1 ) ); #endif /* Shape the SID noise levels in each FFT bin */ j = 0; move16(); Loading Loading @@ -1248,7 +1263,11 @@ Word16 ApplyFdCng_fx( facTabExp[k] = -( WORD32_BITS - 1 ); move16(); } #ifdef FIX_732 s2 = s_min( s2, facTabExp[k] ); #else s2 = s_max( s2, facTabExp[k] ); #endif } IF( EQ_16( s2, -31 ) ) { Loading @@ -1261,7 +1280,11 @@ Word16 ApplyFdCng_fx( s = s_max( s_min( s, sub( WORD32_BITS, 1 ) ), negate( sub( WORD32_BITS, 1 ) ) ); FOR( ; j <= hFdCngCom->part[k]; j++ ) { #ifdef FIX_732 cngNoiseLevel[j] = L_shl_sat( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #else cngNoiseLevel[j] = L_shl( Mpy_32_16_1( hFdCngDec->bandNoiseShape[j], facTab[k] ), s ); /*Q31 - hFdCngDec->bandNoiseShape_exp*/ #endif move32(); } } Loading