From 8328538362f759e32e430d4d0d50b398a25125bf Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 9 Oct 2023 12:56:17 +0200 Subject: [PATCH 1/2] issue 849: fix OMASA 2TC and FEC crashes; under NONBE_FIX_849_OMASA_BFI_CRASH --- lib_com/options.h | 2 ++ lib_dec/ivas_cpe_dec.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 89f4a28754..1b8b050422 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -185,6 +185,8 @@ #define NONBE_FIX_840_PARAMMC_RS /* FhG: Issue #840: Resolve "MC RS ParamMC hoa encoder wrongly set to zero" */ #define NONBE_FIX_826_JBM_MASA_CNA_CNG /* FhG: issue #826: Resolve "JBM MASA: CNA and CNG not in sync with non-JBM decoding" */ #define NONBE_FIX_835_JBM_PARAMUPMIX_HEADROT /* FhG: issue #835: Resolve "JBM: ParamUpmix head rotation broken" */ +#define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */ + /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 7bf06e18ee..b0dc8d5ed8 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -1106,7 +1106,11 @@ static void stereo_mode_combined_format_dec( { int32_t element_brate_ref; +#ifdef NONBE_FIX_849_OMASA_BFI_CRASH + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && !st_ivas->bfi ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) +#endif { element_brate_ref = hCPE->element_brate; -- GitLab From 08c22851dad08f0a2bce3b2a0ec7aa3c2f23d84f Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 9 Oct 2023 15:10:29 +0200 Subject: [PATCH 2/2] update within NONBE_FIX_849_OMASA_BFI_CRASH --- lib_dec/ivas_cpe_dec.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index b0dc8d5ed8..b460948a98 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -1106,11 +1106,7 @@ static void stereo_mode_combined_format_dec( { int32_t element_brate_ref; -#ifdef NONBE_FIX_849_OMASA_BFI_CRASH - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && !st_ivas->bfi ) -#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { element_brate_ref = hCPE->element_brate; @@ -1118,15 +1114,22 @@ static void stereo_mode_combined_format_dec( ( ( st_ivas->nchan_ism == 3 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_96k ) || ( st_ivas->nchan_ism == 4 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_128k ) ) ) { - /* read OMASA stereo mode signalling */ - if ( get_next_indice( hCPE->hCoreCoder[0], NBITS_ELEMENT_MODE ) ) - { - hCPE->element_mode = IVAS_CPE_MDCT; - } - else +#ifdef NONBE_FIX_849_OMASA_BFI_CRASH + if ( !st_ivas->bfi ) { - hCPE->element_mode = IVAS_CPE_DFT; +#endif + /* read OMASA stereo mode signalling */ + if ( get_next_indice( hCPE->hCoreCoder[0], NBITS_ELEMENT_MODE ) ) + { + hCPE->element_mode = IVAS_CPE_MDCT; + } + else + { + hCPE->element_mode = IVAS_CPE_DFT; + } +#ifdef NONBE_FIX_849_OMASA_BFI_CRASH } +#endif if ( hCPE->element_mode == IVAS_CPE_MDCT ) { -- GitLab