From 1c8e9f59ae0c8ec6d849f0b9f22437ea49ae9628 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Wed, 11 Dec 2024 14:24:25 +0100 Subject: [PATCH 1/2] fixes for the debug force mdct stereo mode functionality --- lib_enc/ivas_cpe_enc.c | 14 ++++++++++++++ lib_enc/ivas_stereo_mdct_core_enc.c | 10 ---------- lib_enc/ivas_stereo_mdct_stereo_enc.c | 15 --------------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index e5f7d481c..0ca2f93c5 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -1391,6 +1391,20 @@ ivas_error create_cpe_enc_fx( #ifdef DEBUGGING hCPE->hStereoMdct->mdct_stereo_mode_cmdl = st_ivas->hEncoderConfig->mdct_stereo_mode_cmdl; +#ifdef DEBUG_FORCE_MDCT_STEREO_MODE + /*set all other members to defined states */ + hCPE->hStereoMdct->fDualMono = 0; + hCPE->hStereoMdct->fMSstereo = 0; + + if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_LR ) + { + hCPE->hStereoMdct->fDualMono = 1; + } + else if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_MS ) + { + hCPE->hStereoMdct->fMSstereo = 1; + } +#endif #endif initMdctStereoEncData_fx( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, max_bwidth, 0, NULL, 1 ); diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 1b4c9d49f..123b26159 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -233,17 +233,7 @@ void stereo_mdct_core_enc_fx( } IF( hCPE->hCoreCoder[0]->igf ) { - -#ifdef DEBUGGING - int16_t orig_mdct_stereo_mode_cmdl = hCPE->hStereoMdct->mdct_stereo_mode_cmdl; - hCPE->hStereoMdct->mdct_stereo_mode_cmdl = SMDCT_MS_DECISION; -#endif initMdctStereoEncData_fx( hCPE->hStereoMdct, STEREO_FORMAT, IVAS_CPE_MDCT, hCPE->element_brate, hCPE->hCoreCoder[0]->bwidth, hCPE->hCoreCoder[0]->igf, hCPE->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid, 0 ); - -#ifdef DEBUGGING - hCPE->hStereoMdct->mdct_stereo_mode_cmdl = orig_mdct_stereo_mode_cmdl; -#endif - stereo_mdct_init_igf_start_band_fx( &( hCPE->hStereoMdct->stbParamsTCX20 ), 16384 /* 1.0f in Q14 */, hCPE->hCoreCoder[0]->bwidth, hCPE->element_brate ); stereo_mdct_init_igf_start_band_fx( &( hCPE->hStereoMdct->stbParamsTCX10 ), 8192 /* 0.5f in Q14 */, hCPE->hCoreCoder[0]->bwidth, hCPE->element_brate ); stereo_mdct_init_igf_start_band_fx( &( hCPE->hStereoMdct->stbParamsTCX20afterACELP ), 20480 /* 1.25f in Q14 */, hCPE->hCoreCoder[0]->bwidth, hCPE->element_brate ); diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index 9148b89e2..b69883930 100644 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -1301,21 +1301,6 @@ void initMdctStereoEncData_fx( set16_fx( hStereoMdct->IGFStereoMode, -1, 2 ); -#ifdef DEBUG_FORCE_MDCT_STEREO_MODE - /*set all other members to defined states */ - hStereoMdct->fDualMono = 0; - hStereoMdct->fMSstereo = 0; - - if ( hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_LR ) - { - hStereoMdct->fDualMono = 1; - } - else if ( hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_MS ) - { - hStereoMdct->fMSstereo = 1; - } -#endif - hStereoMdct->split_ratio = SMDCT_EQUAL_RATIO_RANGE; move16(); set16_fx( hStereoMdct->global_ild, SMDCT_ILD_RANGE >> 1, 2 ); -- GitLab From 0767565fcf1e6a2c922976446583f11eadad7432 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Wed, 11 Dec 2024 16:45:33 +0100 Subject: [PATCH 2/2] clang format --- lib_enc/ivas_cpe_enc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index cef062410..1e57c194d 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -1397,18 +1397,18 @@ ivas_error create_cpe_enc_fx( #ifdef DEBUGGING hCPE->hStereoMdct->mdct_stereo_mode_cmdl = st_ivas->hEncoderConfig->mdct_stereo_mode_cmdl; #ifdef DEBUG_FORCE_MDCT_STEREO_MODE - /*set all other members to defined states */ - hCPE->hStereoMdct->fDualMono = 0; - hCPE->hStereoMdct->fMSstereo = 0; + /*set all other members to defined states */ + hCPE->hStereoMdct->fDualMono = 0; + hCPE->hStereoMdct->fMSstereo = 0; - if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_LR ) - { - hCPE->hStereoMdct->fDualMono = 1; - } - else if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_MS ) - { - hCPE->hStereoMdct->fMSstereo = 1; - } + if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_LR ) + { + hCPE->hStereoMdct->fDualMono = 1; + } + else if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_MS ) + { + hCPE->hStereoMdct->fMSstereo = 1; + } #endif #endif -- GitLab