diff --git a/lib_com/options.h b/lib_com/options.h index 42a41806b2b0252798aaffbb5b635199f7a136b0..6a82ff168e26d68aafa735ba747406a67b7fa9f6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,7 @@ /* any switch which is non-be wrt. TS 26.258 V3.0 */ #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_1283_STEREO_DFT_COLLAPSE /* FhG: issue 1283: fix for critical issue with DFT stereo core coder */ #define FIX_1500_ISM_MD_DTX /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */ diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index ad070b9d3db7a98394c904ebd0f214f56c3231f5..3d0036ea4d35f730110ddf06ef23210cd5030e21 100644 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -728,7 +728,11 @@ void ShapeSpectrum( hTcxCfg->SFM2 = SFM_Cal( spectrum, min( 200, L_frame ) ); } +#ifndef FIX_1283_STEREO_DFT_COLLAPSE if ( ( total_brate <= ACELP_13k20 && st->bwidth == SWB ) ) +#else + if ( ( total_brate <= ACELP_13k20 && st->bwidth == SWB ) || ( st->element_brate <= IVAS_16k4 && st->element_mode == IVAS_CPE_DFT && st->bwidth == SWB ) ) +#endif { max_low_pre = 0.f; for ( i = 0; i < L_frame; i++ ) @@ -772,8 +776,12 @@ void ShapeSpectrum( v_multc( spectrum + L_frame, 1.f / gainlpc[FDNS_NPTS - 1], spectrum + L_frame, L_spec - L_frame ); } - /* reduce the peaks in the IGF region, to make life of the core-coder easier... */ +/* reduce the peaks in the IGF region, to make life of the core-coder easier... */ +#ifndef FIX_1283_STEREO_DFT_COLLAPSE if ( total_brate <= ACELP_13k20 && st->bwidth == SWB ) +#else + if ( ( total_brate <= ACELP_13k20 && st->bwidth == SWB ) || ( st->element_brate <= IVAS_16k4 && st->element_mode == IVAS_CPE_DFT && st->bwidth == SWB ) ) +#endif { int16_t dist_low, dist_high; float max_fac; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 603463b23cc2ef1441fb14dbfa67c8f413db03d1..569be1b8ca7e71dcc9a1e64e3d5f9cb896410eb2 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1315,6 +1315,9 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( if ( hEncoderConfig->ivas_format == MONO_FORMAT ) /* EVS mono */ { hCoreCoder->total_brate = hEncoderConfig->ivas_total_brate; /* needed in case of bitrate switching */ +#ifdef FIX_1283_STEREO_DFT_COLLAPSE + hCoreCoder->element_brate = hEncoderConfig->ivas_total_brate; /* needed in checks in core-coder functions other than mono*/ +#endif #ifdef DEBUGGING hCoreCoder->id_element = 0; #endif