From 5ce0a9f1491db3d9f23a34eee395e871f0ed81b4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 25 Jan 2023 12:33:13 +0100 Subject: [PATCH 1/3] - fix SBA switching complexity overhead; under SBA_BR_SWITCHING_COMPLEXITY_FIX --- lib_com/options.h | 1 + lib_enc/ivas_sba_enc.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 1efe925fe0..92367058fa 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -144,6 +144,7 @@ #define SBA_BR_SWITCHING /* Issue 114: Changes for SBA bit rate switching with reconfiguration for bitrates with same number of transport channels*/ #ifdef SBA_BR_SWITCHING #define SBA_BR_SWITCHING_RECONFIG /* Issue 114: Changes for SBA bitrate switching with reconfiguration for bitrates with different number of transport channels*/ +#define SBA_BR_SWITCHING_COMPLEXITY_FIX /* VA: fix complexity overhead */ #endif #define FIX_I59_DELAY_ROUNDING /* Issue 59: rounding in sample domain instead of nanosec for IVAS_ENC_GetDelay() and IVAS_DEC_GetDelay() */ #define FIX_FIX_I59 /* Issue 59: small fix concerning LFE delay rounding */ diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index eda030cebe..d2e3f0b92d 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -329,6 +329,9 @@ ivas_error ivas_sba_enc_reconfigure( int32_t ivas_total_brate; ivas_error error; ENCODER_CONFIG_HANDLE hEncoderConfig; +#ifdef SBA_BR_SWITCHING_COMPLEXITY_FIX + int16_t flag_spar_opened = 0; +#endif error = IVAS_ERR_OK; @@ -361,6 +364,9 @@ ivas_error ivas_sba_enc_reconfigure( return error; } +#ifdef SBA_BR_SWITCHING_COMPLEXITY_FIX + flag_spar_opened = 1; +#endif // VE: TBV - populate 'hSpar->hFrontVad' with 'hCoreCoder[0]' instead of resetting it to init-state? } @@ -399,6 +405,9 @@ ivas_error ivas_sba_enc_reconfigure( hDirAC->hFbMixer = NULL; } +#ifdef SBA_BR_SWITCHING_COMPLEXITY_FIX + if ( flag_spar_opened == 0 ) +#endif { // VE: dirty patch -> reconfiguration of SPAR MD, TD_decorr, FbMixer modules should be used instead !! -- GitLab From 6f642c0de5da2e19b525860eeb5db5d784477ce9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 27 Jan 2023 19:25:35 +0100 Subject: [PATCH 2/3] use complexity fix from MR 405 instead of SBA_BR_SWITCHING_COMPLEXITY_FIX --- lib_enc/ivas_sba_enc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index d2e3f0b92d..46078b3a58 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -329,9 +329,6 @@ ivas_error ivas_sba_enc_reconfigure( int32_t ivas_total_brate; ivas_error error; ENCODER_CONFIG_HANDLE hEncoderConfig; -#ifdef SBA_BR_SWITCHING_COMPLEXITY_FIX - int16_t flag_spar_opened = 0; -#endif error = IVAS_ERR_OK; @@ -364,9 +361,6 @@ ivas_error ivas_sba_enc_reconfigure( return error; } -#ifdef SBA_BR_SWITCHING_COMPLEXITY_FIX - flag_spar_opened = 1; -#endif // VE: TBV - populate 'hSpar->hFrontVad' with 'hCoreCoder[0]' instead of resetting it to init-state? } @@ -405,9 +399,7 @@ ivas_error ivas_sba_enc_reconfigure( hDirAC->hFbMixer = NULL; } -#ifdef SBA_BR_SWITCHING_COMPLEXITY_FIX - if ( flag_spar_opened == 0 ) -#endif + if ( sba_mode_old == SBA_MODE_SPAR ) { // VE: dirty patch -> reconfiguration of SPAR MD, TD_decorr, FbMixer modules should be used instead !! -- GitLab From bd6e96bcf2e66fb9a4cc7185665e93a60d523c02 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 27 Jan 2023 19:26:49 +0100 Subject: [PATCH 3/3] fix WMC instrumentation without using the prepare script --- lib_enc/ivas_sba_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index 46078b3a58..7fd96ae46e 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -340,14 +340,15 @@ ivas_error ivas_sba_enc_reconfigure( #ifdef SBA_BR_SWITCHING DIRAC_ENC_HANDLE hDirAC = st_ivas->hDirAC; SPAR_ENC_HANDLE hSpar; + SBA_MODE sba_mode_old; #endif nchan_transport_old = st_ivas->nchan_transport; nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; #ifdef SBA_BR_SWITCHING_RECONFIG - SBA_MODE sba_mode_old; sba_mode_old = st_ivas->sba_mode; #endif + st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, hEncoderConfig->sba_order ); #ifdef SBA_BR_SWITCHING st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); -- GitLab