diff --git a/lib_com/options.h b/lib_com/options.h index c5fa1d384f0a1fc371c6945452ad194a27a4a990..dd5f95a2f17224fb6586c061d47ba6a42686698f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -149,6 +149,7 @@ #define FIX_1_CUSTOM_LS /* fix bug 1-ivas-internal-error-in-decoder-for-custom-loudspeaker-format-with-sba-input-at-24-4kbps */ #define FIX_TDREND_STANDALONE /* Fix for TD standalone renderer (broken after update of hHrtfTD pointer and addition of hRenderConfig */ +#define FIX_MDCT_KERNEL_RATE_SWITCHING_PLC /* force kernel that can handle ACELP -> TCX transition frame lengths for transition frames in decoder */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 77c70b1f9f48bb3db63ad39f6272202cc0196b67..b07a8200fa09543f8b673c6e2ecc5b22cc58919b 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -872,7 +872,11 @@ void ivas_mdct_core_reconstruct( { decoder_tcx_imdct( st, L_frame_global[ch], L_frame_globalTCX[ch], L_spec[ch], tcx_offset[ch], tcx_offsetFB[ch], L_frame[ch], L_frameTCX[ch], left_rect[ch], &x[ch][k][0], xn_buf, - ( st->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && st->hTcxDec->kernel_type[k] == MDST_IV ) ? MDCT_IV : st->hTcxDec->kernel_type[k], +#ifdef FIX_MDCT_KERNEL_RATE_SWITCHING_PLC + (( hCPE->nchan_out == 1 && st->hTcxDec->kernel_type[k] == MDST_IV ) || st->hTcxCfg->tcx_last_overlap_mode == TRANSITION_OVERLAP ) ? MDCT_IV : st->hTcxDec->kernel_type[k], +#else + ( hCPE->nchan_out == 1 && st->hTcxDec->kernel_type[k] == MDST_IV ) ? MDCT_IV : st->hTcxDec->kernel_type[k], +#endif fUseTns[ch][k], &synth[k * L_frame[ch]], &synthFB[k * L_frameTCX[ch]], bfi, k, isLFE, 0 ); } else