From 9dcc65aa67c94b179abad2f82b55b50dbd4af5e9 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 20 Nov 2024 16:45:01 +1100 Subject: [PATCH 1/4] Adjust gain in pre-rendering ISM to SBA and in merging transport channels when encoding OSBA input signals. --- lib_enc/ivas_osba_enc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 675b89c6d..814cd08ed 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -72,7 +72,7 @@ static void ivas_merge_sba_transports( { for ( j = 0; j < input_frame; j++ ) { - data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] ); + data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] ); } } @@ -477,15 +477,5 @@ static void ivas_osba_render_ism_to_sba( } } - /* Gain with loudness-matching gains */ - output_gain = 0.7499f; - for ( j = 0; j < nchan_sba; j++ ) - { - for ( k = 0; k < input_frame; k++ ) - { - data_out_f[j][k] *= output_gain; - } - } - return; } -- GitLab From 060299c80370619f69124279c9c30d61aa2309ad Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 20 Nov 2024 16:57:57 +1100 Subject: [PATCH 2/4] add switches --- lib_enc/ivas_osba_enc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 814cd08ed..3fbcb0d10 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -72,7 +72,10 @@ static void ivas_merge_sba_transports( { for ( j = 0; j < input_frame; j++ ) { - data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] ); + data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] ); +#ifdef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS + data_out_f[i][j] *= 0.5f; +#endif } } @@ -477,5 +480,17 @@ static void ivas_osba_render_ism_to_sba( } } +#ifndef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS + /* Gain with loudness-matching gains */ + output_gain = 0.7499f; + for ( j = 0; j < nchan_sba; j++ ) + { + for ( k = 0; k < input_frame; k++ ) + { + data_out_f[j][k] *= output_gain; + } + } +#endif + return; } -- GitLab From 8a5832c79b9707e38e7e27078deeb206c09e4a8f Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 21 Nov 2024 11:21:00 +1100 Subject: [PATCH 3/4] Missed from previous commit --- lib_com/options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_com/options.h b/lib_com/options.h index 6e0851258..d65d49504 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,6 +168,7 @@ #define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ #define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */ #define NONBE_FIX_1205_TD_STEREO_MOD_CT /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */ +#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ -- GitLab From ef8b32b7fc434ae99e761dc53e720be9c08a7698 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 28 Nov 2024 13:40:30 +1100 Subject: [PATCH 4/4] address code review comment --- lib_enc/ivas_osba_enc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 3fbcb0d10..dffebcf19 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -72,9 +72,10 @@ static void ivas_merge_sba_transports( { for ( j = 0; j < input_frame; j++ ) { - data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] ); #ifdef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS - data_out_f[i][j] *= 0.5f; + data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] ); +#else + data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] ); #endif } } -- GitLab