From 888a10a0d2297869632a970f773409d466381625 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 4 Jun 2023 22:37:45 +0200 Subject: [PATCH 1/2] [fix] discard bw detector for MDCT stereo and MCT --- lib_com/options.h | 2 ++ lib_enc/bw_detect.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 369eb91f24..0c4de1f64b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -238,6 +238,8 @@ #define BINAURAL_AUDIO_CMDLINE +#define BWD_HIGH_BR /* FhG: BW to max_bwidth at bitrates using an MDCT core only */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index 6de35a211a..d4263edddd 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -634,6 +634,7 @@ void set_bw_stereo( { Encoder_State **sts = hCPE->hCoreCoder; +#ifndef BWD_HIGH_BR if ( hCPE->element_mode == IVAS_CPE_MDCT ) { /* ensure that both CPE channels have the same audio band-width */ @@ -651,6 +652,10 @@ void set_bw_stereo( sts[0]->bwidth = max( sts[0]->bwidth, WB ); sts[1]->bwidth = max( sts[1]->bwidth, WB ); +#else + sts[0]->bwidth = max( sts[0]->max_bwidth, WB ); + sts[1]->bwidth = max( sts[1]->max_bwidth, WB ); +#endif return; } @@ -685,7 +690,12 @@ int16_t set_bw_mct( continue; } +#ifndef BWD_HIGH_BR mct_bwidth = max( mct_bwidth, st->input_bwidth ); +#else + mct_bwidth = max( mct_bwidth, st->max_bwidth ); +#endif + } } -- GitLab From 2dcaccadf56f37a0d8a105f55f1c7f1b5d395a5d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 4 Jun 2023 22:54:48 +0200 Subject: [PATCH 2/2] format --- lib_enc/bw_detect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index d4263edddd..a7992547ad 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -695,7 +695,6 @@ int16_t set_bw_mct( #else mct_bwidth = max( mct_bwidth, st->max_bwidth ); #endif - } } -- GitLab