From e37facbfd0af74a7ea5ec1f6135219867e551338 Mon Sep 17 00:00:00 2001 From: kiene Date: Wed, 2 Nov 2022 15:45:57 +0100 Subject: [PATCH] only copy from buffer if it was written to before --- lib_com/options.h | 1 + lib_dec/ivas_post_proc.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 9bdbbc81aa..8c9e60ab79 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,6 +153,7 @@ #define FIX_I173_I174 /* Issues 173 and 174: Remove frame and subframe index from ISm metadata and headtracking respectively. */ #define FIX_TCX_DEC_RECONF_BFI #define FIX_SBA_DTX_DECODE_ERROR /* Issue 176: SBA decoder error with DTX at 80kbps SWB, Issue 21: SBA front-VAD threshold (203) */ +#define FIX_MSAN_ERROR_STEREO_RATE_SWITCHING /* addresses Issue 177 */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c index a295a8b2a2..b2cc27d5ef 100644 --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -478,7 +478,11 @@ void stereo_dft_dec_core_switching( mvr2r( output, pAp_input, st->L_frame ); } +#ifdef FIX_MSAN_ERROR_STEREO_RATE_SWITCHING + if ( st->last_core == ACELP_CORE && !( st->prev_bfi == 1 && st->last_core == ACELP_CORE && st->last_con_tcx == 1 ) && !st->tcxonly ) /* ACELP -> TCX/HQ-Core */ +#else if ( st->last_core == ACELP_CORE && !( st->prev_bfi == 1 && st->last_core == ACELP_CORE && st->last_con_tcx == 1 ) ) /* ACELP -> TCX/HQ-Core */ +#endif { mvr2r( tcx_core_buf, tmp_fade, ap_fade_len ); for ( i = 0; i < ap_fade_len; i++ ) -- GitLab