From 403ab03d89955221a81fa1162c5e702ccbf8a782 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 11:07:43 +0100 Subject: [PATCH 01/21] make scaling in ivas_sba_dirac_stereo_dec conditional on the ISM mode --- lib_com/options.h | 1 + lib_dec/ivas_sba_dirac_stereo_dec.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1cfb4c9f24..65589bc909 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,7 @@ /* any switch which is non-be wrt. TS 26.258 V3.0 */ #define FIX_2432_ISM_SPIKES_16KHZ /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */ +#define FIX_1518 /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index e2fed3b0ca..5870e87e9a 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -910,10 +910,15 @@ void ivas_sba_dirac_stereo_dec( synchro_synthesis( st_ivas->hDecoderConfig->ivas_total_brate, hCPE, output, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/ ); /* output scaling */ - if ( !sba_mono_flag ) +#ifdef FIX_1518 + if (st_ivas->ism_mode == ISM_SBA_MODE_DISC) +#endif { - v_multc( output[0], 0.5f, output[0], output_frame ); - v_multc( output[1], 0.5f, output[1], output_frame ); + if ( !sba_mono_flag ) + { + v_multc( output[0], 0.5f, output[0], output_frame ); + v_multc( output[1], 0.5f, output[1], output_frame ); + } } /* delay HB synth */ -- GitLab From 4a134207b596425efb33cccb272c230a402d26d9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 11:23:10 +0100 Subject: [PATCH 02/21] fix formatting --- lib_dec/ivas_sba_dirac_stereo_dec.c | 2 +- scripts/check-format.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index 5870e87e9a..88ad912519 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -911,7 +911,7 @@ void ivas_sba_dirac_stereo_dec( /* output scaling */ #ifdef FIX_1518 - if (st_ivas->ism_mode == ISM_SBA_MODE_DISC) + if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) #endif { if ( !sba_mono_flag ) diff --git a/scripts/check-format.sh b/scripts/check-format.sh index 4da3764bc0..3b92184d28 100755 --- a/scripts/check-format.sh +++ b/scripts/check-format.sh @@ -38,7 +38,7 @@ if [ ! -d "lib_com" ]; then exit 255 fi -CLANG_FORMAT=clang-format +CLANG_FORMAT=./clang-format.exe CLANG_FORMAT_REQUIRED_VERSION="13.0" # list (with space between entries) of substrings that are excluded from the file list, e.g. very large files -- GitLab From bdaf535daef5e0ea178f170e5fb1ae145fa3faa4 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 11:27:57 +0100 Subject: [PATCH 03/21] fix bug in the format-checking script --- scripts/check-format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-format.sh b/scripts/check-format.sh index 3b92184d28..4da3764bc0 100755 --- a/scripts/check-format.sh +++ b/scripts/check-format.sh @@ -38,7 +38,7 @@ if [ ! -d "lib_com" ]; then exit 255 fi -CLANG_FORMAT=./clang-format.exe +CLANG_FORMAT=clang-format CLANG_FORMAT_REQUIRED_VERSION="13.0" # list (with space between entries) of substrings that are excluded from the file list, e.g. very large files -- GitLab From 14b72e1420b3e7bb68e8d87f5bb9dea4ec1d4f40 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 12:00:27 +0100 Subject: [PATCH 04/21] fix SBA non-BE-ness --- lib_dec/ivas_sba_dirac_stereo_dec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index 88ad912519..d441143de7 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -911,15 +911,17 @@ void ivas_sba_dirac_stereo_dec( /* output scaling */ #ifdef FIX_1518 - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif + if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE )) { +#endif if ( !sba_mono_flag ) { v_multc( output[0], 0.5f, output[0], output_frame ); v_multc( output[1], 0.5f, output[1], output_frame ); } +#ifdef FIX_1518 } +#endif /* delay HB synth */ if ( st_ivas->nchan_transport == 1 ) -- GitLab From 5bd49c4ad17bdf0aa1cc2ce947d2856f81f7eea9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 12:26:53 +0100 Subject: [PATCH 05/21] fix formatting --- lib_dec/ivas_sba_dirac_stereo_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index d441143de7..2ffb9cde6b 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -911,7 +911,7 @@ void ivas_sba_dirac_stereo_dec( /* output scaling */ #ifdef FIX_1518 - if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE )) + if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) { #endif if ( !sba_mono_flag ) -- GitLab From a1131a3e8109a10d482fd4c32ab50b4e7f74b890 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 23 Feb 2026 13:13:48 +0100 Subject: [PATCH 06/21] add missing scaling factor for mono output --- lib_dec/ivas_dec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index bebc8a6a42..04d5cd716f 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -379,6 +379,10 @@ ivas_error ivas_dec( { int16_t nchan_ism, sba_ch_idx; +#ifdef FIX_1518 + int16_t sba_mono_flag = ( st_ivas->hDecoderConfig->nchan_out == 1 ) ? 1 : 0; +#endif + set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); nchan_ism = st_ivas->nchan_ism; if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -443,6 +447,12 @@ ivas_error ivas_dec( ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame ); } +#ifdef FIX_1518 + else if ( sba_mono_flag && st_ivas->ism_mode == ISM_MODE_NONE ) + { + v_multc( p_output[0], 2.0f, p_output[0], output_frame ); + } +#endif /* HP filtering */ for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) -- GitLab From 95a1970c6df1e0052c24e54e6f5a71a1d7494106 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 12:47:58 +0100 Subject: [PATCH 07/21] bypass mono dmx in mdct stereo in CPE for pre-rendered OSBA --- lib_dec/ivas_cpe_dec.c | 6 +++++- lib_dec/ivas_dec.c | 15 +++++++++++++++ lib_enc/ivas_enc.c | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index fc1c85aaa4..22b666a9d3 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -498,7 +498,11 @@ ivas_error ivas_cpe_dec( synchro_synthesis( ivas_total_brate, hCPE, output, output_frame, 0 ); } - if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) ) + if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) +#ifdef FIX_1518 + && !(st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE) +#endif + ) { applyDmxMdctStereo( hCPE, output, output_frame ); } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 04d5cd716f..3ed98180b8 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -434,6 +434,21 @@ ivas_error ivas_dec( } } + { + static FILE* f_foa = 0; + if (f_foa == 0) + f_foa = fopen("chans.raw","wb"); + + for (int16_t j=0; j < 960;j++) + { + for ( int n = 0; n < 1; n++) + { + int16_t s1 = p_output[n][j]; + fwrite(&s1,sizeof(int16_t),1,f_foa); + } + } + } + if ( st_ivas->sba_dirac_stereo_flag ) { ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &p_output[sba_ch_idx], &p_output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 71442ade5f..a94924026a 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -418,6 +418,21 @@ ivas_error ivas_enc( } #endif + { + static FILE* f_foa = 0; + if (f_foa == 0) + f_foa = fopen("chans_in.raw","wb"); + + for (int16_t j=0; j < 960;j++) + { + for ( int n = 0; n < 1; n++) + { + int16_t s1 = data_f[n][j]; + fwrite(&s1,sizeof(int16_t),1,f_foa); + } + } + } + /* core-coding of transport channels */ if ( st_ivas->nSCE == 1 ) { -- GitLab From c08eaa998b550b57b2b9038d537e2773d0516095 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 14:23:51 +0100 Subject: [PATCH 08/21] rewrite condition in ivas_cpe_dec --- lib_dec/ivas_cpe_dec.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 22b666a9d3..293d5c7ec3 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -498,13 +498,16 @@ ivas_error ivas_cpe_dec( synchro_synthesis( ivas_total_brate, hCPE, output, output_frame, 0 ); } - if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) + if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) ) + { #ifdef FIX_1518 - && !(st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE) + if ( !(st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE) ) + { +#endif + applyDmxMdctStereo( hCPE, output, output_frame ); +#ifdef FIX_1518 + } #endif - ) - { - applyDmxMdctStereo( hCPE, output, output_frame ); } #ifndef DEBUG_STEREO_DFT_OUTRESPRED -- GitLab From cdae2a1f5bb2f678d39d71022af55706711ca2eb Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 14:25:30 +0100 Subject: [PATCH 09/21] disable debug code --- lib_dec/ivas_dec.c | 2 ++ lib_enc/ivas_enc.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 3ed98180b8..8c9743928e 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -434,6 +434,7 @@ ivas_error ivas_dec( } } + /* { static FILE* f_foa = 0; if (f_foa == 0) @@ -448,6 +449,7 @@ ivas_error ivas_dec( } } } + */ if ( st_ivas->sba_dirac_stereo_flag ) { diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index a94924026a..85712b73b6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -418,6 +418,7 @@ ivas_error ivas_enc( } #endif + /* { static FILE* f_foa = 0; if (f_foa == 0) @@ -432,6 +433,7 @@ ivas_error ivas_enc( } } } + */ /* core-coding of transport channels */ if ( st_ivas->nSCE == 1 ) -- GitLab From 55aef6b46faa563f8f56d1dee1d040bb2621d5c7 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 14:40:04 +0100 Subject: [PATCH 10/21] fix formatting --- lib_dec/ivas_cpe_dec.c | 2 +- lib_dec/ivas_dec.c | 20 ++++++++++---------- lib_enc/ivas_enc.c | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 293d5c7ec3..9aa5d849a1 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -501,7 +501,7 @@ ivas_error ivas_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) ) { #ifdef FIX_1518 - if ( !(st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE) ) + if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) { #endif applyDmxMdctStereo( hCPE, output, output_frame ); diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 8c9743928e..67521a80dc 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -436,17 +436,17 @@ ivas_error ivas_dec( /* { - static FILE* f_foa = 0; - if (f_foa == 0) - f_foa = fopen("chans.raw","wb"); - - for (int16_t j=0; j < 960;j++) - { - for ( int n = 0; n < 1; n++) - { + static FILE* f_foa = 0; + if (f_foa == 0) + f_foa = fopen("chans.raw","wb"); + + for (int16_t j=0; j < 960;j++) + { + for ( int n = 0; n < 1; n++) + { int16_t s1 = p_output[n][j]; - fwrite(&s1,sizeof(int16_t),1,f_foa); - } + fwrite(&s1,sizeof(int16_t),1,f_foa); + } } } */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 85712b73b6..a8e6746e78 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -420,17 +420,17 @@ ivas_error ivas_enc( /* { - static FILE* f_foa = 0; - if (f_foa == 0) - f_foa = fopen("chans_in.raw","wb"); - - for (int16_t j=0; j < 960;j++) - { - for ( int n = 0; n < 1; n++) - { + static FILE* f_foa = 0; + if (f_foa == 0) + f_foa = fopen("chans_in.raw","wb"); + + for (int16_t j=0; j < 960;j++) + { + for ( int n = 0; n < 1; n++) + { int16_t s1 = data_f[n][j]; - fwrite(&s1,sizeof(int16_t),1,f_foa); - } + fwrite(&s1,sizeof(int16_t),1,f_foa); + } } } */ -- GitLab From 7d67d94b599a2def54306c0658b2d30cb16c7fd9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 15:33:04 +0100 Subject: [PATCH 11/21] delete debug code --- lib_dec/ivas_dec.c | 17 ----------------- lib_enc/ivas_enc.c | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 67521a80dc..04d5cd716f 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -434,23 +434,6 @@ ivas_error ivas_dec( } } - /* - { - static FILE* f_foa = 0; - if (f_foa == 0) - f_foa = fopen("chans.raw","wb"); - - for (int16_t j=0; j < 960;j++) - { - for ( int n = 0; n < 1; n++) - { - int16_t s1 = p_output[n][j]; - fwrite(&s1,sizeof(int16_t),1,f_foa); - } - } - } - */ - if ( st_ivas->sba_dirac_stereo_flag ) { ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &p_output[sba_ch_idx], &p_output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index a8e6746e78..71442ade5f 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -418,23 +418,6 @@ ivas_error ivas_enc( } #endif - /* - { - static FILE* f_foa = 0; - if (f_foa == 0) - f_foa = fopen("chans_in.raw","wb"); - - for (int16_t j=0; j < 960;j++) - { - for ( int n = 0; n < 1; n++) - { - int16_t s1 = data_f[n][j]; - fwrite(&s1,sizeof(int16_t),1,f_foa); - } - } - } - */ - /* core-coding of transport channels */ if ( st_ivas->nSCE == 1 ) { -- GitLab From 91cb634e21413af6cc69da77f4e70f9b5884f718 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 15:36:15 +0100 Subject: [PATCH 12/21] rename FIX_1518 to FIX_FLOAT_1518 --- lib_com/options.h | 2 +- lib_dec/ivas_cpe_dec.c | 4 ++-- lib_dec/ivas_dec.c | 4 ++-- lib_dec/ivas_sba_dirac_stereo_dec.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 50f8e9e6a9..c0cd3fbb39 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,7 @@ #define FIX_FLOAT_1493_MASA_ENCODE_STABILITY_IMPROVE /* Nokia: float issue 1493: Improves float decision stability in MASA encoding by adjusting reduction code */ #define FIX_2432_ISM_SPIKES_16KHZ /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */ -#define FIX_1518 +#define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 9aa5d849a1..231b1ed866 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -500,12 +500,12 @@ ivas_error ivas_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) ) { -#ifdef FIX_1518 +#ifdef FIX_FLOAT_1518 if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) { #endif applyDmxMdctStereo( hCPE, output, output_frame ); -#ifdef FIX_1518 +#ifdef FIX_FLOAT_1518 } #endif } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 04d5cd716f..c93f3febe8 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -379,7 +379,7 @@ ivas_error ivas_dec( { int16_t nchan_ism, sba_ch_idx; -#ifdef FIX_1518 +#ifdef FIX_FLOAT_1518 int16_t sba_mono_flag = ( st_ivas->hDecoderConfig->nchan_out == 1 ) ? 1 : 0; #endif @@ -447,7 +447,7 @@ ivas_error ivas_dec( ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame ); } -#ifdef FIX_1518 +#ifdef FIX_FLOAT_1518 else if ( sba_mono_flag && st_ivas->ism_mode == ISM_MODE_NONE ) { v_multc( p_output[0], 2.0f, p_output[0], output_frame ); diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index 2ffb9cde6b..d3df4db532 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -910,7 +910,7 @@ void ivas_sba_dirac_stereo_dec( synchro_synthesis( st_ivas->hDecoderConfig->ivas_total_brate, hCPE, output, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/ ); /* output scaling */ -#ifdef FIX_1518 +#ifdef FIX_FLOAT_1518 if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) { #endif @@ -919,7 +919,7 @@ void ivas_sba_dirac_stereo_dec( v_multc( output[0], 0.5f, output[0], output_frame ); v_multc( output[1], 0.5f, output[1], output_frame ); } -#ifdef FIX_1518 +#ifdef FIX_FLOAT_1518 } #endif -- GitLab From 9d3410776d23aef7d06ca7b72701f57dd774b0ee Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 24 Feb 2026 15:40:37 +0100 Subject: [PATCH 13/21] simplify condition in ivas_sba_dirac_stereo_dec --- lib_dec/ivas_sba_dirac_stereo_dec.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index d3df4db532..ea3355769d 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -911,17 +911,14 @@ void ivas_sba_dirac_stereo_dec( /* output scaling */ #ifdef FIX_FLOAT_1518 - if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) - { + if ( !sba_mono_flag && !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) +#else + if ( !sba_mono_flag ) #endif - if ( !sba_mono_flag ) - { - v_multc( output[0], 0.5f, output[0], output_frame ); - v_multc( output[1], 0.5f, output[1], output_frame ); - } -#ifdef FIX_FLOAT_1518 + { + v_multc( output[0], 0.5f, output[0], output_frame ); + v_multc( output[1], 0.5f, output[1], output_frame ); } -#endif /* delay HB synth */ if ( st_ivas->nchan_transport == 1 ) -- GitLab From 82b1e686c110e2dbaa9645f717715e844016ba42 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 09:37:55 +0100 Subject: [PATCH 14/21] do not run apply_dmx_weights for OSBA format --- lib_dec/ivas_stereo_mdct_core_dec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index 2bd77a831c..cac9d20c2e 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -351,7 +351,14 @@ void stereo_mdct_core_dec( if ( hCPE->nchan_out == 1 && ( !bfi || ( bfi && sts[0]->core != ACELP_CORE && sts[1]->core != ACELP_CORE ) ) ) { - apply_dmx_weights( hCPE, x, sts[0]->transform_type, sts[1]->transform_type ); +#ifdef FIX_FLOAT_1518 + if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) + { +#endif + apply_dmx_weights( hCPE, x, sts[0]->transform_type, sts[1]->transform_type ); +#ifdef FIX_FLOAT_1518 + } +#endif } ivas_mdct_core_reconstruct( hCPE, x, signal_outFB_tmp, fUseTns, 0 ); -- GitLab From 07d60fb114db0d447a80b48a48457a504b79b93c Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 10:49:11 +0100 Subject: [PATCH 15/21] temporarily disable lib_com/options.h --- 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 c0cd3fbb39..41f90f2713 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,7 @@ #define FIX_FLOAT_1493_MASA_ENCODE_STABILITY_IMPROVE /* Nokia: float issue 1493: Improves float decision stability in MASA encoding by adjusting reduction code */ #define FIX_2432_ISM_SPIKES_16KHZ /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */ -#define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ +//#define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ /* ##################### End NON-BE switches ########################### */ -- GitLab From 991b3b6e73095fd97302b717b2f3d59d1a4f873d Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 13:38:48 +0100 Subject: [PATCH 16/21] enable FIX_FLOAT_1518 again --- lib_com/options.h | 2 +- lib_dec/ivas_dec.c | 16 ++++++++++++++++ lib_enc/ivas_enc.c | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 41f90f2713..c0cd3fbb39 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,7 @@ #define FIX_FLOAT_1493_MASA_ENCODE_STABILITY_IMPROVE /* Nokia: float issue 1493: Improves float decision stability in MASA encoding by adjusting reduction code */ #define FIX_2432_ISM_SPIKES_16KHZ /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */ -//#define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ +#define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index c93f3febe8..a7df7cfb78 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -434,6 +434,22 @@ ivas_error ivas_dec( } } + { + static FILE* f_foa = 0; + if (f_foa == 0) + f_foa = fopen("chans.raw","wb"); + + for (int16_t j=0; j < 960;j++) + { + for ( int n = 0; n < 2; n++) + { + int16_t s1 = p_output[n][j]; + fwrite(&s1,sizeof(int16_t),1,f_foa); + } + } + } + + if ( st_ivas->sba_dirac_stereo_flag ) { ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &p_output[sba_ch_idx], &p_output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 71442ade5f..4617c0483c 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -418,6 +418,21 @@ ivas_error ivas_enc( } #endif + { + static FILE* f_foa = 0; + if (f_foa == 0) + f_foa = fopen("chans_in.raw","wb"); + + for (int16_t j=0; j < 960;j++) + { + for ( int n = 0; n < 1; n++) + { + int16_t s1 = data_f[n][j]; + fwrite(&s1,sizeof(int16_t),1,f_foa); + } + } + } + /* core-coding of transport channels */ if ( st_ivas->nSCE == 1 ) { -- GitLab From 0740f6046c42a5a876391da9af9f6f1510d0e5cc Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 13:51:39 +0100 Subject: [PATCH 17/21] fix formatting --- lib_dec/ivas_dec.c | 24 ++++++++++++------------ lib_enc/ivas_enc.c | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index a7df7cfb78..bb1f33185a 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -435,18 +435,18 @@ ivas_error ivas_dec( } { - static FILE* f_foa = 0; - if (f_foa == 0) - f_foa = fopen("chans.raw","wb"); - - for (int16_t j=0; j < 960;j++) - { - for ( int n = 0; n < 2; n++) - { - int16_t s1 = p_output[n][j]; - fwrite(&s1,sizeof(int16_t),1,f_foa); - } - } + static FILE *f_foa = 0; + if ( f_foa == 0 ) + f_foa = fopen( "chans.raw", "wb" ); + + for ( int16_t j = 0; j < 960; j++ ) + { + for ( int n = 0; n < 2; n++ ) + { + int16_t s1 = p_output[n][j]; + fwrite( &s1, sizeof( int16_t ), 1, f_foa ); + } + } } diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 4617c0483c..d0838bf0e5 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -419,18 +419,18 @@ ivas_error ivas_enc( #endif { - static FILE* f_foa = 0; - if (f_foa == 0) - f_foa = fopen("chans_in.raw","wb"); - - for (int16_t j=0; j < 960;j++) - { - for ( int n = 0; n < 1; n++) - { - int16_t s1 = data_f[n][j]; - fwrite(&s1,sizeof(int16_t),1,f_foa); - } - } + static FILE *f_foa = 0; + if ( f_foa == 0 ) + f_foa = fopen( "chans_in.raw", "wb" ); + + for ( int16_t j = 0; j < 960; j++ ) + { + for ( int n = 0; n < 1; n++ ) + { + int16_t s1 = data_f[n][j]; + fwrite( &s1, sizeof( int16_t ), 1, f_foa ); + } + } } /* core-coding of transport channels */ -- GitLab From 743f86ca85e5cd86e8f53cc81fc7a599500b011c Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 13:57:26 +0100 Subject: [PATCH 18/21] delete debug code --- lib_dec/ivas_dec.c | 16 ---------------- lib_enc/ivas_enc.c | 15 --------------- scripts/check-format.sh | 2 +- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index bb1f33185a..c93f3febe8 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -434,22 +434,6 @@ ivas_error ivas_dec( } } - { - static FILE *f_foa = 0; - if ( f_foa == 0 ) - f_foa = fopen( "chans.raw", "wb" ); - - for ( int16_t j = 0; j < 960; j++ ) - { - for ( int n = 0; n < 2; n++ ) - { - int16_t s1 = p_output[n][j]; - fwrite( &s1, sizeof( int16_t ), 1, f_foa ); - } - } - } - - if ( st_ivas->sba_dirac_stereo_flag ) { ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &p_output[sba_ch_idx], &p_output[sba_ch_idx], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index d0838bf0e5..71442ade5f 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -418,21 +418,6 @@ ivas_error ivas_enc( } #endif - { - static FILE *f_foa = 0; - if ( f_foa == 0 ) - f_foa = fopen( "chans_in.raw", "wb" ); - - for ( int16_t j = 0; j < 960; j++ ) - { - for ( int n = 0; n < 1; n++ ) - { - int16_t s1 = data_f[n][j]; - fwrite( &s1, sizeof( int16_t ), 1, f_foa ); - } - } - } - /* core-coding of transport channels */ if ( st_ivas->nSCE == 1 ) { diff --git a/scripts/check-format.sh b/scripts/check-format.sh index 4da3764bc0..3b92184d28 100755 --- a/scripts/check-format.sh +++ b/scripts/check-format.sh @@ -38,7 +38,7 @@ if [ ! -d "lib_com" ]; then exit 255 fi -CLANG_FORMAT=clang-format +CLANG_FORMAT=./clang-format.exe CLANG_FORMAT_REQUIRED_VERSION="13.0" # list (with space between entries) of substrings that are excluded from the file list, e.g. very large files -- GitLab From 639195c9918c53bc6cd6163f2b0e4a92857b5ae6 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 13:59:22 +0100 Subject: [PATCH 19/21] fix formatting script --- scripts/check-format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-format.sh b/scripts/check-format.sh index 3b92184d28..4da3764bc0 100755 --- a/scripts/check-format.sh +++ b/scripts/check-format.sh @@ -38,7 +38,7 @@ if [ ! -d "lib_com" ]; then exit 255 fi -CLANG_FORMAT=./clang-format.exe +CLANG_FORMAT=clang-format CLANG_FORMAT_REQUIRED_VERSION="13.0" # list (with space between entries) of substrings that are excluded from the file list, e.g. very large files -- GitLab From 182fb6d2a8ef789c3f2001b325f2c9c7be811ae7 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 25 Feb 2026 15:21:41 +0100 Subject: [PATCH 20/21] rewrite condition for apply_dmx_weights_fx --- lib_dec/ivas_stereo_mdct_core_dec.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index cac9d20c2e..4ba86bc7bd 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -349,16 +349,13 @@ void stereo_mdct_core_dec( run_min_stats( sts, x ); - if ( hCPE->nchan_out == 1 && ( !bfi || ( bfi && sts[0]->core != ACELP_CORE && sts[1]->core != ACELP_CORE ) ) ) - { -#ifdef FIX_FLOAT_1518 - if ( !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) - { -#endif - apply_dmx_weights( hCPE, x, sts[0]->transform_type, sts[1]->transform_type ); #ifdef FIX_FLOAT_1518 - } + if ( hCPE->nchan_out == 1 && ( !bfi || ( bfi && sts[0]->core != ACELP_CORE && sts[1]->core != ACELP_CORE ) ) && !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ) +#else + if ( hCPE->nchan_out == 1 && ( !bfi || ( bfi && sts[0]->core != ACELP_CORE && sts[1]->core != ACELP_CORE ) ) ) #endif + { + apply_dmx_weights( hCPE, x, sts[0]->transform_type, sts[1]->transform_type ); } ivas_mdct_core_reconstruct( hCPE, x, signal_outFB_tmp, fUseTns, 0 ); -- GitLab From 0854efa81a248560ec244c0d22cf1fd16453a6b1 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 26 Feb 2026 12:29:00 +0100 Subject: [PATCH 21/21] simplify logic in ivas_dec --- lib_dec/ivas_dec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index c93f3febe8..f47dfb6118 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -379,10 +379,6 @@ ivas_error ivas_dec( { int16_t nchan_ism, sba_ch_idx; -#ifdef FIX_FLOAT_1518 - int16_t sba_mono_flag = ( st_ivas->hDecoderConfig->nchan_out == 1 ) ? 1 : 0; -#endif - set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); nchan_ism = st_ivas->nchan_ism; if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -448,7 +444,7 @@ ivas_error ivas_dec( ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame ); } #ifdef FIX_FLOAT_1518 - else if ( sba_mono_flag && st_ivas->ism_mode == ISM_MODE_NONE ) + else if ( st_ivas->hDecoderConfig->nchan_out == 1 && st_ivas->ism_mode == ISM_MODE_NONE ) { v_multc( p_output[0], 2.0f, p_output[0], output_frame ); } -- GitLab