From 2a4d33a273bffb913438f251bcccc2483b769af5 Mon Sep 17 00:00:00 2001 From: naghibza Date: Wed, 10 Jun 2026 15:46:07 +0200 Subject: [PATCH 1/2] Accumulate 10^(ILD/10) using a dynamic exponent. --- lib_com/options.h | 1 + lib_dec/ivas_mc_param_dec_fx.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index f37a0c7a8..1cf2f7d4b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,6 +100,7 @@ #define NONBE_FIX2614_LP_CNG_ASSERT /* FhG: */ #define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */ #define FIX_BASOP_1765_MASA1TC_CNG_MISMATCH /* Nokia: BASOP issue 1765: Improve accuracy of FD CNG noise estimation */ +#define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 4a191876c..e3ab27843 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -756,9 +756,11 @@ ivas_error ivas_param_mc_dec_reconfig_fx( Word16 num_param_lfe; Word16 *p_icc_new_fx = hParamMC->icc_q_fx; // Q15 Word16 *p_ild_new_fx = hParamMC->icld_q_fx; // Q8 +#ifndef FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP Word16 p_ild_new_e = 23; move16(); Word16 p_ild_new_tmp; +#endif /* ICC */ num_param_lfe = hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe; @@ -785,6 +787,23 @@ ivas_error ivas_param_mc_dec_reconfig_fx( { FOR( param_idx = 0; param_idx < num_param_lfe; param_idx++ ) { +#ifdef FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP + Word32 acc_m = 0; + move32(); + Word16 acc_e = 0; + move16(); + FOR( source_param_idx = 0; source_param_idx < parameter_band_mapping.n_source_bands[new_param_band_idx]; source_param_idx++ ) + { + Word32 term_m; + Word16 term_e; + term_m = BASOP_util_Pow2( L_mult0( 10885 /*log2(10)/10*2^15*/, ild_q_old_fx[parameter_band_mapping.source_band_idx[new_param_band_idx][source_param_idx] * num_param_lfe + param_idx] ), 8, &term_e ); + term_m = Mpy_32_16_1( term_m, parameter_band_mapping.source_band_factor_fx[new_param_band_idx][source_param_idx] ); /* * factor (Q15) */ + acc_m = BASOP_Util_Add_Mant32Exp( acc_m, acc_e, term_m, term_e, &acc_e ); + } + /* log2 term is Q25; Mpy_32_16_1( Q25, Q13 ) -> Q(25+13-15) = Q23; L_shr( Q23, 15 ) -> Q8 */ + *p_ild_new_fx = extract_l( L_shr( Mpy_32_16_1( L_add( BASOP_Util_Log2( acc_m ), L_shl( acc_e, Q25 ) ), 24660 /*10*log10(2) in Q13*/ ), 15 ) ); // Q8 + move16(); +#else *p_ild_new_fx = 0; move16(); FOR( source_param_idx = 0; source_param_idx < parameter_band_mapping.n_source_bands[new_param_band_idx]; source_param_idx++ ) @@ -795,6 +814,7 @@ ivas_error ivas_param_mc_dec_reconfig_fx( } *p_ild_new_fx = extract_l( L_shr( Mpy_32_16_1( L_add( BASOP_Util_Log2( *p_ild_new_fx ), L_add( 16 << Q25, L_shl( p_ild_new_e, 25 ) ) ), 24660 /*3.Q13*/ ), 15 ) ); // Q8 move16(); +#endif p_ild_new_fx++; } } -- GitLab From 5ee8decc3f1c149a74b5e0867c24f696609555dc Mon Sep 17 00:00:00 2001 From: naghibza Date: Thu, 11 Jun 2026 09:42:52 +0200 Subject: [PATCH 2/2] Replace extract_l(L_shr(...)) with extract_h(L_shl(...)) --- lib_dec/ivas_mc_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index e3ab27843..ac13c315f 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -800,8 +800,8 @@ ivas_error ivas_param_mc_dec_reconfig_fx( term_m = Mpy_32_16_1( term_m, parameter_band_mapping.source_band_factor_fx[new_param_band_idx][source_param_idx] ); /* * factor (Q15) */ acc_m = BASOP_Util_Add_Mant32Exp( acc_m, acc_e, term_m, term_e, &acc_e ); } - /* log2 term is Q25; Mpy_32_16_1( Q25, Q13 ) -> Q(25+13-15) = Q23; L_shr( Q23, 15 ) -> Q8 */ - *p_ild_new_fx = extract_l( L_shr( Mpy_32_16_1( L_add( BASOP_Util_Log2( acc_m ), L_shl( acc_e, Q25 ) ), 24660 /*10*log10(2) in Q13*/ ), 15 ) ); // Q8 + /* log2 term is Q25; Mpy_32_16_1( Q25, Q13 ) -> Q(25+13-15) = Q23; L_shl( Q23, 1 ) -> Q24 - Q16 = Q8 */ + *p_ild_new_fx = extract_h( L_shl( Mpy_32_16_1( L_add( BASOP_Util_Log2( acc_m ), L_shl( acc_e, Q25 ) ), 24660 /*10*log10(2) in Q13*/ ), 1 ) ); // Q8 move16(); #else *p_ild_new_fx = 0; -- GitLab