diff --git a/lib_com/options.h b/lib_com/options.h index 3d38d6c7e9068d869aaf16b0d095fb9f98d06535..10160ed9cd059dbf873943f0838a0ce5a29e429c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -72,6 +72,7 @@ #define NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID /* FhG: issue 1133: in TCX PLC, don't scale hHQ_core->old_out after applying fade to noise in burst frame error */ #define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */ #define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ +#define FIX_BASOP_812_NAN_COHSNR /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/ #define NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */ /* #################### End FIXES switches ############################ */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 2d43e3d30588c4f452c6559f254a546408c35714..de66c780f9cb15fc20d2bb4a90382043f9950511 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -1026,8 +1026,19 @@ void stereo_dft_enc_compute_itd( mEr = calc_mean_E_ratio( hItd, nbands, band_limits, sfm_L, pNrgL, pNrgR, &total_mEr ); } - /*calculate total cohSNR for frame in dB*/ - cohSNR = 20 * log10f( mEr ); +/*calculate total cohSNR for frame in dB*/ +#ifdef FIX_BASOP_812_NAN_COHSNR + if ( mEr > 1.0f ) + { +#endif + cohSNR = 20 * log10f( mEr ); +#ifdef FIX_BASOP_812_NAN_COHSNR + } + else + { + cohSNR = 0; + } +#endif /* collect UNCLR classifier parameters */ {