From 25a76cd3b102b7657805e731a921c0d8c5b18737 Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 17 Jun 2023 13:08:21 +0200 Subject: [PATCH 1/3] issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching; under FIX_559_EXTL_IGF_MISMATCH --- lib_com/options.h | 3 +++ lib_enc/ivas_core_pre_proc.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7350f8ec6e..d5040c88ae 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,6 +159,9 @@ #define IGF_TUNING_96 /* FhG: Issue 546: slight tuning of IGF config used in 96 kbps stereo, 128 kbps SBA and others */ +#define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ + + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index 9c4942314d..c2b4d61544 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -129,11 +129,7 @@ ivas_error pre_proc_ivas( { st->L_frame = L_FRAME32k; } -#ifdef FIX_557_CRASH_IN_ISM_DTX - else if ( st->bwidth >= SWB && st->total_brate > MAX_ACELP_BRATE_ISM && st->total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE && st->is_ism_format && st->tcxonly && st->core_brate != SID_2k40 ) -#else else if ( st->bwidth >= SWB && st->total_brate > MAX_ACELP_BRATE_ISM && st->total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE && st->is_ism_format && st->tcxonly ) -#endif { st->L_frame = L_FRAME25_6k; } @@ -289,6 +285,13 @@ ivas_error pre_proc_ivas( else if ( element_brate != last_element_brate ) { SetModeIndex( st, st->bits_frame_nominal * FRAMES_PER_SEC, element_mode, MCT_flag ); + +#ifdef FIX_559_EXTL_IGF_MISMATCH + if ( st->extl != -1 && st->extl != IGF_BWE && st->igf == 1 ) + { + st->igf = 0; + } +#endif } -- GitLab From 792a54f6b6cd24b5573869d118e5fb8f5733944d Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 17 Jun 2023 13:25:57 +0200 Subject: [PATCH 2/3] simplify condition under FIX_559_EXTL_IGF_MISMATCH --- lib_enc/ivas_core_enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 6536ee333e..2d5ae793c7 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -368,7 +368,11 @@ ivas_error ivas_core_enc( } /* SWB TBE encoder */ +#ifdef FIX_559_EXTL_IGF_MISMATCHaa + if ( st->extl == SWB_TBE || st->extl == FB_TBE ) +#else if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->igf && st->core == ACELP_CORE && st->extl != WB_TBE ) ) +#endif { if ( st->core_brate != FRAME_NO_DATA && st->core_brate != SID_2k40 ) { -- GitLab From 57c9164f8d88e89e102c6a6656aff3e6a1f1ad05 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 19 Jun 2023 10:04:59 +0200 Subject: [PATCH 3/3] revision of defines --- lib_enc/ivas_core_enc.c | 2 +- lib_enc/ivas_core_pre_proc.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 2d5ae793c7..5d72b7126f 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -368,7 +368,7 @@ ivas_error ivas_core_enc( } /* SWB TBE encoder */ -#ifdef FIX_559_EXTL_IGF_MISMATCHaa +#ifdef FIX_559_EXTL_IGF_MISMATCH if ( st->extl == SWB_TBE || st->extl == FB_TBE ) #else if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->igf && st->core == ACELP_CORE && st->extl != WB_TBE ) ) diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index c2b4d61544..1e8284f86b 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -129,7 +129,11 @@ ivas_error pre_proc_ivas( { st->L_frame = L_FRAME32k; } +#ifdef FIX_557_CRASH_IN_ISM_DTX + else if ( st->bwidth >= SWB && st->total_brate > MAX_ACELP_BRATE_ISM && st->total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE && st->is_ism_format && st->tcxonly && st->core_brate != SID_2k40 ) +#else else if ( st->bwidth >= SWB && st->total_brate > MAX_ACELP_BRATE_ISM && st->total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE && st->is_ism_format && st->tcxonly ) +#endif { st->L_frame = L_FRAME25_6k; } -- GitLab