diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 58e8d441bb0922b61e3e81976499df4d308f344b..87efbcaf90e4be93c974114264921be69150cfc5 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1221,18 +1221,16 @@ enum #define MASA_TRANSP_BITS 1 #define NO_BITS_MASA_ISM_NO_OBJ 2 -#ifdef IVAS_FLOAT_FIXED #ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL #define MASA2TOTAL_THR 0.9799999f #else #define MASA2TOTAL_THR 0.98f #endif +#ifdef IVAS_FLOAT_FIXED #define MASA2TOTAL_THR_Q30 1052266987 // 0.98f in Q30 //Maximum error in float to fixed conversion : 0.005% //Assuming the accuracy of 99.995% //New value = 99.995 / 100 * 0.98 = 0.979951 -#else -#define MASA2TOTAL_THR 0.98f #endif #define BITS_MASA2TOTTAL_DCT0 6 #define STEP_M2T 0.1f diff --git a/lib_com/options.h b/lib_com/options.h index 1dc5347c2b9c951fe60df5d6431c88598ced2dcf..f658242a46c44fb3c5e31bd4356b81539a2b5981 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -74,6 +74,7 @@ #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 NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */ +#define FIX_BASOP_812_NAN_COHSNR /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/ /* #################### End FIXES switches ############################ */ diff --git a/lib_dec/TonalComponentDetection_fx.c b/lib_dec/TonalComponentDetection_fx.c index 6ef4f65da364e4cd6b7a4f479fb62d64efcb53af..eab15970b9be9679b0a0fbd631ddaddd4eca41a1 100644 --- a/lib_dec/TonalComponentDetection_fx.c +++ b/lib_dec/TonalComponentDetection_fx.c @@ -114,6 +114,10 @@ void ivas_DetectTonalComponents_fx( move32(); } + /* Guard bit */ + lastMDCTSpect_exp = add( lastMDCTSpect_exp, 1 ); + scale_sig32( pScaledMdctSpectrum, nSamples, -1 ); + /* Find peak candidates in the last frame. */ findCandidates( nSamples, pScaledMdctSpectrum, lastMDCTSpect_exp, thresholdModification, floorPowerSpectrum ); diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 2d20ed6898bfb2381675c8d88ac47e22b75929e9..4de07342ce7927fee84e2436230b9cf1fccdfa48 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -8762,6 +8762,9 @@ void ivas_omasa_decode_masa_to_total( float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; int16_t n_streams, len_stream; +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + int32_t int_tmp; +#endif /* Setup coding parameters */ n_streams = 1; @@ -8816,6 +8819,10 @@ void ivas_omasa_decode_masa_to_total( { masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] ); masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] ); +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] ); + masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD ); +#endif k++; } } @@ -8827,6 +8834,10 @@ void ivas_omasa_decode_masa_to_total( for ( j = 0; j < nbands; j++ ) { masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[0][j]; +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] ); + masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD ); +#endif } } } @@ -8838,6 +8849,10 @@ void ivas_omasa_decode_masa_to_total( for ( i = 0; i < nblocks; i++ ) { masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[i][0]; +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] ); + masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD ); +#endif } } } diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 1c429867971ff2901ae24c222c5f2100e4c944ab..56f2e9ee62b8761b19c8811896359942d6f19e0d 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -3395,7 +3395,18 @@ void stereo_dft_enc_compute_itd( } /*calculate total cohSNR for frame in dB*/ - cohSNR = 20 * log10f( mEr ); +#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 */ {