diff --git a/lib_com/options.h b/lib_com/options.h index ed11ab3cfe704cebeb596fc37f64fa9b7aca1a3a..117bbda11b296f828d588860ed3594436c77c7d0 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 9dfdddda17ac93923852914e3f2242e0cfe40eee..61c4bf0ce36a45451877ca5986aecc1d7a65a5db 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,34 @@ 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 ); + move16(); + move16(); + move16(); + } +#else IF( EQ_16( st->core, TCX_20_CORE ) ) { nSubframes[ch] = 1; @@ -1549,6 +1581,7 @@ void ivas_mdct_core_tns_ns_fx( move16(); L_spec[ch] = shl( L_spec[ch], add( exp, 1 ) ); move16(); +#endif test(); test();