From ff355a4b31e7c228d1fc8fe086b9abd75f09f632 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 26 Aug 2025 11:21:21 +0300 Subject: [PATCH] Port float MR 2219 to BASOP --- lib_com/ivas_error.h | 7 +++++++ lib_com/options.h | 1 + lib_util/rotation_file_reader.c | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index e46f901c6..bc3b8f2f5 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -125,6 +125,9 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, IVAS_ERR_NO_FILE_OPEN, IVAS_ERR_SAMPLING_RATE_UNKNOWN, +#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK + IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT, +#endif /*----------------------------------------* * renderer (lib_rend only) * @@ -256,6 +259,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: return "Invalid index"; +#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK + case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT: + return "Euler angles were detected in the input but only Quaternions are supported"; +#endif default: break; } diff --git a/lib_com/options.h b/lib_com/options.h index ad6c95e3f..f43b52c19 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ +#define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1959_assert_in_gain_enc_mless_fx /* VA: Fix saturation introduced by the usage of the non-EVS basop operators =, the saturation was expected */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index 3cd2e798b..3d07ec3e9 100644 --- a/lib_util/rotation_file_reader.c +++ b/lib_util/rotation_file_reader.c @@ -193,6 +193,14 @@ ivas_error ExternalOrientationFileReading( } ( externalOrientationReader->frameCounter )++; +#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK + + /* Only Quaternion orientations are supported, raise an error if Euler angles are detected in the input */ + if ( w == -3.0f ) + { + return IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT; + } +#endif pQuaternion->w_fx = float_to_fix( w, Q29 ); pQuaternion->x_fx = float_to_fix( x, Q29 ); -- GitLab