From 7245430aa323579903cbd30737f758b40815d680 Mon Sep 17 00:00:00 2001 From: naghibza Date: Thu, 9 Oct 2025 16:34:40 +0200 Subject: [PATCH] convert floating-point leftover in makeCustomLsSetup() --- lib_com/cnst.h | 10 +++++----- lib_com/options.h | 1 + lib_rend/lib_rend_fx.c | 8 ++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 0e1f6dcea..36141e749 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -2075,11 +2075,11 @@ typedef enum _DCTTYPE #define INV_PREECHO_SMOOTH_LENP1 ( 1 / ( PREECHO_SMOOTH_LEN + 1.0 ) ); #define EPSILON 0.000000000000001f -#define EPSILON_FX_SMALL 1 -#define EPSILON_FIX (1) -#define EPSILON_FX (Word32)1 -#define EPSILON_FX_M 1208925819 -#define EPSILON_FX_E -49 +#define EPSILON_FX_SMALL 1 +#define EPSILON_FIX (1) +#define EPSILON_FX (Word32)1 +#define EPSILON_FX_M 1208925819 +#define EPSILON_FX_E -49 #define MAX_SEGMENT_LENGTH 480 diff --git a/lib_com/options.h b/lib_com/options.h index 1adebda25..3ff7b8f89 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -111,6 +111,7 @@ #define FIX_2049_DIFF_IN_DECORR_TAIL /* FhG: correct scale values in ivas_dirac_dec_binaural_process_output_fx() */ #define FIX_2602_NONBE_SAT_IN_SWB_TBE_SCALE /* Dolby/FhG: fix for issue 2026: Saturation in SWB TBE re-scaling function preventing StereoDownmix complexity job to complete */ +#define FIX_2083_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index dc53538bb..76eccb084 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -3653,7 +3653,11 @@ static LSSETUP_CUSTOM_STRUCT makeCustomLsSetup( move16(); FOR( i = 0; i < rendCustomLsLayout.num_spk; ++i ) { +#ifdef FIX_2083_FLOATING_POINT_LEFTOVERS + IF( LT_32( L_abs( rendCustomLsLayout.elevation_fx[i] ), EPSILON_FX ) ) +#else IF( fabsf( rendCustomLsLayout.elevation[i] ) > EPSILON ) +#endif { customLs.is_planar_setup = 0; move16(); @@ -9162,7 +9166,11 @@ static ivas_error getSamplesInternal( if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, +#ifdef FIX_2083_FLOATING_POINT_LEFTOVERS + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, extract_l( Mpy_32_32( hIvasRend->sampleRateOut, 2684355 /*(BINAURAL_MAXBANDS / 48000) in Q31*/ ) ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) +#else &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const Word16 )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) +#endif { return error; } -- GitLab