From 06b017356173ad1c5c9c2e98899e23ee686fa74f Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 14 Aug 2024 09:30:21 +0530 Subject: [PATCH] MLD improvement changes for MASA format [x] Q update in ivas_dirac_dec_render_sf_fx [x] Fixed values updated in ivas_masa_stereotype_detection_fx --- lib_dec/ivas_dirac_dec.c | 13 +++++++++++++ lib_rend/ivas_dirac_rend.c | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index d2b3a69ff..a127cd1a4 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -4998,6 +4998,19 @@ void ivas_dirac_dec_render_sf_fx( hDirAC->hConfig->enc_param_start_band, &q_Cldfb ); + Word16 sh = hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q; + move16(); + hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q = 31; + move16(); + FOR( i = 0; i < proto_power_smooth_len; i++ ) + { + IF( hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_fx[i] != 0 ) + { + hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q = sh; + move16(); + } + } + FOR( ch = 0; ch < hDirACRend->hOutSetup.nchan_out_woLFE; ch++ ) { FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index c6ef71a46..f406c48b9 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -4695,7 +4695,7 @@ void ivas_masa_stereotype_detection_fx( { /* subtract_temp = ( -subtract_target_ratio_db - 3.0f ) / 3.0f; */ temp = L_sub( L_shr( -subtract_target_ratio_db_fx, 1 ), L_shr( THREE_Q21, 1 ) ); - subtract_temp_fx = Mpy_32_32( temp, 708669604 /* 1 / 3.0f in Q31 */ ); + subtract_temp_fx = Mpy_32_32( temp, 715827883 /* 1 / 3.0f in Q31 */ ); subtract_temp_fx = L_shl( subtract_temp_fx, 1 ); /* Q21 */ /* min_sum_temp = max( -min_sum_total_ratio_db / 6.0f, 0.0f ); */ @@ -4720,7 +4720,7 @@ void ivas_masa_stereotype_detection_fx( IF( subtract_target_ratio_db_fx > 0 ) { /* subtract_temp = subtract_target_ratio_db / 3.0f; */ - subtract_temp_fx = Mpy_32_32( subtract_target_ratio_db_fx, 708669604 /* 1 / 3.0f in Q31 */ ); /* Q21 */ + subtract_temp_fx = Mpy_32_32( subtract_target_ratio_db_fx, 715827883 /* 1 / 3.0f in Q31 */ ); /* Q21 */ /* min_sum_temp = ( min_sum_total_ratio_db + 1.0f ) / 6.0f; */ min_sum_temp_fx = Mpy_32_32_r( L_add( min_sum_total_ratio_db_fx, ONE_IN_Q21 ), 357913941 /* 1 / 6.0f in Q31 */ ); /* Q21 */ @@ -4741,13 +4741,13 @@ void ivas_masa_stereotype_detection_fx( IF( LT_32( lr_total_hi_ratio_db_fx, -25165824 ) ) // 25165824 = 12.0 in Q21 { /* subtract_temp = ( subtract_target_ratio_db + 4.0f ) / 3.0f; */ - subtract_temp_fx = Mpy_32_32( L_add( subtract_target_ratio_db_fx, 8388608 /* 4.0 in Q21 */ ), 708669604 /* 1 / 3.0f in Q31 */ ); + subtract_temp_fx = Mpy_32_32( L_add( subtract_target_ratio_db_fx, 8388608 /* 4.0 in Q21 */ ), 715827883 /* 1 / 3.0f in Q31 */ ); /* min_sum_temp = min_sum_total_ratio_db / 6.0f; */ min_sum_temp_fx = Mpy_32_32_r( min_sum_total_ratio_db_fx, 357913941 /* 1 / 6.0f in Q31 */ ); /* lr_total_hi_temp = ( -lr_total_hi_ratio_db - 12.0f ) / 3.0f; */ - lr_total_hi_temp_fx = Mpy_32_32( L_sub( -lr_total_hi_ratio_db_fx, 25165824 /* 12.0 in Q21 */ ), 708669604 /* 1 / 3.0f in Q31 */ ); + lr_total_hi_temp_fx = Mpy_32_32( L_sub( -lr_total_hi_ratio_db_fx, 25165824 /* 12.0 in Q21 */ ), 715827883 /* 1 / 3.0f in Q31 */ ); change_to_downmix2_fx = L_add( L_add( subtract_temp_fx, min_sum_temp_fx ), lr_total_hi_temp_fx ); // Q21 -- GitLab