From 49cd6b430cadbe6ba174170bf78be1437ecb4abc Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 3 Jul 2024 09:54:56 +0200 Subject: [PATCH] fix issue 791 in float reference code --- lib_com/options.h | 2 ++ lib_dec/ivas_core_dec.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 3781b07be..28c84b1dc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -68,6 +68,8 @@ #define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ #define NONBE_FIX_1069_SVD_TUNING /* FhG: issue 1069: tune SVD constants */ #define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO /* Eri: Issue 1010: Division by zero in Stereo CNG */ +#define NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES /* FhG: issue 1133: skip de-whitening of bg noise shape after frameloss period if the first good frame is an SID */ +#define NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID /* FhG: issue 1133: in TCX PLC, don't scale hHQ_core->old_out after applying fade to noise in burst frame error */ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index aa3c2a8c8..880608479 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -183,7 +183,12 @@ ivas_error ivas_core_dec( st->flagGuidedAcelp = 0; } +#ifdef NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID + if ( !st->bfi && st->prev_bfi && st->total_brate > SID_2k40 && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL ) +#else + if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL ) +#endif { v_multc( st->hHQ_core->old_out, st->hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, st->hHQ_core->old_out, st->hTcxDec->L_frameTCX ); v_multc( st->hHQ_core->old_outLB, st->hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, st->hHQ_core->old_outLB, st->L_frame ); @@ -396,10 +401,17 @@ ivas_error ivas_core_dec( { updateBuffersForDmxMdctStereo( hCPE, output_frame, output, synth ); } +#ifdef NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES + + /* On first good active frame after frameloss undo the whitening of the bg noise shape */ + if ( sts[0]->core_brate > SID_2k40 && sts[0]->bfi == 0 && sts[0]->prev_bfi == 1 ) + { +#else if ( sts[0]->bfi == 0 && sts[0]->prev_bfi == 1 ) { /* On first good frame after frameloss undo the whitening of the bg noise shape */ +#endif for ( n = 0; n < n_channels; ++n ) { if ( sts[n]->last_core_bfi != ACELP_CORE ) -- GitLab