From c49fbd1c8a713e0ac715ff3afd56538ee55d6c70 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Thu, 13 Nov 2025 10:42:35 +0100 Subject: [PATCH 1/5] port fix for issue 1585 from float --- lib_com/options.h | 1 + lib_dec/ivas_mdct_core_dec_fx.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 1ac25c892..9135c33eb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define NONBE_FIX_1172_OBJ_EDIT_JBM /* VA: issue 1172: fix OMASA object editing in JBM */ #define FIX_2193_ISM_GAINS_WITH_OE /* FhG: fix issue 2193: use edited angles in ISM gain calculation */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ +#define FIX_BASOP_ISSUE_1585_CUT_BS_CRASH /* FhG: Fix for BASOP issue 1585 crash of a cut bitstream, also valid for float code*/ // RTPDUMP porting #define RTP_S4_251135_CR26253_0016_REV1 /* RTP Pack/Unpack API corresponding to CR 26253 */ diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index b95125885..14b1f29eb 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -185,6 +185,12 @@ static void dec_prm_tcx_sidebits_fx( move16(); } +#ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH + /* for first frame reset last_core to initialization value for better error-robustness*/ + st->last_core = -1; + move16(); +#endif + getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st0 ); st->hTcxDec->kernel_type[0] = st->hTcxDec->kernel_type[1] = MDCT_IV; -- GitLab From e376968928777b199e83d2ecc85c6bbfbdc32dc2 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Thu, 13 Nov 2025 10:55:47 +0100 Subject: [PATCH 2/5] add forgotten if condition --- lib_dec/ivas_mdct_core_dec_fx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index bf6229b02..83a55803b 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -187,8 +187,11 @@ static void dec_prm_tcx_sidebits_fx( #ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH /* for first frame reset last_core to initialization value for better error-robustness*/ - st->last_core = -1; - move16(); + IF( EQ_16( st->last_core, 0 ) ) + { + st->last_core = -1; + move16(); + } #endif getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st0 ); -- GitLab From f2adeb892b71cf5f480108b637e8a80c85d363a8 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Thu, 13 Nov 2025 18:05:59 +0100 Subject: [PATCH 3/5] port fixes from float ivas-codec main --- lib_dec/ivas_mdct_core_dec_fx.c | 2 +- lib_dec/ivas_stereo_switching_dec_fx.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 83a55803b..34a681020 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -189,7 +189,7 @@ static void dec_prm_tcx_sidebits_fx( /* for first frame reset last_core to initialization value for better error-robustness*/ IF( EQ_16( st->last_core, 0 ) ) { - st->last_core = -1; + st->last_core = TCX_20_CORE; move16(); } #endif diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 76e4d226d..e5690ac42 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -2049,6 +2049,10 @@ void stereo_switching_dec( move32(); sts[1]->hTcxDec->conceal_eof_gain_e = sts[0]->hTcxDec->conceal_eof_gain_e; move16(); +#ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH + sts[1]->ini_frame = sts[0]->ini_frame; + move16(); +#endif } return; -- GitLab From 9cf576dce37db854697419e2aee46495eb7ad94a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 13 Nov 2025 18:50:18 +0100 Subject: [PATCH 4/5] fix condition --- lib_dec/ivas_mdct_core_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 34a681020..f9d738695 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -187,7 +187,7 @@ static void dec_prm_tcx_sidebits_fx( #ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH /* for first frame reset last_core to initialization value for better error-robustness*/ - IF( EQ_16( st->last_core, 0 ) ) + IF( EQ_16( st->ini_frame, 0 ) ) { st->last_core = TCX_20_CORE; move16(); -- GitLab From 6ccf5a0924852c3ff096b1d15b20047ad2be05f6 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Thu, 13 Nov 2025 22:43:41 +0100 Subject: [PATCH 5/5] remove bitrate switching fix to retain BE --- lib_dec/ivas_stereo_switching_dec_fx.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index e5690ac42..76e4d226d 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -2049,10 +2049,6 @@ void stereo_switching_dec( move32(); sts[1]->hTcxDec->conceal_eof_gain_e = sts[0]->hTcxDec->conceal_eof_gain_e; move16(); -#ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH - sts[1]->ini_frame = sts[0]->ini_frame; - move16(); -#endif } return; -- GitLab