diff --git a/lib_com/options.h b/lib_com/options.h index e327b58ecb701576b5da7f421851a372016c3b65..6e37b5440b9f33f56360f1b94de987fb3afe5e9e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,8 @@ #define FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION /* Dolby: issue 1465: Fix constant in create_random_vector() to allow more reliable fixed point port */ #define FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG /* Eri: Basop issue 2317: Uninitialized value read in case of DTX and BW switching */ #define FIX_1283_STEREO_DFT_COLLAPSE /* FhG: issue 1283: fix for critical issue with DFT stereo core coder */ +#define FIX_2396_OOB_JBM_16KHZ /* VA: basop issue 2396: fix OOB scaling of buffer output_32_fx[] in JBM at 16kHz */ + /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index bebc8a6a420c0d8150ee24176f427b290f60969a..bb21d5f0ad1d8c18f5af9dd28c3af125284f990b 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -79,6 +79,30 @@ ivas_error ivas_dec( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); +#ifdef FIX_2396_OOB_JBM_16KHZ + if ( st_ivas->hDecoderConfig->Opt_tsm ) + { + int16_t len_offset, offset; + DECODER_TC_BUFFER_HANDLE hTcBuffer; + hTcBuffer = st_ivas->hTcBuffer; + + /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': + set TC buffers to their original locations if they were changed in ivas_dec_feed_tc_to_renderer() */ + len_offset = NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ); + + IF( LT_16( len_offset, L_FRAME48k ) ) + { + offset = 0; + for ( n = 0; n < s_max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); n++ ) + { + hTcBuffer->tc[n] = &hTcBuffer->tc_buffer[offset]; + st_ivas->p_output_f[n] = hTcBuffer->tc[n]; + offset += L_FRAME48k; + } + } + } + +#endif /* set pointers to transport channels audio */ for ( n = 0; n < MAX_TRANSPORT_CHANNELS; n++ ) {