diff --git a/lib_com/options.h b/lib_com/options.h index 5efe9e898660f2ba72007d4faa15f2e0e8bb08c9..8fb55599e8e575bf83169a4ccd013d5a392587de 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -106,6 +106,8 @@ #define FIX_2200_ISAR_PLC_CRASH /* Dolby: Fix for ISAR PLC crash observed with newly added BASOP tests */ #define FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA /* FhG: Resolve overflow by swapping the order of addition and multiplication */ #define FIX_2217_ASSERT_IN_IVAS_CORE_DECODER_WITH_MC /* FhG: Adjust Q_real to prevent overflow in st->cldfbSyn->cldfb_state_fx scaling */ +#define FIX_2211_ASSERT_IN_REND_CREND_CONVOLER /* FhG: Add headroom to p_output_fx to prevent overflow in ivas_rend_crendProcessSubframe_fx() */ + /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 42270d50d9fca09bed86444166daef4452c3c0a4..1f2f7779166df5d66c2a309a1bbab186f693dc22 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2766,9 +2766,19 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( { return error; } +#ifdef FIX_2211_ASSERT_IN_REND_CREND_CONVOLER + Word16 subframe_len, gd_bits; + subframe_len = imult1616( st_ivas->hTcBuffer->subframe_nbslots[0], st_ivas->hTcBuffer->n_samples_granularity ); + gd_bits = find_guarded_bits_fx( subframe_len ); + *st_ivas->hCrendWrapper->p_io_qfactor = sub( 13, gd_bits ); + FOR( Word16 i = 0; i < nchan_in; i++ ) + { + scale_sig32( p_output_fx[i], *nSamplesRendered, sub( *st_ivas->hCrendWrapper->p_io_qfactor, Q11 ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor + } +#else *st_ivas->hCrendWrapper->p_io_qfactor = 11; move16(); - +#endif IF( NE_32( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : st_ivas->hTcBuffer->tc_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ), IVAS_ERR_OK ) ) @@ -2777,6 +2787,12 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( } ivas_binaural_add_LFE_fx( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc_fx, p_output_fx ); +#ifdef FIX_2211_ASSERT_IN_REND_CREND_CONVOLER + FOR( Word16 i = 0; i < nchan_in; i++ ) + { + scale_sig32( p_output_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 + } +#endif } ELSE IF( EQ_16( renderer_type_old, RENDERER_BINAURAL_OBJECTS_TD ) ) {