diff --git a/lib_com/options.h b/lib_com/options.h index 8a4dc67706ac1cc2d05a033db6463b7e226ed627..f17870ba650616ab06dc7ddde4edab1deeaa144c 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,7 @@ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ +#define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/FEC.c b/lib_dec/FEC.c index 8118e07748b79eaa83653e8089434b48c34d907d..2a49ff3b1fe9b50f286b1c23bd734bbb39a33bcd 100644 --- a/lib_dec/FEC.c +++ b/lib_dec/FEC.c @@ -331,8 +331,11 @@ void FEC_exc_estim( /*-----------------------------------------------------------------* * Replicate the last spectrum in case the last good frame was coded by GSC *-----------------------------------------------------------------*/ - +#ifndef FIX_565_SBA_BURST_IN_FEC if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB ) +#else + if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) +#endif { /* Replication of the last spectrum, with a slight downscaling of its dynamic */ st->GSC_noisy_speech = st->Last_GSC_noisy_speech_flag; @@ -404,8 +407,11 @@ void FEC_exc_estim( /*-----------------------------------------------------------------* * Total excitation *-----------------------------------------------------------------*/ - +#ifndef FIX_565_SBA_BURST_IN_FEC if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB ) +#else + if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) +#endif { /* For GSC - the excitation is already computed */ mvr2r( exc, exc2, st->L_frame ); diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 7f76bbbb3735f021b118dde384a61310db8be6cc..2e10552296ac32ad407d38cacef225c4a374cfb7 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -189,11 +189,17 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } +#ifndef FIX_565_SBA_BURST_IN_FEC else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } - +#else + else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ + { + st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; + } +#endif /*----------------------------------------------------------------* * Core codec configuration *----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 9d4d67393fb8716a8e3a028879298891ceab2d29..df60adb8c1fb8eecbfbd84915a2ebd5cdd2a4fc3 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -340,8 +340,12 @@ ivas_error ivas_spar_dec( st0->bit_stream = bstr_meta; st0->next_bit_pos = 0; st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); - st0->total_brate = hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ - +#ifdef FIX_565_SBA_BURST_IN_FEC + if ( !st0->bfi ) +#endif + { + st0->total_brate = hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ + } ivas_spar_dec_MD( st_ivas, st0 ); *nb_bits_read = st0->next_bit_pos + nb_bits_read_orig;