From b40190d2387f6a90327038cdc788c486e52c20dd Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Mon, 19 Jun 2023 10:16:32 -0400 Subject: [PATCH 1/4] 565-Fix noise burst during FEC, due to wrong total_brate initialization --- lib_com/options.h | 1 + lib_dec/FEC.c | 10 ++++++++-- lib_dec/ivas_sce_dec.c | 12 +++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 83f3db8a33..d4a8d2f8bb 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,6 +165,7 @@ #define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ +#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 8118e07748..2a49ff3b1f 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 f42f309ac9..0e922066ff 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -189,11 +189,21 @@ 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; + } + else /*In case of bfi */ + { + st->total_brate = st->last_total_brate; + } +#endif /*----------------------------------------------------------------* * Core codec configuration *----------------------------------------------------------------*/ -- GitLab From 92eb45d33341cd2dd46fb68663fec1e5a9b56dec Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Mon, 19 Jun 2023 10:52:56 -0400 Subject: [PATCH 2/4] addition to 565 --- lib_dec/ivas_spar_decoder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index b80cc08684..295c8d996b 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -341,8 +341,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; -- GitLab From 664237334f8b737ec682fc388198272d3c7699c2 Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Mon, 19 Jun 2023 11:37:05 -0400 Subject: [PATCH 3/4] 565- remove redundant part as this precaution is taken in ivas_spar_decoder now --- lib_dec/ivas_sce_dec.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 0e922066ff..09b9665f73 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -199,10 +199,6 @@ ivas_error ivas_sce_dec( { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } - else /*In case of bfi */ - { - st->total_brate = st->last_total_brate; - } #endif /*----------------------------------------------------------------* * Core codec configuration -- GitLab From a71d1f91c8966c27d251f99cdcecc4079970746e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 19 Jun 2023 21:19:36 +0200 Subject: [PATCH 4/4] restore deleted comment --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5c68973617..f17870ba65 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,7 @@ #define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ #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 +#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 ######################### */ -- GitLab