diff --git a/lib_com/options.h b/lib_com/options.h index 801ffdfb4f3bb1670498f3718d60a159343e7837..9a99079a85175bc8df09cd6f153c70eaddeb6ac1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,6 +180,7 @@ #define NONBE_1217_INIT_OBJ_EDIT /* VA: issue 1217: do object editing only when objects metadata is available */ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ +#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 f0cb1b4563b173d574924494f6a502a395149fb7..2fc4da68457397ff808169900241875b9c7f4ca8 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_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( 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 { azimuth -= delta_phi; } else { +#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( 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 { azimuth += delta_phi; }