diff --git a/lib_com/options.h b/lib_com/options.h index 37eacd0a9f1f688a70ea996e754765ae67c06d33..7d27df834354941417fb35e46914e6b8817f3547 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -198,6 +198,7 @@ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ #define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia: Default room sizes support */ +#define FIX_BASOP_ISSUE_1585_CUT_BS_CRASH /* FhG: Fix for BASOP issue 1585 crash of a cut bitstream, also valid for float code*/ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 6445970f2a9309bce07356f9ef270e1d315b7668..f9ba20e70774938fafbd72e840c7f3a11706b7e1 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -663,7 +663,7 @@ ivas_error core_switching_post_dec( } else if ( ( ( st->last_core == ACELP_CORE || st->last_core_bfi == ACELP_CORE ) && !( st->prev_bfi == 1 && st->last_con_tcx == 1 ) ) || st->last_core == AMR_WB_CORE ) /*ACELP->TCX/HQ*/ { - /* if this is first active MDCT-Stereo frame after a CNG frame and output format is mono DMX, this should only be done for the zero-th channel, the other one will simply be copied over after this function */ + /* if output format is mono DMX, this should only be done for the zero-th channel, the other one will simply be copied over after this function */ if ( ( ( st->last_core_brate != SID_2k40 && st->last_core_brate != FRAME_NO_DATA ) || ( st->element_mode != IVAS_CPE_DFT && st->element_mode != IVAS_CPE_TD ) || nchan_out == 1 ) && !( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 && ( nchan_out == 1 || last_element_mode == IVAS_CPE_DFT ) ) ) { core_switch_lb_upsamp( st, output ); diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index ce9cf08e9064af2bd05057d4ea0b1c00f90cd158..5f96a8be58547bb421b76fe870461469376c9892 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -160,6 +160,13 @@ static void dec_prm_tcx_sidebits( st->last_core_from_bs = st->last_core; } +#ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH + /* for first frame reset last_core to initialization value for better error-robustness*/ + if ( st->ini_frame == 0 ) + { + st->last_core = TCX_20_CORE; + } +#endif getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st0 ); st->hTcxDec->kernel_type[0] = st->hTcxDec->kernel_type[1] = MDCT_IV;