From 2fd43ece1d9edbe795c429cb71cc956c39017866 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 22 Jun 2023 13:50:34 +0200 Subject: [PATCH 1/2] TCX bitrate limitation only when DEBUGGING is active --- lib_com/options.h | 2 +- lib_enc/ivas_decision_matrix_enc.c | 35 ++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5d75836d13..c1a1d7c8ac 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,8 +153,8 @@ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ - #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ +#define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 9c938e0a1a..9b7afe4c77 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -219,18 +219,35 @@ void ivas_decision_matrix_enc( { st->core = HQ_CORE; } + } - /* TCX not available at low bitrates -> replace it by GSC */ - if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) +#ifndef FIX_TCX_LOWRATE_LIMITATION + /* TCX not available at low bitrates -> replace it by GSC */ + if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) + { + st->core = ACELP_CORE; + st->coder_type = AUDIO; + st->sp_aud_decision2 = 0; + + if ( st->low_rate_mode ) { - st->core = ACELP_CORE; - st->coder_type = AUDIO; - st->sp_aud_decision2 = 0; + st->coder_type = INACTIVE; + } + } +#endif +#endif - if ( st->low_rate_mode ) - { - st->coder_type = INACTIVE; - } +#ifdef FIX_TCX_LOWRATE_LIMITATION + /* TCX not available at low bitrates -> replace it by GSC */ + if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) + { + st->core = ACELP_CORE; + st->coder_type = AUDIO; + st->sp_aud_decision2 = 0; + + if ( st->low_rate_mode ) + { + st->coder_type = INACTIVE; } } #endif -- GitLab From 8468bffc47abf1fb3a2ad7048b4cf510c0e4df03 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 22 Jun 2023 14:04:37 +0200 Subject: [PATCH 2/2] remove obsolete condition --- lib_enc/ivas_decision_matrix_enc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 9b7afe4c77..b160193ad3 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -164,6 +164,8 @@ void ivas_decision_matrix_enc( /* select TCX core or HQ core using bits_frame_nominal to match the TCX configuration bitrate */ st->core = mdct_classifier( st, fft_buff, enerBuffer, st->bits_frame_nominal * FRAMES_PER_SEC ); } + +#ifndef FIX_TCX_LOWRATE_LIMITATION /* Warning: TCX not available at low bitrates -> replace it by GSC */ if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) { @@ -175,6 +177,7 @@ void ivas_decision_matrix_enc( st->coder_type = INACTIVE; } } +#endif } /* do not allow TD stereo ACELP core -> DFT stereo TCX core switching as it is on the WC complexity path */ -- GitLab