diff --git a/lib_com/cnst.h b/lib_com/cnst.h index a608fd6077b56fc5448775b9e8fe989038bf1809..4157d878f42522b2978d23b942c2d46a4c2420c1 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -2079,11 +2079,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 45db98c6d4af190c21a4a9153fe12d9577f09668..80afcfaf7d2e0ec7e2117bd08f2d8fbe8b5cb0dd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -112,6 +112,7 @@ #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_2021_BANDWIDTH_EXTENSION_PROBLEM /* FhG: increase cldfb buffer precision*/ +#define FIX_2083_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/ #define FIX_2085_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in ivas_dirac_config_fx() */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index dc53538bb28be7ab47b8fba7a37b7d952a84566f..76eccb08405e1c2e036bc5f7ac34c844993a393f 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; }