From 1b4e97616af91a775ae378d7819e471c92c227d0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 22 Apr 2026 13:40:12 +0200 Subject: [PATCH 1/2] BASOP issue 2555: Simplify (sub-)framelength calculation in ivas_mdct_core_tns_ns_fx() --- lib_com/options.h | 1 + lib_dec/ivas_mdct_core_dec_fx.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index b7f1ae377..463b76bb0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,6 +102,7 @@ #define HARMONIZE_2537_SetTCXModeInfo /* FhG: Harmonize SetTCXModeInfo - IVAS_VERSION OBVIOUSLY NOT FITTING FOR EVS - pipes not green */ #define HARMONIZE_2537_GetTCXMaxenergyChange /* FhG: Harmonize GetTCXMaxenergyChange */ #define HARMONIZE_2508_InitTransientDetection /* FhG: harmonize GetAttackForTCXDecision derivates for evs/ivas */ +#define FIX_BASOP_2555_FRAMELEN_CALC /* FhG: BASOP issue 2555: Simplify (sub-)framelength calculation in ivas_mdct_core_tns_ns_fx() */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 9dfdddda1..be54f0b1f 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1510,7 +1510,11 @@ void ivas_mdct_core_tns_ns_fx( Word16 left_rect[CPE_CHANNELS]; Word16 L_spec[CPE_CHANNELS]; Word32 sns_int_scf_fx[FDNS_NPTS]; +#ifdef FIX_BASOP_2555_FRAMELEN_CALC + Word16 length; +#else Word16 exp, length; +#endif /* Initializations */ sts = hCPE->hCoreCoder; @@ -1525,6 +1529,31 @@ void ivas_mdct_core_tns_ns_fx( FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { st = sts[ch]; +#ifdef FIX_BASOP_2555_FRAMELEN_CALC + IF( EQ_16( st->core, TCX_20_CORE ) ) + { + nSubframes[ch] = 1; + move16(); + + L_frame_global[ch] = st->L_frame; + L_frameTCX_glob[ch] = st->hTcxDec->L_frameTCX; + L_spec[ch] = st->hTcxCfg->tcx_coded_lines; + move16(); + move16(); + move16(); + } + ELSE + { + nSubframes[ch] = NB_DIV; + move16(); + + assert( nSubframes[ch] == 2 && "Unexpected value for nSubframes[ch], NB_DIV (expected to be 2)." ); + + L_frame_global[ch] = shr( st->L_frame, 1 ); + L_frameTCX_glob[ch] = shr( st->hTcxDec->L_frameTCX, 1 ); + L_spec[ch] = shr( st->hTcxCfg->tcx_coded_lines, 1 ); + } +#else IF( EQ_16( st->core, TCX_20_CORE ) ) { nSubframes[ch] = 1; @@ -1549,6 +1578,7 @@ void ivas_mdct_core_tns_ns_fx( move16(); L_spec[ch] = shl( L_spec[ch], add( exp, 1 ) ); move16(); +#endif test(); test(); -- GitLab From 3e98549711db6795136d86fb9ee0b64b93122957 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 22 Apr 2026 14:10:13 +0200 Subject: [PATCH 2/2] added missing move16()s --- lib_dec/ivas_mdct_core_dec_fx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index be54f0b1f..61c4bf0ce 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1552,6 +1552,9 @@ void ivas_mdct_core_tns_ns_fx( L_frame_global[ch] = shr( st->L_frame, 1 ); L_frameTCX_glob[ch] = shr( st->hTcxDec->L_frameTCX, 1 ); L_spec[ch] = shr( st->hTcxCfg->tcx_coded_lines, 1 ); + move16(); + move16(); + move16(); } #else IF( EQ_16( st->core, TCX_20_CORE ) ) -- GitLab