From 032d008ac728b96dca6f183d9ee6d319d7665a70 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 21 Jun 2023 13:59:16 +0200 Subject: [PATCH 1/2] Fix UNCLR mis-classifications in noisy speech stereo --- lib_com/options.h | 2 ++ lib_enc/ivas_stereo_classifier.c | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 8ac9057763..1a9fb534ec 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,6 +151,8 @@ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ +#define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ + /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index d4d0b310b6..b2123c202a 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -107,6 +107,10 @@ int16_t select_stereo_mode( /* set binary flag indicating LRTD mode based on unclr/xtalk classifiers' decisions */ hStereoClassif->prev_lrtd_mode = hStereoClassif->lrtd_mode; +#ifdef FIX_UNCLR_ISSUE + hStereoClassif->unclr_decision = ( hStereoClassif->unclr_decision && hCPE->hCoreCoder[0]->flag_noisy_speech_snr == 0 && + hCPE->element_brate > IVAS_16k4 ); +#endif hStereoClassif->lrtd_mode = ( ( hStereoClassif->unclr_decision | hStereoClassif->xtalk_decision ) && is_speech ); stereo_switching_flag = 1; @@ -617,6 +621,18 @@ void unclr_classifier_td( dbgwrite( &dec, sizeof( int16_t ), 1, 1, "res/unclr_dec.x" ); dbgwrite( &hStereoClassif->unclr_wscore, sizeof( float ), 1, 1, "res/unclr_wscore.x" ); dbgwrite( &hStereoClassif->unclr_decision, sizeof( int16_t ), 1, 1, "res/unclr_dec_hyst.x" ); + + + { + float ftmp; + + ftmp = ( hCPE->hCoreCoder[0]->lp_speech - hCPE->hCoreCoder[0]->lp_noise ); + dbgwrite( &ftmp, sizeof( float ), 1, 1, "res/unclr_lp_speech_minus_noise.x" ); + dbgwrite( &hCPE->hCoreCoder[0]->lp_noise, sizeof( float ), 1, 1, "res/unclr_lp_noise.x" ); + } + + dbgwrite( &hStereoClassif->relE_0_1, sizeof( float ), 1, 1, "res/unclr_relE_0_1.x" ); + dbgwrite( &hCPE->hCoreCoder[0]->vad_flag, sizeof( int16_t ), 1, 1, "res/unclr_core_coder_vad_flag.x" ); #endif return; @@ -707,6 +723,17 @@ void unclr_classifier_dft( dbgwrite( &dec, sizeof( int16_t ), 1, 1, "res/unclr_dec.x" ); dbgwrite( &hStereoClassif->unclr_wscore, sizeof( float ), 1, 1, "res/unclr_wscore.x" ); dbgwrite( &hStereoClassif->unclr_decision, sizeof( int16_t ), 1, 1, "res/unclr_dec_hyst.x" ); + + { + float ftmp; + + ftmp = ( hCPE->hCoreCoder[0]->lp_speech - hCPE->hCoreCoder[0]->lp_noise ); + dbgwrite( &ftmp, sizeof( float ), 1, 1, "res/unclr_lp_speech_minus_noise.x" ); + dbgwrite( &hCPE->hCoreCoder[0]->lp_noise, sizeof( float ), 1, 1, "res/unclr_lp_noise.x" ); + } + + dbgwrite( &hStereoClassif->relE_0_1, sizeof( float ), 1, 1, "res/unclr_relE_0_1.x" ); + dbgwrite( &hCPE->hCoreCoder[0]->vad_flag, sizeof( int16_t ), 1, 1, "res/unclr_core_coder_vad_flag.x" ); #endif return; -- GitLab From 412af0f45c3e6f017e908915043d080647193946 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 21 Jun 2023 14:31:21 +0200 Subject: [PATCH 2/2] remove debugging code --- lib_enc/ivas_stereo_classifier.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index b2123c202a..eb0c054cd3 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -621,18 +621,6 @@ void unclr_classifier_td( dbgwrite( &dec, sizeof( int16_t ), 1, 1, "res/unclr_dec.x" ); dbgwrite( &hStereoClassif->unclr_wscore, sizeof( float ), 1, 1, "res/unclr_wscore.x" ); dbgwrite( &hStereoClassif->unclr_decision, sizeof( int16_t ), 1, 1, "res/unclr_dec_hyst.x" ); - - - { - float ftmp; - - ftmp = ( hCPE->hCoreCoder[0]->lp_speech - hCPE->hCoreCoder[0]->lp_noise ); - dbgwrite( &ftmp, sizeof( float ), 1, 1, "res/unclr_lp_speech_minus_noise.x" ); - dbgwrite( &hCPE->hCoreCoder[0]->lp_noise, sizeof( float ), 1, 1, "res/unclr_lp_noise.x" ); - } - - dbgwrite( &hStereoClassif->relE_0_1, sizeof( float ), 1, 1, "res/unclr_relE_0_1.x" ); - dbgwrite( &hCPE->hCoreCoder[0]->vad_flag, sizeof( int16_t ), 1, 1, "res/unclr_core_coder_vad_flag.x" ); #endif return; @@ -723,17 +711,6 @@ void unclr_classifier_dft( dbgwrite( &dec, sizeof( int16_t ), 1, 1, "res/unclr_dec.x" ); dbgwrite( &hStereoClassif->unclr_wscore, sizeof( float ), 1, 1, "res/unclr_wscore.x" ); dbgwrite( &hStereoClassif->unclr_decision, sizeof( int16_t ), 1, 1, "res/unclr_dec_hyst.x" ); - - { - float ftmp; - - ftmp = ( hCPE->hCoreCoder[0]->lp_speech - hCPE->hCoreCoder[0]->lp_noise ); - dbgwrite( &ftmp, sizeof( float ), 1, 1, "res/unclr_lp_speech_minus_noise.x" ); - dbgwrite( &hCPE->hCoreCoder[0]->lp_noise, sizeof( float ), 1, 1, "res/unclr_lp_noise.x" ); - } - - dbgwrite( &hStereoClassif->relE_0_1, sizeof( float ), 1, 1, "res/unclr_relE_0_1.x" ); - dbgwrite( &hCPE->hCoreCoder[0]->vad_flag, sizeof( int16_t ), 1, 1, "res/unclr_core_coder_vad_flag.x" ); #endif return; -- GitLab