diff --git a/lib_com/options.h b/lib_com/options.h index 7fa610801bd2a2942126d5f7c449a42ed0a3fe3e..e2bfae0d35e41f7734e03e1a74eb27138dd36441 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -103,6 +103,7 @@ #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() */ +#define FIX_FLOAT_1535_ARI_RES_Q_CLEANUP /* FhG: remove dead code from tcx_ari_res_Q_spec() */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 71d22d2a8c85a1b1bfa90e000c0c5ef421651146..12c3dd6d13b7d6634fe2e876eb464ce4079d775a 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -3570,7 +3570,11 @@ void QuantizeTCXSpectrum_fx( prm_resq = sqQ + sub( sqTargetBits, resQTargetBits ); +#ifdef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP + resQBits = tcx_ari_res_Q_spec_fx( x_orig_fx, x_orig_e, hm_cfg->indexBuffer, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, prm_resq, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx ); +#else resQBits = tcx_ari_res_Q_spec_ivas_fx( x_orig_fx, x_orig_e, hm_cfg->indexBuffer, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, prm_resq, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx ); +#endif /* Transmit zeros when there bits remain after RESQ */ FOR( i = resQBits; i < resQTargetBits; ++i ) diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index fc3c7928c2cbb4bf573d19419ebef5ae495af60a..698f1d14054be4f476d3232cee364fa8203ba8ce 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -1313,6 +1313,7 @@ Word16 tcx_ari_res_Q_spec_fx( const Word16 x_fac[] /* i : spectrum post-quantization factors Q14 */ ); +#ifndef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP Word16 tcx_ari_res_Q_spec_ivas_fx( const Word32 x_orig[], /* i : original spectrum Q31-e */ Word16 x_orig_e, /* i : original spectrum exponent Q0 */ @@ -1328,7 +1329,7 @@ Word16 tcx_ari_res_Q_spec_ivas_fx( Word16 deadzone, /* i : quantizer deadzone Q15 */ const Word16 x_fac[] /* i : spectrum post-quantization factors Q14 */ ); - +#endif Word16 tcx_res_Q_gain_fx( Word16 sqGain, Word16 sqGain_e, diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 1ada17a8f538da95f1d1486180467732134ddce6..882c71bc20b6eff362c53d88e7a13c2e422abe65 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -2996,6 +2996,10 @@ Word16 tcx_ari_res_Q_spec_fx( num_zeros = 0; move16(); +#ifdef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP + assert( x_fac != NULL ); +#endif + s = sub( add( gain_e, x_Q_e ), x_orig_e ); FOR( i = 0; i < L_frame; i++ ) { @@ -3097,7 +3101,7 @@ Word16 tcx_ari_res_Q_spec_fx( return bits; } - +#ifndef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP Word16 tcx_ari_res_Q_spec_ivas_fx( const Word32 x_orig[], /* i : original spectrum Q31-e */ Word16 x_orig_e, /* i : original spectrum exponent Q0 */ @@ -3328,7 +3332,7 @@ Word16 tcx_ari_res_Q_spec_ivas_fx( return bits; } - +#endif #define kMaxEstimatorOvershoot 5 #define kMaxEstimatorUndershoot 0