From c0a28b0a9dfc597c281fbdc72541421620a224ad Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Fri, 29 Nov 2024 14:13:38 +0200 Subject: [PATCH 1/3] fix 1056 BASOP related --- lib_com/ivas_cnst.h | 3 +++ lib_com/options.h | 2 +- lib_dec/ivas_masa_dec.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index db01bdfe89..cf9f07d55e 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1190,6 +1190,9 @@ enum #define MASA_ANGLE_TOLERANCE 0.5f #define MASA_SUR_COH_THRESHOLD 1e-7f #define MASA_SUR_COH_PRECISION 1e7f +#ifdef NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP +#define DELTA_PHI_PRECISION 100.0f +#endif #define MASA_LIMIT_NO_BANDS_SUR_COH 8 #define MINIMUM_BIT_BUDGET_NORMAL_META 100 #define DIFF_DFRATIO_2BIT_LIMIT_IDX_HODIRAC 4 diff --git a/lib_com/options.h b/lib_com/options.h index 51db29c99c..d11cecb5f4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,7 @@ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ - +#define NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 2b9d071901..b58608708e 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -2418,13 +2418,23 @@ static int16_t ivas_decode_masaism_metadata( if ( azimuth * hMasaIsmData->q_azimuth_old[obj] > 0 ) { delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/ +#ifdef NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP + /* this is equivalent to testing if 'azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi' with limited precision */ + if ( roundf( DELTA_PHI_PRECISION * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( azimuth - hMasaIsmData->q_azimuth_old[obj] ) ) / DELTA_PHI_PRECISION > 180.0f ) +#else if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi ) +#endif { azimuth -= delta_phi; } else { +#ifdef NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP + /* this is equivalent to testing if 'hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi' with limited precision */ + if ( roundf( DELTA_PHI_PRECISION * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( hMasaIsmData->q_azimuth_old[obj] - azimuth ) ) / DELTA_PHI_PRECISION > 180.0f ) +#else if ( hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi ) +#endif { azimuth += delta_phi; } -- GitLab From 13cc30c8f5a05893531512e621a1b215ef4ca36e Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Fri, 29 Nov 2024 14:46:03 +0200 Subject: [PATCH 2/3] correct issue number if switch for 1230 --- lib_com/ivas_cnst.h | 2 +- lib_com/options.h | 2 +- lib_dec/ivas_masa_dec.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index cf9f07d55e..4991a80a48 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1190,7 +1190,7 @@ enum #define MASA_ANGLE_TOLERANCE 0.5f #define MASA_SUR_COH_THRESHOLD 1e-7f #define MASA_SUR_COH_PRECISION 1e7f -#ifdef NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP +#ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP #define DELTA_PHI_PRECISION 100.0f #endif #define MASA_LIMIT_NO_BANDS_SUR_COH 8 diff --git a/lib_com/options.h b/lib_com/options.h index d11cecb5f4..893f2a9868 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,7 @@ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ -#define NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */ +#define NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index b58608708e..f8ee14bf7f 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -2418,7 +2418,7 @@ static int16_t ivas_decode_masaism_metadata( if ( azimuth * hMasaIsmData->q_azimuth_old[obj] > 0 ) { delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/ -#ifdef NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP +#ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* this is equivalent to testing if 'azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi' with limited precision */ if ( roundf( DELTA_PHI_PRECISION * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( azimuth - hMasaIsmData->q_azimuth_old[obj] ) ) / DELTA_PHI_PRECISION > 180.0f ) #else @@ -2429,7 +2429,7 @@ static int16_t ivas_decode_masaism_metadata( } else { -#ifdef NONBE_1056_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP +#ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* this is equivalent to testing if 'hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi' with limited precision */ if ( roundf( DELTA_PHI_PRECISION * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( hMasaIsmData->q_azimuth_old[obj] - azimuth ) ) / DELTA_PHI_PRECISION > 180.0f ) #else -- GitLab From 5cdaf311ce1a182b587b13425ef56aee860a6a0b Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Fri, 10 Jan 2025 12:58:02 +0200 Subject: [PATCH 3/3] remove DELTA_PHI_PRECISION constant def --- lib_com/ivas_cnst.h | 3 --- lib_dec/ivas_masa_dec.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index d2760de3a4..786a6d436b 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1190,9 +1190,6 @@ enum #define MASA_ANGLE_TOLERANCE 0.5f #define MASA_SUR_COH_THRESHOLD 1e-7f #define MASA_SUR_COH_PRECISION 1e7f -#ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP -#define DELTA_PHI_PRECISION 100.0f -#endif #define MASA_LIMIT_NO_BANDS_SUR_COH 8 #define MINIMUM_BIT_BUDGET_NORMAL_META 100 #define DIFF_DFRATIO_2BIT_LIMIT_IDX_HODIRAC 4 diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a00976c82b..d0edadb7fc 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -2424,7 +2424,7 @@ static int16_t ivas_decode_masaism_metadata( delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/ #ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* this is equivalent to testing if 'azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi' with limited precision */ - if ( roundf( DELTA_PHI_PRECISION * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( azimuth - hMasaIsmData->q_azimuth_old[obj] ) ) / DELTA_PHI_PRECISION > 180.0f ) + if ( roundf( 100 * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( azimuth - hMasaIsmData->q_azimuth_old[obj] ) ) / 100.0f > 180.0f ) #else if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi ) #endif @@ -2435,7 +2435,7 @@ static int16_t ivas_decode_masaism_metadata( { #ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP /* this is equivalent to testing if 'hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi' with limited precision */ - if ( roundf( DELTA_PHI_PRECISION * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( hMasaIsmData->q_azimuth_old[obj] - azimuth ) ) / DELTA_PHI_PRECISION > 180.0f ) + if ( roundf( 100 * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( hMasaIsmData->q_azimuth_old[obj] - azimuth ) ) / 100.0f > 180.0f ) #else if ( hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi ) #endif -- GitLab