From cfde21ec8c3b5defab5fad8fde32210641109c87 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 12:30:48 +0200 Subject: [PATCH 01/25] port required part of object-editing API under FIX_189_OBJ_EDITING_API --- lib_com/ivas_prot_fx.h | 12 ++++++++++ lib_com/options.h | 2 ++ lib_dec/ivas_jbm_dec_fx.c | 4 ++++ lib_dec/ivas_osba_dec_fx.c | 46 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 83cf758b1..658b47524 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3893,6 +3893,18 @@ ivas_error ivas_osba_render_sf_fx( Word32 *p_output[] /* o : rendered time signal */ ); +#ifdef FIX_189_OBJ_EDITING_API +void ivas_osba_stereo_add_channels_fx( + Word32 *tc_fx[], /* i : transport channels */ + Word32 *output_fx[], /* i/o: output channels */ + const Word16 gain, /* i : gain bed value */ + const Word16 nchan_out, /* i : number of output channels */ + const Word16 nchan_ism, /* i : number of ISM channels */ + const int16_t ism_mode, /* i : ISM mode */ + const UWord16 n_samples_to_render /* i : output frame length per channel */ +); +#endif + void ivas_osba_data_close_fx( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 25d559cae..51ee52236 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,6 +131,8 @@ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ +#define FIX_189_OBJ_EDITING_API + /* #################### End BASOP porting switches ############################ */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 40a7c207d..f312ccf9b 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2230,10 +2230,14 @@ ivas_error ivas_jbm_dec_render_fx( ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_fx, *nSamplesRendered ); /* add already rendered SBA part */ +#ifdef FIX_189_OBJ_EDITING_API + ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); +#else FOR( n = 0; n < nchan_out; n++ ) { v_add_fixed_no_hdrm( p_output_fx[n], p_tc_fx[n + st_ivas->nchan_ism], p_output_fx[n], *nSamplesRendered ); } +#endif } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || EQ_32( st_ivas->renderer_type, RENDERER_OSBA_LS ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index c6c55299a..c483ff49f 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -328,3 +328,49 @@ ivas_error ivas_osba_render_sf_fx( return IVAS_ERR_OK; } + + +#ifdef FIX_189_OBJ_EDITING_API +/*-------------------------------------------------------------------------* + * ivas_osba_stereo_add_channels() + * + * + *-------------------------------------------------------------------------*/ + +void ivas_osba_stereo_add_channels_fx( + Word32 *tc_fx[], /* i : transport channels */ + Word32 *output_fx[], /* i/o: output channels */ + const Word16 gain, /* i : gain bed value */ + const Word16 nchan_out, /* i : number of output channels */ + const Word16 nchan_ism, /* i : number of ISM channels */ + const int16_t ism_mode, /* i : ISM mode */ + const UWord16 n_samples_to_render /* i : output frame length per channel */ +) +{ + int16_t n; + + if ( ism_mode == ISM_SBA_MODE_DISC ) + { + if ( NE_16(gain, 1) ) + { + assert(0 && "Object editing is not implemented in the BASOP code!"); + } + else + { + FOR( n = 0; n < nchan_out; n++ ) + { + v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); + } + } + } + else + { + FOR( n = 0; n < nchan_out; n++ ) + { + v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); + } + } + + return; +} +#endif \ No newline at end of file -- GitLab From 8967e2e162bcef50005e91902685d6672113e164 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 12:58:29 +0200 Subject: [PATCH 02/25] fix formatting --- lib_com/ivas_prot_fx.h | 2 +- lib_com/options.h | 2 +- lib_dec/ivas_jbm_dec_fx.c | 2 +- lib_dec/ivas_osba_dec_fx.c | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 658b47524..8fe524aae 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3893,7 +3893,7 @@ ivas_error ivas_osba_render_sf_fx( Word32 *p_output[] /* o : rendered time signal */ ); -#ifdef FIX_189_OBJ_EDITING_API +#ifdef FIX_1849_OBJ_EDITING_API void ivas_osba_stereo_add_channels_fx( Word32 *tc_fx[], /* i : transport channels */ Word32 *output_fx[], /* i/o: output channels */ diff --git a/lib_com/options.h b/lib_com/options.h index 51ee52236..fc8893f92 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,7 +131,7 @@ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ -#define FIX_189_OBJ_EDITING_API +#define FIX_1849_OBJ_EDITING_API /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index f312ccf9b..a21afef17 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2230,7 +2230,7 @@ ivas_error ivas_jbm_dec_render_fx( ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_fx, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef FIX_189_OBJ_EDITING_API +#ifdef FIX_1849_OBJ_EDITING_API ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); #else FOR( n = 0; n < nchan_out; n++ ) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index c483ff49f..f58dad3a3 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -330,19 +330,19 @@ ivas_error ivas_osba_render_sf_fx( } -#ifdef FIX_189_OBJ_EDITING_API +#ifdef FIX_1849_OBJ_EDITING_API /*-------------------------------------------------------------------------* * ivas_osba_stereo_add_channels() * - * + * *-------------------------------------------------------------------------*/ void ivas_osba_stereo_add_channels_fx( - Word32 *tc_fx[], /* i : transport channels */ - Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value */ - const Word16 nchan_out, /* i : number of output channels */ - const Word16 nchan_ism, /* i : number of ISM channels */ + Word32 *tc_fx[], /* i : transport channels */ + Word32 *output_fx[], /* i/o: output channels */ + const Word16 gain, /* i : gain bed value */ + const Word16 nchan_out, /* i : number of output channels */ + const Word16 nchan_ism, /* i : number of ISM channels */ const int16_t ism_mode, /* i : ISM mode */ const UWord16 n_samples_to_render /* i : output frame length per channel */ ) @@ -351,9 +351,9 @@ void ivas_osba_stereo_add_channels_fx( if ( ism_mode == ISM_SBA_MODE_DISC ) { - if ( NE_16(gain, 1) ) + if ( NE_16( gain, 1 ) ) { - assert(0 && "Object editing is not implemented in the BASOP code!"); + assert( 0 && "Object editing is not implemented in the BASOP code!" ); } else { @@ -373,4 +373,4 @@ void ivas_osba_stereo_add_channels_fx( return; } -#endif \ No newline at end of file +#endif -- GitLab From f81abdb6315493ff47157aa6d4405329c99a743e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 13:35:34 +0200 Subject: [PATCH 03/25] port NONBE_FIX_1262_OSBA_STEREO from float --- lib_com/ivas_prot_fx.h | 2 ++ lib_com/options.h | 1 + lib_dec/ivas_jbm_dec_fx.c | 5 +++++ lib_dec/ivas_osba_dec_fx.c | 19 +++++++++++++++++++ 4 files changed, 27 insertions(+) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 8fe524aae..9cd7e6cae 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3900,7 +3900,9 @@ void ivas_osba_stereo_add_channels_fx( const Word16 gain, /* i : gain bed value */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ +#ifndef NONBE_FIX_1262_OSBA_STEREO const int16_t ism_mode, /* i : ISM mode */ +#endif const UWord16 n_samples_to_render /* i : output frame length per channel */ ); #endif diff --git a/lib_com/options.h b/lib_com/options.h index fc8893f92..a22d3b0f6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -132,6 +132,7 @@ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define FIX_1849_OBJ_EDITING_API +#define NONBE_FIX_1262_OSBA_STEREO /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a21afef17..d589fe784 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2231,7 +2231,12 @@ ivas_error ivas_jbm_dec_render_fx( /* add already rendered SBA part */ #ifdef FIX_1849_OBJ_EDITING_API + +#ifdef NONBE_FIX_1262_OSBA_STEREO + ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); +#else ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); +#endif #else FOR( n = 0; n < nchan_out; n++ ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index f58dad3a3..b7dcfc3d9 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -343,14 +343,18 @@ void ivas_osba_stereo_add_channels_fx( const Word16 gain, /* i : gain bed value */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ +#ifndef NONBE_FIX_1262_OSBA_STEREO const int16_t ism_mode, /* i : ISM mode */ +#endif const UWord16 n_samples_to_render /* i : output frame length per channel */ ) { int16_t n; +#ifndef NONBE_FIX_1262_OSBA_STEREO if ( ism_mode == ISM_SBA_MODE_DISC ) { +#endif if ( NE_16( gain, 1 ) ) { assert( 0 && "Object editing is not implemented in the BASOP code!" ); @@ -362,6 +366,7 @@ void ivas_osba_stereo_add_channels_fx( v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); } } +#ifndef NONBE_FIX_1262_OSBA_STEREO } else { @@ -370,6 +375,20 @@ void ivas_osba_stereo_add_channels_fx( v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); } } +#endif + + +#ifdef NONBE_FIX_1262_OSBA_STEREO + FOR ( n = 0; n < nchan_out; n++ ) + { + Word16 i; + FOR( i=0; i < n_samples_to_render; i++) + { + output_fx[n][i] = L_shr( output_fx[n][i], 1); + } + } +#endif + return; } -- GitLab From 7b868a124421b6829345cbdec0ac71a8b1130a03 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 13:36:14 +0200 Subject: [PATCH 04/25] fix formatting --- lib_dec/ivas_osba_dec_fx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index b7dcfc3d9..3aca9fc40 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -338,13 +338,13 @@ ivas_error ivas_osba_render_sf_fx( *-------------------------------------------------------------------------*/ void ivas_osba_stereo_add_channels_fx( - Word32 *tc_fx[], /* i : transport channels */ - Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value */ - const Word16 nchan_out, /* i : number of output channels */ - const Word16 nchan_ism, /* i : number of ISM channels */ + Word32 *tc_fx[], /* i : transport channels */ + Word32 *output_fx[], /* i/o: output channels */ + const Word16 gain, /* i : gain bed value */ + const Word16 nchan_out, /* i : number of output channels */ + const Word16 nchan_ism, /* i : number of ISM channels */ #ifndef NONBE_FIX_1262_OSBA_STEREO - const int16_t ism_mode, /* i : ISM mode */ + const int16_t ism_mode, /* i : ISM mode */ #endif const UWord16 n_samples_to_render /* i : output frame length per channel */ ) @@ -379,12 +379,12 @@ void ivas_osba_stereo_add_channels_fx( #ifdef NONBE_FIX_1262_OSBA_STEREO - FOR ( n = 0; n < nchan_out; n++ ) + FOR( n = 0; n < nchan_out; n++ ) { Word16 i; - FOR( i=0; i < n_samples_to_render; i++) + FOR( i = 0; i < n_samples_to_render; i++ ) { - output_fx[n][i] = L_shr( output_fx[n][i], 1); + output_fx[n][i] = L_shr( output_fx[n][i], 1 ); } } #endif -- GitLab From 373258d4018b310033a63d6eca76ece8684554f0 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 13:45:44 +0200 Subject: [PATCH 05/25] replace explicit loop by call to scale_sig32 --- lib_dec/ivas_osba_dec_fx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 3aca9fc40..a07df90ad 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -381,11 +381,12 @@ void ivas_osba_stereo_add_channels_fx( #ifdef NONBE_FIX_1262_OSBA_STEREO FOR( n = 0; n < nchan_out; n++ ) { - Word16 i; - FOR( i = 0; i < n_samples_to_render; i++ ) - { - output_fx[n][i] = L_shr( output_fx[n][i], 1 ); - } + //Word16 i; + //FOR( i = 0; i < n_samples_to_render; i++ ) + //{ + // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); + //} + scale_sig32(output_fx[n], n_samples_to_render, -1); } #endif -- GitLab From 01a14b6bd3462f3cc1a01d530c22d96f7e93aa5e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 13:55:47 +0200 Subject: [PATCH 06/25] fix formatting --- lib_dec/ivas_osba_dec_fx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index a07df90ad..abe04960d 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -381,12 +381,12 @@ void ivas_osba_stereo_add_channels_fx( #ifdef NONBE_FIX_1262_OSBA_STEREO FOR( n = 0; n < nchan_out; n++ ) { - //Word16 i; - //FOR( i = 0; i < n_samples_to_render; i++ ) + // Word16 i; + // FOR( i = 0; i < n_samples_to_render; i++ ) //{ - // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); - //} - scale_sig32(output_fx[n], n_samples_to_render, -1); + // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); + // } + scale_sig32( output_fx[n], n_samples_to_render, -1 ); } #endif -- GitLab From b0657cb4151662d4ebf4c70b8f1ca3a46fefcbc6 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 15:09:53 +0200 Subject: [PATCH 07/25] port NONBE_1339_FIXOSBA_EXT_LOUDNESS from float MR 2159 --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec_fx.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index a22d3b0f6..1370bb59c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -133,6 +133,7 @@ #define FIX_1849_OBJ_EDITING_API #define NONBE_FIX_1262_OSBA_STEREO +#define NONBE_1339_FIXOSBA_EXT_LOUDNESS /* FhG: issue 1339: apply scaling with EXT output in OSBA high-BR mode */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index d589fe784..3363e9913 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2262,6 +2262,12 @@ ivas_error ivas_jbm_dec_render_fx( { Copy32( st_ivas->hTcBuffer->tc_fx[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output_fx[n], *nSamplesRendered ); } +#ifdef NONBE_1339_FIXOSBA_EXT_LOUDNESS + for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) + { + scale_sig32( p_output_fx[n], *nSamplesRendered, -1 ); + } +#endif } ELSE { -- GitLab From dfc0f1d402b6fd70e7bb8d75cd1f2a72a743d8d0 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 15:32:10 +0200 Subject: [PATCH 08/25] port NONBE_1352_HARMONIZE_OSBA_LOUDNESS from float MR 2184 --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec_fx.c | 15 ++++++++++++++- lib_dec/ivas_osba_dec_fx.c | 22 +++++++++++++++++----- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1370bb59c..bcc4b04ff 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -134,6 +134,7 @@ #define FIX_1849_OBJ_EDITING_API #define NONBE_FIX_1262_OSBA_STEREO #define NONBE_1339_FIXOSBA_EXT_LOUDNESS /* FhG: issue 1339: apply scaling with EXT output in OSBA high-BR mode */ +#define NONBE_1352_HARMONIZE_OSBA_LOUDNESS /* FhG: do not scale OSBA inputs by 0.5 any more */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 3363e9913..a112a65e6 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2262,7 +2262,7 @@ ivas_error ivas_jbm_dec_render_fx( { Copy32( st_ivas->hTcBuffer->tc_fx[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output_fx[n], *nSamplesRendered ); } -#ifdef NONBE_1339_FIXOSBA_EXT_LOUDNESS +#if defined( NONBE_1339_FIXOSBA_EXT_LOUDNESS ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { scale_sig32( p_output_fx[n], *nSamplesRendered, -1 ); @@ -2280,6 +2280,12 @@ ivas_error ivas_jbm_dec_render_fx( ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { ivas_dirac_dec_binaural_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output_fx ); +#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS + FOR ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) + { + scale_sig_32( p_output_fx[n], *nSamplesRendered, 1 ); + } +#endif } ELSE { @@ -2299,6 +2305,13 @@ ivas_error ivas_jbm_dec_render_fx( set32_fx( p_output_fx[n], 0, *nSamplesRendered ); } } +#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS + FOR ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) + { + scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); + } +#endif + } } ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index abe04960d..2a54073f6 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -203,13 +203,21 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( FOR( b = 0; b < num_cldfb_bands; b++ ) { st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] = +#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS + L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_RealBuffer[b] ); +#else L_add( L_shr( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], 1 ), L_shr( Cldfb_RealBuffer[b], 1 ) ); +#endif move32(); st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] = +#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS + L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_ImagBuffer[b] ); +#else L_add( L_shr( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], 1 ), L_shr( Cldfb_ImagBuffer[b], 1 ) ); +#endif move32(); } } @@ -227,7 +235,11 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( Word16 i; FOR( i = 0; i < nSamplesAsked; i++ ) { +#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS + output_fx[n][i] = L_add( output_fx[channel_offset + n][i], p_sepobj_fx[n][i] ); +#else output_fx[n][i] = L_add( L_shr( output_fx[channel_offset + n][i], 1 ), L_shr( p_sepobj_fx[n][i], 1 ) ); +#endif move32(); } } @@ -381,12 +393,12 @@ void ivas_osba_stereo_add_channels_fx( #ifdef NONBE_FIX_1262_OSBA_STEREO FOR( n = 0; n < nchan_out; n++ ) { - // Word16 i; - // FOR( i = 0; i < n_samples_to_render; i++ ) + iWord16 i; + //FOR( i = 0; i < n_samples_to_render; i++ ) //{ - // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); - // } - scale_sig32( output_fx[n], n_samples_to_render, -1 ); + // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); + //} + scale_sig32(output_fx[n], n_samples_to_render, -1); } #endif -- GitLab From c58e74b2f831dcbf8564dd67db8c28514401dc07 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 15:32:35 +0200 Subject: [PATCH 09/25] fix formatting --- lib_dec/ivas_jbm_dec_fx.c | 5 ++--- lib_dec/ivas_osba_dec_fx.c | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a112a65e6..00934dda3 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2281,7 +2281,7 @@ ivas_error ivas_jbm_dec_render_fx( { ivas_dirac_dec_binaural_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output_fx ); #ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS - FOR ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) + FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { scale_sig_32( p_output_fx[n], *nSamplesRendered, 1 ); } @@ -2306,12 +2306,11 @@ ivas_error ivas_jbm_dec_render_fx( } } #ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS - FOR ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) + FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); } #endif - } } ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 2a54073f6..e78b2967f 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -394,11 +394,11 @@ void ivas_osba_stereo_add_channels_fx( FOR( n = 0; n < nchan_out; n++ ) { iWord16 i; - //FOR( i = 0; i < n_samples_to_render; i++ ) + // FOR( i = 0; i < n_samples_to_render; i++ ) //{ - // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); - //} - scale_sig32(output_fx[n], n_samples_to_render, -1); + // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); + // } + scale_sig32( output_fx[n], n_samples_to_render, -1 ); } #endif -- GitLab From 8b7c1dfb6f686d640ffe7d9160267c62920d9654 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 16:18:31 +0200 Subject: [PATCH 10/25] fix compile errors --- lib_dec/ivas_jbm_dec_fx.c | 2 +- lib_dec/ivas_osba_dec_fx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 00934dda3..4f329d1f8 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2283,7 +2283,7 @@ ivas_error ivas_jbm_dec_render_fx( #ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { - scale_sig_32( p_output_fx[n], *nSamplesRendered, 1 ); + scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); } #endif } diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index e78b2967f..0efa65b0f 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -393,7 +393,7 @@ void ivas_osba_stereo_add_channels_fx( #ifdef NONBE_FIX_1262_OSBA_STEREO FOR( n = 0; n < nchan_out; n++ ) { - iWord16 i; + //Word16 i; // FOR( i = 0; i < n_samples_to_render; i++ ) //{ // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); -- GitLab From 0aeb6c603d78a770baf78f335949977037a02c20 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 16:26:15 +0200 Subject: [PATCH 11/25] fix formatting --- lib_dec/ivas_osba_dec_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 0efa65b0f..a559facfc 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -393,11 +393,11 @@ void ivas_osba_stereo_add_channels_fx( #ifdef NONBE_FIX_1262_OSBA_STEREO FOR( n = 0; n < nchan_out; n++ ) { - //Word16 i; - // FOR( i = 0; i < n_samples_to_render; i++ ) + // Word16 i; + // FOR( i = 0; i < n_samples_to_render; i++ ) //{ - // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); - // } + // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); + // } scale_sig32( output_fx[n], n_samples_to_render, -1 ); } #endif -- GitLab From 723f5eb07d07c74897173506d55d0879df7449ce Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 16:46:23 +0200 Subject: [PATCH 12/25] implment missing changes under NONBE_1352_HARMONIZE_OSBA_LOUDNESS --- lib_dec/ivas_osba_dec_fx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index a559facfc..7a3ecdd99 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -332,10 +332,12 @@ ivas_error ivas_osba_render_sf_fx( { v_add_fixed( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered, 1 ); // takes care of downscaling by 0.5f } +#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS ELSE { scale_sig32( p_output[n], *nSamplesRendered, -1 ); } +#endif } return IVAS_ERR_OK; @@ -390,7 +392,7 @@ void ivas_osba_stereo_add_channels_fx( #endif -#ifdef NONBE_FIX_1262_OSBA_STEREO +#if defined( NONBE_FIX_1262_OSBA_STEREO ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) FOR( n = 0; n < nchan_out; n++ ) { // Word16 i; -- GitLab From 17067447841b62e2731fae5f5bce429214055295 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 11 Aug 2025 16:46:49 +0200 Subject: [PATCH 13/25] delete commented-out code --- lib_dec/ivas_osba_dec_fx.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 7a3ecdd99..fe4a2e5cd 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -395,11 +395,6 @@ void ivas_osba_stereo_add_channels_fx( #if defined( NONBE_FIX_1262_OSBA_STEREO ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) FOR( n = 0; n < nchan_out; n++ ) { - // Word16 i; - // FOR( i = 0; i < n_samples_to_render; i++ ) - //{ - // output_fx[n][i] = L_shr( output_fx[n][i], 1 ); - // } scale_sig32( output_fx[n], n_samples_to_render, -1 ); } #endif -- GitLab From b8d6b8736db8371dccaba7bccb3d4bf12a174346 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 10:40:53 +0200 Subject: [PATCH 14/25] fix a define in ivas_jbm_dec_fx.c --- lib_dec/ivas_jbm_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 4f329d1f8..816f89457 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2305,10 +2305,10 @@ ivas_error ivas_jbm_dec_render_fx( set32_fx( p_output_fx[n], 0, *nSamplesRendered ); } } -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#if defined( NONBE_1339_FIXOSBA_EXT_LOUDNESS ) && !defined (NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { - scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); + scale_sig32( p_output_fx[n], *nSamplesRendered, -1 ); } #endif } -- GitLab From cd6b12c9c876c44f789cbb5d9a71645f6bd22026 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 10:49:57 +0200 Subject: [PATCH 15/25] fix shifts in ivas_jbm_dec_render_fx --- lib_dec/ivas_jbm_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 816f89457..4f329d1f8 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2305,10 +2305,10 @@ ivas_error ivas_jbm_dec_render_fx( set32_fx( p_output_fx[n], 0, *nSamplesRendered ); } } -#if defined( NONBE_1339_FIXOSBA_EXT_LOUDNESS ) && !defined (NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) +#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { - scale_sig32( p_output_fx[n], *nSamplesRendered, -1 ); + scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); } #endif } -- GitLab From 33be2f187ae33afdad6f122da9eb171d8ee8d8b1 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 11:02:15 +0200 Subject: [PATCH 16/25] combine the net changes under the new define NONBE_1894_OSBA_SCALING --- lib_com/ivas_prot_fx.h | 2 +- lib_com/options.h | 6 ++---- lib_dec/ivas_jbm_dec_fx.c | 12 +++--------- lib_dec/ivas_osba_dec_fx.c | 23 +++++++---------------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 57424c0c3..dc557e537 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3911,7 +3911,7 @@ void ivas_osba_stereo_add_channels_fx( const Word16 gain, /* i : gain bed value */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ -#ifndef NONBE_FIX_1262_OSBA_STEREO +#ifndef NONBE_1894_OSBA_SCALING const int16_t ism_mode, /* i : ISM mode */ #endif const UWord16 n_samples_to_render /* i : output frame length per channel */ diff --git a/lib_com/options.h b/lib_com/options.h index 913f5780f..c16768e12 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,10 +131,8 @@ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ -#define FIX_1849_OBJ_EDITING_API -#define NONBE_FIX_1262_OSBA_STEREO -#define NONBE_1339_FIXOSBA_EXT_LOUDNESS /* FhG: issue 1339: apply scaling with EXT output in OSBA high-BR mode */ -#define NONBE_1352_HARMONIZE_OSBA_LOUDNESS /* FhG: do not scale OSBA inputs by 0.5 any more */ +#define NONBE_1894_OSBA_SCALING /* FhG: do not scale OSBA inputs by 0.5 any more */ + /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 4f329d1f8..ec8ab0181 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2232,7 +2232,7 @@ ivas_error ivas_jbm_dec_render_fx( /* add already rendered SBA part */ #ifdef FIX_1849_OBJ_EDITING_API -#ifdef NONBE_FIX_1262_OSBA_STEREO +#ifdef NONBE_1894_OSBA_SCALING ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); #else ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); @@ -2262,12 +2262,6 @@ ivas_error ivas_jbm_dec_render_fx( { Copy32( st_ivas->hTcBuffer->tc_fx[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output_fx[n], *nSamplesRendered ); } -#if defined( NONBE_1339_FIXOSBA_EXT_LOUDNESS ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) - for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) - { - scale_sig32( p_output_fx[n], *nSamplesRendered, -1 ); - } -#endif } ELSE { @@ -2280,7 +2274,7 @@ ivas_error ivas_jbm_dec_render_fx( ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { ivas_dirac_dec_binaural_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output_fx ); -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#ifdef NONBE_1894_OSBA_SCALING FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); @@ -2305,7 +2299,7 @@ ivas_error ivas_jbm_dec_render_fx( set32_fx( p_output_fx[n], 0, *nSamplesRendered ); } } -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#ifdef NONBE_1894_OSBA_SCALING FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { scale_sig32( p_output_fx[n], *nSamplesRendered, 1 ); diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index fe4a2e5cd..b06036df8 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -203,7 +203,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( FOR( b = 0; b < num_cldfb_bands; b++ ) { st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] = -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#ifdef NONBE_1894_OSBA_SCALING L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_RealBuffer[b] ); #else L_add( L_shr( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], 1 ), @@ -212,7 +212,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( move32(); st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] = -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#ifdef NONBE_1894_OSBA_SCALING L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_ImagBuffer[b] ); #else L_add( L_shr( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], 1 ), @@ -235,7 +235,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( Word16 i; FOR( i = 0; i < nSamplesAsked; i++ ) { -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#ifdef NONBE_1894_OSBA_SCALING output_fx[n][i] = L_add( output_fx[channel_offset + n][i], p_sepobj_fx[n][i] ); #else output_fx[n][i] = L_add( L_shr( output_fx[channel_offset + n][i], 1 ), L_shr( p_sepobj_fx[n][i], 1 ) ); @@ -332,7 +332,7 @@ ivas_error ivas_osba_render_sf_fx( { v_add_fixed( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered, 1 ); // takes care of downscaling by 0.5f } -#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS +#ifndef NONBE_1894_OSBA_SCALING ELSE { scale_sig32( p_output[n], *nSamplesRendered, -1 ); @@ -357,7 +357,7 @@ void ivas_osba_stereo_add_channels_fx( const Word16 gain, /* i : gain bed value */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ -#ifndef NONBE_FIX_1262_OSBA_STEREO +#ifndef NONBE_1894_OSBA_SCALING const int16_t ism_mode, /* i : ISM mode */ #endif const UWord16 n_samples_to_render /* i : output frame length per channel */ @@ -365,7 +365,7 @@ void ivas_osba_stereo_add_channels_fx( { int16_t n; -#ifndef NONBE_FIX_1262_OSBA_STEREO +#ifndef NONBE_1894_OSBA_SCALING if ( ism_mode == ISM_SBA_MODE_DISC ) { #endif @@ -380,7 +380,7 @@ void ivas_osba_stereo_add_channels_fx( v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); } } -#ifndef NONBE_FIX_1262_OSBA_STEREO +#ifndef NONBE_1894_OSBA_SCALING } else { @@ -391,15 +391,6 @@ void ivas_osba_stereo_add_channels_fx( } #endif - -#if defined( NONBE_FIX_1262_OSBA_STEREO ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS ) - FOR( n = 0; n < nchan_out; n++ ) - { - scale_sig32( output_fx[n], n_samples_to_render, -1 ); - } -#endif - - return; } #endif -- GitLab From 71e27ea42559f62e1d79b0d79c71f0a6912dd0f8 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 11:07:43 +0200 Subject: [PATCH 17/25] delete unreachable code --- lib_com/ivas_prot_fx.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index dc557e537..0bb6d03e9 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3911,9 +3911,6 @@ void ivas_osba_stereo_add_channels_fx( const Word16 gain, /* i : gain bed value */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ -#ifndef NONBE_1894_OSBA_SCALING - const int16_t ism_mode, /* i : ISM mode */ -#endif const UWord16 n_samples_to_render /* i : output frame length per channel */ ); #endif -- GitLab From f720ef0df5a4216245ee9fce0ae0fc9157eba67a Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 11:23:32 +0200 Subject: [PATCH 18/25] remove scaling in ivas_osba_render_sf_fx for RENDERER_BINAURAL_FASTCONV_ROOM --- lib_dec/ivas_osba_dec_fx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index b06036df8..c734c3844 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -330,7 +330,12 @@ ivas_error ivas_osba_render_sf_fx( { IF( NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { +#ifndef NONBE_1894_OSBA_SCALING v_add_fixed( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered, 1 ); // takes care of downscaling by 0.5f +#else + v_add_fixed_no_hdrm( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); +#endif + } #ifndef NONBE_1894_OSBA_SCALING ELSE -- GitLab From 7c45985978f04434ec4c32270b972c33092615ca Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 11:56:17 +0200 Subject: [PATCH 19/25] fix formatting --- lib_dec/ivas_osba_dec_fx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index c734c3844..b31d57ae3 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -335,7 +335,6 @@ ivas_error ivas_osba_render_sf_fx( #else v_add_fixed_no_hdrm( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); #endif - } #ifndef NONBE_1894_OSBA_SCALING ELSE -- GitLab From 70fe0d18b02279b246df0ce16cf165cb008c0098 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 13:17:58 +0200 Subject: [PATCH 20/25] remove a newline in options.h --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index c16768e12..4769d3de8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -133,7 +133,6 @@ #define NONBE_1894_OSBA_SCALING /* FhG: do not scale OSBA inputs by 0.5 any more */ - /* #################### End BASOP porting switches ############################ */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ -- GitLab From 18edbd41d6769697e1b49d9571c7731305333b38 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 14:15:53 +0200 Subject: [PATCH 21/25] fix wrong defines --- lib_dec/ivas_jbm_dec_fx.c | 5 ----- lib_dec/ivas_osba_dec_fx.c | 9 +++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index ec8ab0181..20279437b 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2230,13 +2230,8 @@ ivas_error ivas_jbm_dec_render_fx( ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_fx, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef FIX_1849_OBJ_EDITING_API - #ifdef NONBE_1894_OSBA_SCALING ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); -#else - ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); -#endif #else FOR( n = 0; n < nchan_out; n++ ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index b31d57ae3..e89f6c27e 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -348,7 +348,7 @@ ivas_error ivas_osba_render_sf_fx( } -#ifdef FIX_1849_OBJ_EDITING_API +#ifdef NONBE_1894_OSBA_SCALING /*-------------------------------------------------------------------------* * ivas_osba_stereo_add_channels() * @@ -361,15 +361,12 @@ void ivas_osba_stereo_add_channels_fx( const Word16 gain, /* i : gain bed value */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ -#ifndef NONBE_1894_OSBA_SCALING - const int16_t ism_mode, /* i : ISM mode */ -#endif const UWord16 n_samples_to_render /* i : output frame length per channel */ ) { int16_t n; -#ifndef NONBE_1894_OSBA_SCALING +#if 0 if ( ism_mode == ISM_SBA_MODE_DISC ) { #endif @@ -384,7 +381,7 @@ void ivas_osba_stereo_add_channels_fx( v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); } } -#ifndef NONBE_1894_OSBA_SCALING +#if 0 } else { -- GitLab From ad7f60f2ae06cedfec54f566955a8e47a4808c08 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 14:34:24 +0200 Subject: [PATCH 22/25] in ivas_osba_stereo_add_channels_fx, follow proper BASOP conventions --- lib_dec/ivas_osba_dec_fx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index e89f6c27e..e1c171555 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -364,17 +364,17 @@ void ivas_osba_stereo_add_channels_fx( const UWord16 n_samples_to_render /* i : output frame length per channel */ ) { - int16_t n; + Word16 n; #if 0 - if ( ism_mode == ISM_SBA_MODE_DISC ) + IF ( ism_mode == ISM_SBA_MODE_DISC ) { #endif - if ( NE_16( gain, 1 ) ) + IF ( NE_16( gain, 1 ) ) { assert( 0 && "Object editing is not implemented in the BASOP code!" ); } - else + ELSE { FOR( n = 0; n < nchan_out; n++ ) { @@ -383,7 +383,7 @@ void ivas_osba_stereo_add_channels_fx( } #if 0 } - else + ELSE { FOR( n = 0; n < nchan_out; n++ ) { -- GitLab From 51ab10f665dc22cabbc6426dab88c5627f751cd9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 14:49:16 +0200 Subject: [PATCH 23/25] fix compile errors --- lib_com/ivas_prot_fx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 0bb6d03e9..9444bc63f 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3904,7 +3904,7 @@ ivas_error ivas_osba_render_sf_fx( Word32 *p_output[] /* o : rendered time signal */ ); -#ifdef FIX_1849_OBJ_EDITING_API +#ifdef NONBE_1894_OSBA_SCALING void ivas_osba_stereo_add_channels_fx( Word32 *tc_fx[], /* i : transport channels */ Word32 *output_fx[], /* i/o: output channels */ -- GitLab From e4ea838f2113bf6a2dc54197c1c05135cb18155a Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 14:53:27 +0200 Subject: [PATCH 24/25] fix formatting --- lib_dec/ivas_osba_dec_fx.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index e1c171555..ad0ebb466 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -356,11 +356,11 @@ ivas_error ivas_osba_render_sf_fx( *-------------------------------------------------------------------------*/ void ivas_osba_stereo_add_channels_fx( - Word32 *tc_fx[], /* i : transport channels */ - Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value */ - const Word16 nchan_out, /* i : number of output channels */ - const Word16 nchan_ism, /* i : number of ISM channels */ + Word32 *tc_fx[], /* i : transport channels */ + Word32 *output_fx[], /* i/o: output channels */ + const Word16 gain, /* i : gain bed value */ + const Word16 nchan_out, /* i : number of output channels */ + const Word16 nchan_ism, /* i : number of ISM channels */ const UWord16 n_samples_to_render /* i : output frame length per channel */ ) { @@ -370,17 +370,17 @@ void ivas_osba_stereo_add_channels_fx( IF ( ism_mode == ISM_SBA_MODE_DISC ) { #endif - IF ( NE_16( gain, 1 ) ) - { - assert( 0 && "Object editing is not implemented in the BASOP code!" ); - } - ELSE + IF( NE_16( gain, 1 ) ) + { + assert( 0 && "Object editing is not implemented in the BASOP code!" ); + } + ELSE + { + FOR( n = 0; n < nchan_out; n++ ) { - FOR( n = 0; n < nchan_out; n++ ) - { - v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); - } + v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); } + } #if 0 } ELSE -- GitLab From 1c1de2ce215f2bd26a3d3ce636ac1471acca740f Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 12 Aug 2025 15:36:46 +0200 Subject: [PATCH 25/25] represent gain_bed in Q11 --- lib_com/ivas_prot_fx.h | 8 ++++---- lib_dec/ivas_jbm_dec_fx.c | 2 +- lib_dec/ivas_osba_dec_fx.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 9444bc63f..3472b4e75 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3908,10 +3908,10 @@ ivas_error ivas_osba_render_sf_fx( void ivas_osba_stereo_add_channels_fx( Word32 *tc_fx[], /* i : transport channels */ Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value */ - const Word16 nchan_out, /* i : number of output channels */ - const Word16 nchan_ism, /* i : number of ISM channels */ - const UWord16 n_samples_to_render /* i : output frame length per channel */ + const Word16 gain, /* i : gain bed value Q11 */ + const Word16 nchan_out, /* i : number of output channels */ + const Word16 nchan_ism, /* i : number of ISM channels */ + const UWord16 n_samples_to_render /* i : output frame length per channel */ ); #endif diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 20279437b..63bb63a07 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2231,7 +2231,7 @@ ivas_error ivas_jbm_dec_render_fx( /* add already rendered SBA part */ #ifdef NONBE_1894_OSBA_SCALING - ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); + ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, ONE_IN_Q11, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); #else FOR( n = 0; n < nchan_out; n++ ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index ad0ebb466..2e9d0c3f6 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -358,7 +358,7 @@ ivas_error ivas_osba_render_sf_fx( void ivas_osba_stereo_add_channels_fx( Word32 *tc_fx[], /* i : transport channels */ Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value */ + const Word16 gain, /* i : gain bed value Q11 */ const Word16 nchan_out, /* i : number of output channels */ const Word16 nchan_ism, /* i : number of ISM channels */ const UWord16 n_samples_to_render /* i : output frame length per channel */ @@ -370,7 +370,7 @@ void ivas_osba_stereo_add_channels_fx( IF ( ism_mode == ISM_SBA_MODE_DISC ) { #endif - IF( NE_16( gain, 1 ) ) + IF( NE_16( gain, ONE_IN_Q11 ) ) { assert( 0 && "Object editing is not implemented in the BASOP code!" ); } -- GitLab