From 040edeedb925e2abc2ec574b5d74f3492e678084 Mon Sep 17 00:00:00 2001 From: azmill Date: Thu, 25 Jan 2024 15:29:40 +1100 Subject: [PATCH 1/2] Fixing the output gain for BRs 192kbps and below so that it matches the same level as BRs 256kbps and above. --- lib_com/options.h | 1 + lib_enc/ivas_osba_enc.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 820383e905..8ac866213c 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -176,6 +176,7 @@ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_949_MC_5MS_FRAMING /* Dlb: issue 949: fix for issue 949, distorted output in MC mode with 5ms framing*/ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ +#define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 675b89c6d6..5aee8be394 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -72,7 +72,11 @@ static void ivas_merge_sba_transports( { for ( j = 0; j < input_frame; j++ ) { +#ifdef NONBE_FIX_977_OSBA_GAIN_MISMATCH + 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 } } @@ -478,6 +482,7 @@ static void ivas_osba_render_ism_to_sba( } /* Gain with loudness-matching gains */ +#ifndef NONBE_FIX_977_OSBA_GAIN_MISMATCH output_gain = 0.7499f; for ( j = 0; j < nchan_sba; j++ ) { @@ -486,6 +491,7 @@ static void ivas_osba_render_ism_to_sba( data_out_f[j][k] *= output_gain; } } +#endif return; } -- GitLab From ead51fe52ebf80be49c82a1411dcaf572fb7b50a Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 25 Jan 2024 10:39:12 +0100 Subject: [PATCH 2/2] fix compile error under NONBE_FIX_977_OSBA_GAIN_MISMATCH --- lib_enc/ivas_osba_enc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 5aee8be394..bcff38b21d 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -447,7 +447,9 @@ static void ivas_osba_render_ism_to_sba( int16_t azimuth, elevation; float gains[MAX_INPUT_CHANNELS]; float g1, g2; +#ifndef NONBE_FIX_977_OSBA_GAIN_MISMATCH float output_gain; +#endif int16_t nchan_sba; -- GitLab