From dcbb024d306689b005d185c907a905e3565d5c09 Mon Sep 17 00:00:00 2001 From: Shanush Prema Thasarathan Date: Mon, 31 Oct 2022 21:38:04 +1100 Subject: [PATCH 1/2] Ensure freedom of core-coder VAD decision only occurs at the correct bitrates --- lib_com/ivas_cnst.h | 1 + lib_enc/ivas_front_vad.c | 2 +- lib_enc/ivas_spar_encoder.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index abf0e1f663..42173361c1 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -836,6 +836,7 @@ typedef enum { #define SBA_MIN_BRATE_HOA IVAS_256k #define SBA_NHARM_HOA3 16 #define SBA_T_DESIGN_11_SIZE 70 +#define SBA_DTX_BITRATE_THRESHOLD IVAS_80k typedef enum { diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 1d18af7761..e9818cb7ae 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -396,7 +396,7 @@ ivas_error front_vad_spar( hFrontVad = hSpar->hFrontVad; st = hSpar->hCoreCoderVAD; - if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_total_brate <= IVAS_80k ) + if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_total_brate <= SBA_DTX_BITRATE_THRESHOLD ) { /*------------------------------------------------------------------* * Initialization diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 7e2d49310f..3049e28b9b 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -310,8 +310,8 @@ ivas_error ivas_spar_enc( *nb_bits_metadata = hMetaData->nb_bits_tot; - /* temp hack to not force IVAS front pre-proc decision for higher bitrates */ - if ( hEncoderConfig->ivas_total_brate > IVAS_64k || hEncoderConfig->Opt_DTX_ON == 0 ) + /* Force IVAS front pre-proc decision for higher bitrates */ + if ( hEncoderConfig->ivas_total_brate > SBA_DTX_BITRATE_THRESHOLD || hEncoderConfig->Opt_DTX_ON == 0 ) { st_ivas->hSpar->front_vad_flag = 0; } -- GitLab From 64c4f7b10f92f261bd3ad9643704277b42fe75cd Mon Sep 17 00:00:00 2001 From: Shanush Prema Thasarathan Date: Tue, 1 Nov 2022 09:17:17 +1100 Subject: [PATCH 2/2] Encapsulate fix in a compilation flag --- lib_com/ivas_cnst.h | 2 ++ lib_com/options.h | 1 + lib_enc/ivas_front_vad.c | 4 ++++ lib_enc/ivas_spar_encoder.c | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 42173361c1..dbaf718348 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -836,7 +836,9 @@ typedef enum { #define SBA_MIN_BRATE_HOA IVAS_256k #define SBA_NHARM_HOA3 16 #define SBA_T_DESIGN_11_SIZE 70 +#ifdef FIX_SBA_DTX_DECODE_ERROR #define SBA_DTX_BITRATE_THRESHOLD IVAS_80k +#endif typedef enum { diff --git a/lib_com/options.h b/lib_com/options.h index 612e6b1b49..2cda5877c3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,7 @@ #define AGC_ENABLE_FOR_LBR /* Issue 168: Enable AGC for low bit rate (1 TC) */ #endif #define FIX_TCX_DEC_RECONF_BFI +#define FIX_SBA_DTX_DECODE_ERROR /* Issue 176: SBA decoder error with DTX at 80kbps SWB, Issue 21: SBA front-VAD threshold (203) */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index e9818cb7ae..62eeee5a02 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -396,7 +396,11 @@ ivas_error front_vad_spar( hFrontVad = hSpar->hFrontVad; st = hSpar->hCoreCoderVAD; +#ifdef FIX_SBA_DTX_DECODE_ERROR if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_total_brate <= SBA_DTX_BITRATE_THRESHOLD ) +#else + if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_total_brate <= IVAS_80k ) +#endif { /*------------------------------------------------------------------* * Initialization diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 3049e28b9b..16b66aef54 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -310,8 +310,13 @@ ivas_error ivas_spar_enc( *nb_bits_metadata = hMetaData->nb_bits_tot; +#ifdef FIX_SBA_DTX_DECODE_ERROR /* Force IVAS front pre-proc decision for higher bitrates */ if ( hEncoderConfig->ivas_total_brate > SBA_DTX_BITRATE_THRESHOLD || hEncoderConfig->Opt_DTX_ON == 0 ) +#else + /* temp hack to not force IVAS front pre-proc decision for higher bitrates */ + if ( hEncoderConfig->ivas_total_brate > IVAS_64k || hEncoderConfig->Opt_DTX_ON == 0 ) +#endif { st_ivas->hSpar->front_vad_flag = 0; } -- GitLab