From 141e53d38ef23a882575178e9b636b512ba14522 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 19 Mar 2026 19:06:46 +0100 Subject: [PATCH 1/2] Remove HARM_HQ_CORE_KEEP_BE in hq_lr_enc_fx.c --- lib_enc/hq_lr_enc_fx.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index 663cee4b9..9165eb842 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -206,11 +206,7 @@ void hq_lr_enc_fx( } ELSE { -#ifdef HARM_HQ_CORE_KEEP_BE - hqswb_clas_fx = peak_avrg_ratio_fx( HQ_BWE_CROSSOVER_BRATE, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ -#else hqswb_clas_fx = peak_avrg_ratio_fx( st_fx->total_brate, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ -#endif } /* write the classification information into the bitstream */ -- GitLab From fe685a0ff83c067ee0a61fea569d05616fd9e99b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 20 Mar 2026 07:22:30 +0100 Subject: [PATCH 2/2] Fix misalignment in peak_avrg_ratio_fx --- lib_com/options.h | 2 +- lib_enc/hq_classifier_enc_fx.c | 4 ++++ lib_enc/hq_lr_enc_fx.c | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index eb5d8a66e..a98a6cd70 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -89,7 +89,7 @@ #define FIX_2455_HARMONIZE_generate_comfort_noise_enc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */ #define FIX_2455_HARMONIZE_configureFdCngEnc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */ #define FIX_2463_EVS_BWE_LSF /* VA: basop issue 2463: harmonize calling of Quant_BWE_LSF_fx() */ - +#define FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM /* Eri: Basop issue 2453: Fix alignment of peak_avrg_ratio_fx */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/hq_classifier_enc_fx.c b/lib_enc/hq_classifier_enc_fx.c index a17b07876..c9cf8856b 100644 --- a/lib_enc/hq_classifier_enc_fx.c +++ b/lib_enc/hq_classifier_enc_fx.c @@ -387,7 +387,11 @@ Word16 peak_avrg_ratio_fx( test(); test(); test(); +#ifdef FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM + IF( ( GE_16( add( k, k1 ), 5 ) && GT_16( k1, 2 ) && LT_32( total_brate, HQ_BWE_CROSSOVER_BRATE ) && GT_32( total_brate, HQ_16k40 ) ) || ( ( ( GE_16( add( k, k1 ), 10 ) && GT_16( k1, 5 ) ) || GE_16( *mode_count, 5 ) ) && LT_16( *mode_count1, 5 ) ) ) +#else IF( ( GE_16( add( k, k1 ), 5 ) && GT_16( k1, 2 ) && LT_32( total_brate, HQ_BWE_CROSSOVER_BRATE ) ) || ( ( ( GE_16( add( k, k1 ), 10 ) && GT_16( k1, 5 ) ) || GE_16( *mode_count, 5 ) ) && LT_16( *mode_count1, 5 ) ) ) +#endif { hqswb_clas = HQ_HARMONIC; move16(); diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index 9165eb842..e60f66bdc 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -206,7 +206,15 @@ void hq_lr_enc_fx( } ELSE { +#ifdef FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM hqswb_clas_fx = peak_avrg_ratio_fx( st_fx->total_brate, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ +#else +#ifdef HARM_HQ_CORE_KEEP_BE + hqswb_clas_fx = peak_avrg_ratio_fx( HQ_BWE_CROSSOVER_BRATE, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ +#else + hqswb_clas_fx = peak_avrg_ratio_fx( st_fx->total_brate, L_t_audio, NUMC_N, &hHQ_core->mode_count, &hHQ_core->mode_count1, SWB_BWE_LR_Qs ); /* Q0 */ +#endif +#endif } /* write the classification information into the bitstream */ -- GitLab