diff --git a/lib_com/options.h b/lib_com/options.h index 8b6b40f990c1cfc91d230b1e5b02713c95edf160..7fa610801bd2a2942126d5f7c449a42ed0a3fe3e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,6 +102,7 @@ #define FIX_2459_USAN_AMR_SIDSTART /* FhG: basop issue 2459: fix msan complaint */ #define FIX_2458_USAN_NULLPTR_WITH_ZERO_OFFSET /* FhG: basop issue 2458: avoid indexing into null pointer */ #define HARM_2456_APPLY_SCALE /* FhG basop issue 2456: Harmonize apply_scale_ind(), apply_scale_ivas_fx() */ +#define HARM_2454_TCX_RES_Q_SPEC /* FhG: harmonization of tcx_res_Q_spec_fx() and tcx_res_Q_spec_ivas_fx() */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 111805d4292c6e2ef023049232a710d75c6cadf2..71d22d2a8c85a1b1bfa90e000c0c5ef421651146 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -3585,11 +3585,19 @@ void QuantizeTCXSpectrum_fx( resQBits = tcx_res_Q_gain_fx( gain_tcx_opt_fx, gain_tcx_opt_e, gain_tcx_fx, gain_tcx_e, sqQ + L_spec, resQTargetBits ); IF( st->tcxonly ) { +#ifdef HARM_2454_TCX_RES_Q_SPEC + resQBits = tcx_res_Q_spec_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, NULL ); +#else resQBits = tcx_res_Q_spec_ivas_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, NULL ); +#endif } ELSE { +#ifdef HARM_2454_TCX_RES_Q_SPEC + resQBits = tcx_res_Q_spec_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx ); +#else resQBits = tcx_res_Q_spec_ivas_fx( x_orig_fx, x_orig_e, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, sqQ + L_spec, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx ); +#endif } } } diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 39748c73c49f8dd0e039da3ec0cc4ffe00112ad4..fc3c7928c2cbb4bf573d19419ebef5ae495af60a 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -1351,6 +1351,7 @@ Word16 tcx_res_Q_spec_fx( Word16 sq_round, const Word16 lf_deemph_factors[] ); +#ifndef HARM_2454_TCX_RES_Q_SPEC Word16 tcx_res_Q_spec_ivas_fx( Word32 *x_orig, Word16 x_orig_e, @@ -1364,7 +1365,7 @@ Word16 tcx_res_Q_spec_ivas_fx( Word16 bits, Word16 sq_round, const Word16 lf_deemph_factors[] ); - +#endif /* compute noise-measure flags for spectrum filling and quantization (0: tonal, 1: noise-like) */ void ComputeSpectrumNoiseMeasure_fx( const Word32 *powerSpec, diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 01fe7c1d58ac2f582c47b089761708bf8ade47fc..1ada17a8f538da95f1d1486180467732134ddce6 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3388,6 +3388,7 @@ Word16 tcx_res_Q_gain_fx( return bits; } +#ifndef HARM_2454_TCX_RES_Q_SPEC Word16 tcx_res_Q_spec_fx( Word32 *x_orig, Word16 x_orig_e, @@ -3568,6 +3569,9 @@ Word16 tcx_res_Q_spec_fx( Word16 tcx_res_Q_spec_ivas_fx( +#else +Word16 tcx_res_Q_spec_fx( +#endif Word32 *x_orig, Word16 x_orig_e, Word32 *x_Q,