diff --git a/lib_com/options.h b/lib_com/options.h index 0ee80d1cf2b25a0c611dacfd1933b1879d6e7dee..d4d5d09613da07fe7f8a44ca1b51fb4b40f713ba 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,10 +153,11 @@ #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_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ #define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ +#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 9c938e0a1a5ba16d5265f6ea9305e7422929d5c4..b160193ad3144dfadd7708640b915ff7b085770c 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 */ @@ -219,18 +222,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