Loading lib_com/fd_cng_com_fx.c +20 −13 Original line number Diff line number Diff line Loading @@ -1714,7 +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 element_mode, /* i : IVAS element mode type */ const Word16 isIVAS ) { Word16 i, j, k, s, s1, s2, s3; Loading Loading @@ -1781,7 +1782,7 @@ void minimum_statistics_fx( IF( LT_16( hFdCngCom->msFrCnt_init_counter, hFdCngCom->msFrCnt_init_thresh ) ) { #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { Copy( msPeriodog, msPsd, len ); /* 6Q9 */ Copy( msPeriodog, msNoiseFloor_buffer16, len ); /* 6Q9 */ Loading Loading @@ -1922,7 +1923,7 @@ void minimum_statistics_fx( /* msPeriodogSum[cnt] with format 16Q15 */ Word16 msNoiseFloor16tmp[NPART_SHAPING]; #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { snr = dotp_s_fx( msNoiseFloor_buffer16 + start, psize + start, current_len, CNG_HS ); } Loading Loading @@ -1970,7 +1971,10 @@ void minimum_statistics_fx( /* Compute optimal smoothing parameter for PSD estimation */ test(); #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( ( scalar == 0 ) || ( ( element_mode == 0 ? msNoiseFloor_buffer16[j] : msNoiseFloor_buffer32[j] ) == 0 ) ) test(); test(); test(); IF( ( scalar == 0 ) || ( ( isIVAS == 0 ) ? ( msNoiseFloor_buffer16[j] == 0 ) : ( msNoiseFloor_buffer32[j] == 0 ) ) ) #else IF( ( scalar == 0 ) || ( msNoiseFloor_buffer[j] == 0 ) ) #endif Loading @@ -1984,7 +1988,7 @@ void minimum_statistics_fx( s1 = WORD16_BITS - 1; move16(); #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { if ( msNoiseFloor_buffer16[j] != 0 ) { Loading Loading @@ -2124,13 +2128,15 @@ void minimum_statistics_fx( QeqInv = MSQEQINVMAX; move16(); #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( ( element_mode == 0 ? msNoiseFloor_buffer16[j] : msNoiseFloor_buffer32[j] ) != 0 ) test(); test(); IF( ( isIVAS == 0 ) ? ( msNoiseFloor_buffer16[j] != 0 ) : ( msNoiseFloor_buffer32[j] != 0 ) ) #else IF( msNoiseFloor_buffer[j] != 0 /*0.0 Q15*/ ) #endif { #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { tmp = L_mult( msNoiseFloor_buffer16[j], msNoiseFloor_buffer16[j] ); } Loading Loading @@ -2260,7 +2266,7 @@ void minimum_statistics_fx( } /* Get the current noise floor */ #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { Copy_Scale_sig_32_16( msCurrentMinOut, msNoiseFloor_buffer16, len, -16 ); } Loading Loading @@ -2329,7 +2335,7 @@ void minimum_statistics_fx( /* Get the current noise floor */ #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { Copy_Scale_sig_32_16( msCurrentMinOut, msNoiseFloor_buffer16, len, -16 ); } Loading Loading @@ -2399,7 +2405,7 @@ void minimum_statistics_fx( /* Smooth noise estimate during CNG phases */ #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { FOR( j = 0; j < len; j++ ) { Loading Loading @@ -2429,7 +2435,7 @@ void minimum_statistics_fx( } #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode > 0 ) IF( isIVAS > 0 ) { IF( EQ_16( enc_dec, DEC ) && EQ_16( element_mode, IVAS_CPE_TD ) ) { Loading Loading @@ -2465,7 +2471,7 @@ void minimum_statistics_fx( scalar = L_mac( scalar, msPeriodogBuf[i], 6554 /*1.0/MSBUFLEN Q15*/ ); } #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { scalar16 = round_fx( scalar ); if ( GT_16( msNoiseEst_buffer16[j], scalar16 ) /*0.0 Q15*/ ) Loading @@ -2482,14 +2488,15 @@ void minimum_statistics_fx( move32(); } } assert( ( ( isIVAS == 0 ) ? ( msNoiseEst_buffer16[j] >= 0 ) : ( msNoiseEst_buffer32[j] >= 0 ) ) ); #else if ( GT_32( msNoiseEst_buffer[j], scalar ) /*0.0 Q15*/ ) { msNoiseEst_buffer[j] = scalar; move32(); } assert( msNoiseEst[j] >= 0 ); #endif assert( ( element_mode == 0 ? ( msNoiseEst_buffer16[j] ) : ( msNoiseEst_buffer32[j] ) ) >= 0 /*0.0 Q15*/ ); } } Loading lib_com/options.h +1 −3 Original line number Diff line number Diff line Loading @@ -92,9 +92,7 @@ #define FIX_2485_HARMONIZE_perform_noise_estimation_enc /* FhG: harmonize perform_noise_estimation_enc and perform_noise_estimation_enc_ivas */ #define FIX_2485_HARMONIZE_minimum_statistics /* FhG: harmonize minimum_statistics and minimum_statistics_fx */ #define FIX_2485_HARMONIZE_minimum_statistics_EVSmode /* FhG: harmonize... and use EVS-code for certain calculations, instead of IVAS code*/ #define FIX_2485_HARMONIZE_minimum_statistics_CHECK1 /*Check wheter EVS mode can be entered being in IVAS mode*/ #define FIX_2455_HARMONIZE_generate_comfort_noise_enc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */ #define FIX_2455_HARMONIZE_configureFdCngEnc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */ /* #################### End BE switches ################################## */ Loading lib_com/prot_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -4609,7 +4609,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 element_mode, /* i : IVAS element mode type */ const Word16 isIVAS ); #else void minimum_statistics( Loading lib_dec/fd_cng_dec_fx.c +9 −5 Original line number Diff line number Diff line Loading @@ -1304,7 +1304,9 @@ void perform_noise_estimation_dec_fx( &( hFdCngDec->msPeriodogBufPtr ), hFdCngDec->hFdCngCom, 0, 0 ); 0, 0 ); #else minimum_statistics( npart, Loading Loading @@ -2104,9 +2106,6 @@ void perform_noise_estimation_dec_ivas_fx( compress_range( hFdCngDec->msPeriodog, hFdCngDec->msPeriodog_exp, hFdCngDec->msLogPeriodog, npart ); /* Call the minimum statistics routine for noise estimation */ #ifdef FIX_2485_HARMONIZE_minimum_statistics_CHECK1 assert( element_mode != 0 ); #endif minimum_statistics_fx( npart, nFFTpart, Loading @@ -2129,7 +2128,12 @@ void perform_noise_estimation_dec_ivas_fx( hFdCngDec->msPeriodogBuf, &( hFdCngDec->msPeriodogBufPtr ), hFdCngDec->hFdCngCom, DEC, element_mode ); DEC, element_mode #ifdef FIX_2485_HARMONIZE_minimum_statistics , 0 #endif ); FOR( i = 0; i < hFdCngDec->npart_shaping; i++ ) { Loading lib_enc/fd_cng_enc_fx.c +3 −5 Original line number Diff line number Diff line Loading @@ -2666,9 +2666,6 @@ void perform_noise_estimation_enc_fx( /* Call the minimum statistics routine for noise estimation */ #ifdef FIX_2485_HARMONIZE_minimum_statistics #ifdef FIX_2485_HARMONIZE_minimum_statistics_CHECK1 assert( element_mode == hCPE->element_mode ); #endif minimum_statistics_fx( hFdCngEnc->hFdCngCom->npart, nFFTpart, Loading @@ -2691,8 +2688,9 @@ void perform_noise_estimation_enc_fx( hFdCngEnc->msPeriodogBuf_fx, &( hFdCngEnc->msPeriodogBufPtr ), hFdCngEnc->hFdCngCom, ( element_mode == 0 ) ? ( 0 ) : ( ENC ), ( element_mode == 0 ) ? ( 0 ) : ( ( hCPE == NULL ) ? 0 : hCPE->element_mode ) ); ENC, ( hCPE == NULL ) ? 0 : hCPE->element_mode, element_mode ); /* Expand MS outputs */ Loading Loading
lib_com/fd_cng_com_fx.c +20 −13 Original line number Diff line number Diff line Loading @@ -1714,7 +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 element_mode, /* i : IVAS element mode type */ const Word16 isIVAS ) { Word16 i, j, k, s, s1, s2, s3; Loading Loading @@ -1781,7 +1782,7 @@ void minimum_statistics_fx( IF( LT_16( hFdCngCom->msFrCnt_init_counter, hFdCngCom->msFrCnt_init_thresh ) ) { #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { Copy( msPeriodog, msPsd, len ); /* 6Q9 */ Copy( msPeriodog, msNoiseFloor_buffer16, len ); /* 6Q9 */ Loading Loading @@ -1922,7 +1923,7 @@ void minimum_statistics_fx( /* msPeriodogSum[cnt] with format 16Q15 */ Word16 msNoiseFloor16tmp[NPART_SHAPING]; #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { snr = dotp_s_fx( msNoiseFloor_buffer16 + start, psize + start, current_len, CNG_HS ); } Loading Loading @@ -1970,7 +1971,10 @@ void minimum_statistics_fx( /* Compute optimal smoothing parameter for PSD estimation */ test(); #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( ( scalar == 0 ) || ( ( element_mode == 0 ? msNoiseFloor_buffer16[j] : msNoiseFloor_buffer32[j] ) == 0 ) ) test(); test(); test(); IF( ( scalar == 0 ) || ( ( isIVAS == 0 ) ? ( msNoiseFloor_buffer16[j] == 0 ) : ( msNoiseFloor_buffer32[j] == 0 ) ) ) #else IF( ( scalar == 0 ) || ( msNoiseFloor_buffer[j] == 0 ) ) #endif Loading @@ -1984,7 +1988,7 @@ void minimum_statistics_fx( s1 = WORD16_BITS - 1; move16(); #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { if ( msNoiseFloor_buffer16[j] != 0 ) { Loading Loading @@ -2124,13 +2128,15 @@ void minimum_statistics_fx( QeqInv = MSQEQINVMAX; move16(); #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( ( element_mode == 0 ? msNoiseFloor_buffer16[j] : msNoiseFloor_buffer32[j] ) != 0 ) test(); test(); IF( ( isIVAS == 0 ) ? ( msNoiseFloor_buffer16[j] != 0 ) : ( msNoiseFloor_buffer32[j] != 0 ) ) #else IF( msNoiseFloor_buffer[j] != 0 /*0.0 Q15*/ ) #endif { #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { tmp = L_mult( msNoiseFloor_buffer16[j], msNoiseFloor_buffer16[j] ); } Loading Loading @@ -2260,7 +2266,7 @@ void minimum_statistics_fx( } /* Get the current noise floor */ #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { Copy_Scale_sig_32_16( msCurrentMinOut, msNoiseFloor_buffer16, len, -16 ); } Loading Loading @@ -2329,7 +2335,7 @@ void minimum_statistics_fx( /* Get the current noise floor */ #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { Copy_Scale_sig_32_16( msCurrentMinOut, msNoiseFloor_buffer16, len, -16 ); } Loading Loading @@ -2399,7 +2405,7 @@ void minimum_statistics_fx( /* Smooth noise estimate during CNG phases */ #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { FOR( j = 0; j < len; j++ ) { Loading Loading @@ -2429,7 +2435,7 @@ void minimum_statistics_fx( } #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode > 0 ) IF( isIVAS > 0 ) { IF( EQ_16( enc_dec, DEC ) && EQ_16( element_mode, IVAS_CPE_TD ) ) { Loading Loading @@ -2465,7 +2471,7 @@ void minimum_statistics_fx( scalar = L_mac( scalar, msPeriodogBuf[i], 6554 /*1.0/MSBUFLEN Q15*/ ); } #ifdef FIX_2485_HARMONIZE_minimum_statistics IF( element_mode == 0 ) IF( isIVAS == 0 ) { scalar16 = round_fx( scalar ); if ( GT_16( msNoiseEst_buffer16[j], scalar16 ) /*0.0 Q15*/ ) Loading @@ -2482,14 +2488,15 @@ void minimum_statistics_fx( move32(); } } assert( ( ( isIVAS == 0 ) ? ( msNoiseEst_buffer16[j] >= 0 ) : ( msNoiseEst_buffer32[j] >= 0 ) ) ); #else if ( GT_32( msNoiseEst_buffer[j], scalar ) /*0.0 Q15*/ ) { msNoiseEst_buffer[j] = scalar; move32(); } assert( msNoiseEst[j] >= 0 ); #endif assert( ( element_mode == 0 ? ( msNoiseEst_buffer16[j] ) : ( msNoiseEst_buffer32[j] ) ) >= 0 /*0.0 Q15*/ ); } } Loading
lib_com/options.h +1 −3 Original line number Diff line number Diff line Loading @@ -92,9 +92,7 @@ #define FIX_2485_HARMONIZE_perform_noise_estimation_enc /* FhG: harmonize perform_noise_estimation_enc and perform_noise_estimation_enc_ivas */ #define FIX_2485_HARMONIZE_minimum_statistics /* FhG: harmonize minimum_statistics and minimum_statistics_fx */ #define FIX_2485_HARMONIZE_minimum_statistics_EVSmode /* FhG: harmonize... and use EVS-code for certain calculations, instead of IVAS code*/ #define FIX_2485_HARMONIZE_minimum_statistics_CHECK1 /*Check wheter EVS mode can be entered being in IVAS mode*/ #define FIX_2455_HARMONIZE_generate_comfort_noise_enc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */ #define FIX_2455_HARMONIZE_configureFdCngEnc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */ /* #################### End BE switches ################################## */ Loading
lib_com/prot_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -4609,7 +4609,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 element_mode, /* i : IVAS element mode type */ const Word16 isIVAS ); #else void minimum_statistics( Loading
lib_dec/fd_cng_dec_fx.c +9 −5 Original line number Diff line number Diff line Loading @@ -1304,7 +1304,9 @@ void perform_noise_estimation_dec_fx( &( hFdCngDec->msPeriodogBufPtr ), hFdCngDec->hFdCngCom, 0, 0 ); 0, 0 ); #else minimum_statistics( npart, Loading Loading @@ -2104,9 +2106,6 @@ void perform_noise_estimation_dec_ivas_fx( compress_range( hFdCngDec->msPeriodog, hFdCngDec->msPeriodog_exp, hFdCngDec->msLogPeriodog, npart ); /* Call the minimum statistics routine for noise estimation */ #ifdef FIX_2485_HARMONIZE_minimum_statistics_CHECK1 assert( element_mode != 0 ); #endif minimum_statistics_fx( npart, nFFTpart, Loading @@ -2129,7 +2128,12 @@ void perform_noise_estimation_dec_ivas_fx( hFdCngDec->msPeriodogBuf, &( hFdCngDec->msPeriodogBufPtr ), hFdCngDec->hFdCngCom, DEC, element_mode ); DEC, element_mode #ifdef FIX_2485_HARMONIZE_minimum_statistics , 0 #endif ); FOR( i = 0; i < hFdCngDec->npart_shaping; i++ ) { Loading
lib_enc/fd_cng_enc_fx.c +3 −5 Original line number Diff line number Diff line Loading @@ -2666,9 +2666,6 @@ void perform_noise_estimation_enc_fx( /* Call the minimum statistics routine for noise estimation */ #ifdef FIX_2485_HARMONIZE_minimum_statistics #ifdef FIX_2485_HARMONIZE_minimum_statistics_CHECK1 assert( element_mode == hCPE->element_mode ); #endif minimum_statistics_fx( hFdCngEnc->hFdCngCom->npart, nFFTpart, Loading @@ -2691,8 +2688,9 @@ void perform_noise_estimation_enc_fx( hFdCngEnc->msPeriodogBuf_fx, &( hFdCngEnc->msPeriodogBufPtr ), hFdCngEnc->hFdCngCom, ( element_mode == 0 ) ? ( 0 ) : ( ENC ), ( element_mode == 0 ) ? ( 0 ) : ( ( hCPE == NULL ) ? 0 : hCPE->element_mode ) ); ENC, ( hCPE == NULL ) ? 0 : hCPE->element_mode, element_mode ); /* Expand MS outputs */ Loading