From f309031e8accc05c1bf3de35cf5c5cec1197bee7 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Tue, 11 Feb 2025 12:29:18 +0530 Subject: [PATCH] [3GPP-Issue #1102] Address sanity bug causes crash on linux runners with ivas-float-update and newly added .prm file for encoder tests --- lib_com/options.h | 1 + lib_dec/ivas_mct_dec.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 1b2c15f87..283553640 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,4 +154,5 @@ #define FIX_ISSUE_1245 /* Ittiam: Fix for issue 1245: Basop Encoder: Audible noise for silent Stereo input DTX on @24.4 kbps, @32 kbps*/ #define FIX_MINOR_SVD_WMOPS_MR1010X /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */ #define SVD_WMOPS_OPT /* Ittiam : SVD related optimizations */ +#define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ #endif diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 33a71fbcf..a8cda4e58 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -86,6 +86,10 @@ ivas_error ivas_mct_dec_fx( set16_fx( x_len[0], 0, NB_DIV ); set16_fx( x_len[1], 0, NB_DIV ); Decoder_State **sts; +#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS + Word32 *p_output_orig_fx[2]; + Word32 synth_32_fx[CPE_CHANNELS][L_FRAME_PLUS]; +#endif Word16 synth_fx[CPE_CHANNELS][L_FRAME_PLUS]; //(Q_synth) Word32 ivas_total_brate; ivas_error error; @@ -162,6 +166,18 @@ ivas_error ivas_mct_dec_fx( /* MCT side bits decoder */ ivas_mct_side_bits_fx( hMCT, st_ivas->hCPE, nCPE, st_ivas->hCPE[0]->hCoreCoder[0], st_ivas->bfi, st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream, ivas_total_brate, nb_bits_metadata ); +#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS + /* in case of switching from an SID frame (with ACELP core) to MCT, buffer of L_FRAME_PLUS samples is needed -> use synth[] as a temporary buffer */ + IF( st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE ) + { + FOR( n = 0; n < CPE_CHANNELS; n++ ) + { + p_output_orig_fx[n] = output_fx[n]; + output_fx[n] = synth_32_fx[n]; + } + } +#endif + FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { st_ivas->hCPE[cpe_id]->hCoreCoder[0]->BER_detect = s_or( st_ivas->hCPE[cpe_id]->hCoreCoder[0]->BER_detect, st_ivas->BER_detect ); @@ -371,6 +387,18 @@ ivas_error ivas_mct_dec_fx( } } +#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS + /* set pointers back */ + test(); + IF( cpe_id == 0 && st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE ) + { + FOR( n = 0; n < CPE_CHANNELS; n++ ) + { + output_fx[n] = p_output_orig_fx[n]; + } + } + +#endif /*----------------------------------------------------------------* * CoreCoder Post-processing and updates -- GitLab