From c4fceeb13597ff5437c313106b89f553d6d1d54c Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Fri, 19 Jul 2024 15:17:15 +0200 Subject: [PATCH 1/3] fix reported issue where cohSNR is nan because of negative mEr --- lib_com/options.h | 1 + lib_enc/ivas_stereo_dft_enc_itd.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 12a2924643..9dbed94a4a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define FLOAT_FIX_POINT_HRTF_FILE_FORMAT /* allows reading floation or fix point hrtf binary file format */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define FIX_1117_ISAR_MALLOC /* VA: issue 1117: call ISAR malloc() only at the initialization. */ +#define FIX_BASOP_812_NAN_COHSNR /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index b54fd07a1a..2352f5204a 100755 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -1051,7 +1051,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 > 0 ) + { +#endif + cohSNR = 20 * log10f( mEr ); +#ifdef FIX_BASOP_812_NAN_COHSNR + } + else + { + cohSNR = 0; + } +#endif /* collect UNCLR classifier parameters */ { -- GitLab From 13cba6eda74560c49a6bae16c896a384048a7a65 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Fri, 19 Jul 2024 15:25:54 +0200 Subject: [PATCH 2/3] clang format --- lib_enc/ivas_stereo_dft_enc_itd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 lib_enc/ivas_stereo_dft_enc_itd.c diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c old mode 100755 new mode 100644 index 2352f5204a..28a56840b2 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -1052,7 +1052,7 @@ void stereo_dft_enc_compute_itd( /*calculate total cohSNR for frame in dB*/ #ifdef FIX_BASOP_812_NAN_COHSNR - if( mEr > 0 ) + if ( mEr > 0 ) { #endif cohSNR = 20 * log10f( mEr ); -- GitLab From f05da3ad459f4544c189d116ecd0cd3e7abb229b Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Mon, 22 Jul 2024 15:43:47 +0200 Subject: [PATCH 3/3] better minimum threshold --- lib_enc/ivas_stereo_dft_enc_itd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 28a56840b2..d115eb5a25 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -1052,7 +1052,7 @@ void stereo_dft_enc_compute_itd( /*calculate total cohSNR for frame in dB*/ #ifdef FIX_BASOP_812_NAN_COHSNR - if ( mEr > 0 ) + if ( mEr > 1.0f ) { #endif cohSNR = 20 * log10f( mEr ); -- GitLab