From f55a0445e4c72bff507046e7f7015704e972d121 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Thu, 21 Aug 2025 16:37:35 +0200 Subject: [PATCH 1/6] debugging comments --- lib_rend/ivas_reverb_fx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 3e9cd4741..75cf7cc2a 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -672,13 +672,15 @@ static ivas_error compute_t60_coeffs_fx( ELSE { tmp = BASOP_Util_Divide3232_Scale( L_deposit_h( loop_delay_sec_fx ), pParams->pRt60_fx[bin_idx], &e ); - IF( LT_16( e, -1 ) ) + // TODO: Devansh, check out the condition value required + IF( LT_16( e, -6 ) ) + //IF( LT_16( e, -1 ) ) { target_gains_db_fx[bin_idx] = min120q8; } ELSE { - tmp = shr( tmp, sub( 5, e ) ); // scaling tmp to Q15 + tmp = shr( tmp, abs( sub( 5, e ) ) ); // scaling tmp to Q15 target_gains_db_fx[bin_idx] = mult( shr( min120q8, 1 ), tmp ); // Q8 } } @@ -971,6 +973,12 @@ static ivas_error calc_jot_t60_coeffs_fx( L_tmp = BASOP_util_Pow2( L_deposit_h( tmp_fx ), exph, &e ); lin_gain_hf_fx = extract_l( L_shr( L_tmp, sub( 16, e ) ) ); + IF( EQ_16( lin_gain_hf_fx, 0 ) ) + { + lin_gain_hf_fx = 1; + move16(); + } + /* call low-pass iir shelf */ calc_low_shelf_first_order_filter_fx( pCoeffB_fx, pCoeffA_fx, f0_fx, lin_gain_lf_fx, lin_gain_hf_fx ); return IVAS_ERR_OK; -- GitLab From 799d36968c5dca9e40855186b8b5da3323cca5d5 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Thu, 21 Aug 2025 16:38:10 +0200 Subject: [PATCH 2/6] final changes --- lib_rend/ivas_reverb_fx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 75cf7cc2a..3b4cd2e5f 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -672,9 +672,7 @@ static ivas_error compute_t60_coeffs_fx( ELSE { tmp = BASOP_Util_Divide3232_Scale( L_deposit_h( loop_delay_sec_fx ), pParams->pRt60_fx[bin_idx], &e ); - // TODO: Devansh, check out the condition value required IF( LT_16( e, -6 ) ) - //IF( LT_16( e, -1 ) ) { target_gains_db_fx[bin_idx] = min120q8; } -- GitLab From 8d89b274a93037a4317b57dff408e75478bac433 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Thu, 21 Aug 2025 16:45:40 +0200 Subject: [PATCH 3/6] Restart pipeline after MR marked ready -- GitLab From a43ca20b17cec49465f94615bed768690661678d Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:41:20 +0200 Subject: [PATCH 4/6] Added comment + fixed porting --- lib_rend/ivas_reverb_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index e8b8ad587..35b7e6452 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -703,7 +703,7 @@ static ivas_error compute_t60_coeffs_fx( } ELSE { - tmp = shr( tmp, abs( sub( 5, e ) ) ); // scaling tmp to Q15 + tmp = shr( tmp, sub( 5, e ) ); // scaling tmp to Q15 target_gains_db_fx[bin_idx] = mult( shr( min120q8, 1 ), tmp ); // Q8 } } @@ -998,7 +998,7 @@ static ivas_error calc_jot_t60_coeffs_fx( IF( EQ_16( lin_gain_hf_fx, 0 ) ) { - lin_gain_hf_fx = 1; + lin_gain_hf_fx = 1; // Using minimum value to avoid division by zero move16(); } -- GitLab From 9fcefe42dc8ebee5212e603020160fee4045fb2d Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:52:10 +0200 Subject: [PATCH 5/6] added saturation to right shift as precaution --- lib_rend/ivas_reverb_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 35b7e6452..9ee1bb9b8 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -703,7 +703,7 @@ static ivas_error compute_t60_coeffs_fx( } ELSE { - tmp = shr( tmp, sub( 5, e ) ); // scaling tmp to Q15 + tmp = shr_sat( tmp, sub( 5, e ) ); // scaling tmp to Q15 target_gains_db_fx[bin_idx] = mult( shr( min120q8, 1 ), tmp ); // Q8 } } -- GitLab From e31721811b6a8d84694de08e5046400250563b12 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:05:41 +0200 Subject: [PATCH 6/6] pull latest merge + clang patch --- lib_rend/ivas_reverb_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 9ee1bb9b8..745644165 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -703,7 +703,7 @@ static ivas_error compute_t60_coeffs_fx( } ELSE { - tmp = shr_sat( tmp, sub( 5, e ) ); // scaling tmp to Q15 + tmp = shr_sat( tmp, sub( 5, e ) ); // scaling tmp to Q15 target_gains_db_fx[bin_idx] = mult( shr( min120q8, 1 ), tmp ); // Q8 } } -- GitLab