From 924ec18de86c7593ef91de6b54eb651cd7250601 Mon Sep 17 00:00:00 2001 From: advasila Date: Thu, 31 Aug 2023 07:20:16 +0300 Subject: [PATCH 1/5] check secondary ch bitrate in inactive mode --- lib_com/ivas_stereo_td_bit_alloc.c | 9 +++++++++ lib_com/options.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 8282cb9dbd..8306dae25d 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -420,6 +420,15 @@ void tdm_bit_alloc( *total_brate_sec += 100; } } +#ifdef FIX_751_MASA_TD_BITRATE_CHECK + else + { + if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) + { + *total_brate_sec += 100; + } + } +#endif *total_brate_pri = element_brate_wo_meta - *total_brate_sec; return; diff --git a/lib_com/options.h b/lib_com/options.h index be3261f808..80b9ffb954 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,7 +167,7 @@ #define FIX_718_JBM_MD_UDPATE /* Fhg: fix issue #718, wrong setting of the update flag in the TD obj renderer in the JBM path */ #define FIX_719_CRASH_IN_CLEANUP /* VA: issue 719: fix Decoder crash after call to goto to cleanup */ - +#define FIX_751_MASA_TD_BITRATE_CHECK /* Nokia: issue 751: prevents secondary channel to take reserved bitrate if not DTX mode */ /* ################## End BE DEVELOPMENT switches ######################### */ -- GitLab From 29d789c5c7bdd3b4e9a2ad0d3ebf65213d659fba Mon Sep 17 00:00:00 2001 From: advasila Date: Mon, 4 Sep 2023 16:21:10 +0300 Subject: [PATCH 2/5] leave just one TD bitrate correction --- lib_com/ivas_stereo_td_bit_alloc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 8306dae25d..f3bfc34278 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -408,12 +408,13 @@ void tdm_bit_alloc( } *total_brate_sec += ( fast_FCB_rates_2sfr[idx] - tmp_rate ); } +#ifndef FIX_751_MASA_TD_BITRATE_CHECK /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) { *total_brate_sec += 100; } - +#endif /* To prevent 13.2 kb/s for primary channel as some bitstream issues arrise with it */ if ( element_brate_wo_meta - *total_brate_sec == ACELP_13k20 ) { @@ -421,13 +422,12 @@ void tdm_bit_alloc( } } #ifdef FIX_751_MASA_TD_BITRATE_CHECK - else + /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ + if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) { - if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) - { - *total_brate_sec += 100; - } + *total_brate_sec -= 100; } + #endif *total_brate_pri = element_brate_wo_meta - *total_brate_sec; -- GitLab From e17b0ece6d7e10ca013efe362bc2bf1ea6586f17 Mon Sep 17 00:00:00 2001 From: advasila Date: Mon, 4 Sep 2023 16:43:01 +0300 Subject: [PATCH 3/5] fix clang --- lib_com/ivas_stereo_td_bit_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index f3bfc34278..4154fb9023 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -427,7 +427,7 @@ void tdm_bit_alloc( { *total_brate_sec -= 100; } - + #endif *total_brate_pri = element_brate_wo_meta - *total_brate_sec; -- GitLab From b4a9d32df29ae90e9e5f5ce16ec1d1b73136ab81 Mon Sep 17 00:00:00 2001 From: advasila Date: Tue, 5 Sep 2023 10:41:21 +0300 Subject: [PATCH 4/5] correct switch name for issue 751 --- 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 a9eebcd3cb..92dbeb25e3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,7 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define FIX_751_MASA_TD_BITRATE_CHECK /* Nokia: issue 751: prevents secondary channel to take reserved bitrate if not DTX mode */ +#define NONBE_FIX_751_MASA_TD_BITRATE_CHECK /* Nokia: issue 751: prevents secondary channel to take reserved bitrate if not DTX mode */ #define NONBE_FIX_736_FOA_BR_SWITCH /* FhG/Dlb : Issue 736: FOA bitrate switching decoding crashes in in ivas_spar_to_dirac */ #define NONBE_FIX_746_NONDIEGETIC_MD /* Eri: Issue 746: The non-diegetic panning flag affects the encoder bitstream even if extended metadata is not enabled. Crashes the decoder.*/ -- GitLab From e659d58b318981ab3b1cd717de74dd11f7421c1c Mon Sep 17 00:00:00 2001 From: advasila Date: Tue, 5 Sep 2023 12:43:12 +0300 Subject: [PATCH 5/5] fix switch name 751 --- lib_com/ivas_stereo_td_bit_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 4154fb9023..8558bd34f1 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -408,7 +408,7 @@ void tdm_bit_alloc( } *total_brate_sec += ( fast_FCB_rates_2sfr[idx] - tmp_rate ); } -#ifndef FIX_751_MASA_TD_BITRATE_CHECK +#ifndef NONBE_FIX_751_MASA_TD_BITRATE_CHECK /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) { @@ -421,7 +421,7 @@ void tdm_bit_alloc( *total_brate_sec += 100; } } -#ifdef FIX_751_MASA_TD_BITRATE_CHECK +#ifdef NONBE_FIX_751_MASA_TD_BITRATE_CHECK /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) { -- GitLab