diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index f30bb123757e83a1a0e8c58c7f414dbd0b2a4366..0fa4511fd3696b63ae82279d5886e28075d5686f 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1537,7 +1537,15 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( } ELSE { - b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], L_add( reference_power[k + ( ch_idx + 1 ) * num_freq_bands], EPSILON_FX ), &b_exp ); /*Q(15-b_exp)*/ + IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] == 0 ) + { + b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], 232831 /* EPSILON in exp 63 */, &b_exp ); + b_exp = add( b_exp, sub( sub( 31, q_reference_power ), 63 ) ); + } + ELSE + { + b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], reference_power[k + ( ch_idx + 1 ) * num_freq_bands], &b_exp ); /*Q(15-b_exp)*/ + } } c = L_add( ONE_IN_Q29 /*1 Q29*/, Mpy_32_16_1( L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr_fx, ONE_IN_Q29 /*1 Q29*/ ), 5461 /*1.0 / 6.0 Q15*/ ) ); /*Diffuseness modellling nrg compensation*/ /*Q29*/ @@ -1611,10 +1619,8 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( { IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] == 0 ) { - b = MAXVAL_WORD16; /*Q(-9)*/ - move16(); - b_exp = 40; - move16(); + b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], 232831 /* EPSILON in exp 63 */, &b_exp ); + b_exp = add( b_exp, sub( sub( 31, q_reference_power ), 63 ) ); } ELSE {