Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,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 */ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ //#define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ Loading lib_dec/fd_cng_dec_fx.c +24 −1 Original line number Diff line number Diff line Loading @@ -1625,8 +1625,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1666,7 +1669,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1679,7 +1686,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1701,7 +1712,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1740,7 +1755,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1753,7 +1772,11 @@ Word16 ApplyFdCng_ivas_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 @@ -66,6 +66,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 */ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ //#define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ Loading
lib_dec/fd_cng_dec_fx.c +24 −1 Original line number Diff line number Diff line Loading @@ -1625,8 +1625,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1666,7 +1669,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1679,7 +1686,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1701,7 +1712,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1740,7 +1755,11 @@ Word16 ApplyFdCng_ivas_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 @@ -1753,7 +1772,11 @@ Word16 ApplyFdCng_ivas_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