diff --git a/lib_com/options.h b/lib_com/options.h index 61a3c10ccfc2662a6854e6d6fc182f24dde9d839..954f24ce4e8160baed4cd2562a3c925c6cc5571c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -87,6 +87,7 @@ #define FIX_2388_INITTNSCONFIGURATION /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */ #define FIX_2397_COPY_AQ_MDCT_CORE_BFI /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */ #define HARMONIZE_TBE /* VA: harmonize core-coder TBE function duplications */ +#define FIX_2387_ANALYZEPOWERSPECTRUM /* FhG: harmonize AnalyzePowerSpectrum_fx() and AnalyzePowerSpectrum_ivas_fx() */ #define FIX_2405_HARM_SMC_INIT /* VA, basop 2405, harmonisation of SMC init */ #define FIX_2280_REDUCTION_UNNECESSARY_SCALING /* VA: reduction of unnecessary scaling */ #define FIX_2280_REDUCTION_UNNECESSARY_SCALING_NONBE /* VA: reduction of unnecessary scaling, non-BE part */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index d2dd0bf03f841acdada0a5f3f5d395ec07fb083f..feac17912ce62d0ad5cab0a9083fb189dd4bcfb3 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -3833,7 +3833,18 @@ void coder_tcx_fx( pWinMDST = win; move16(); } - +#ifdef FIX_2387_ANALYZEPOWERSPECTRUM + AnalyzePowerSpectrum_ivas_fx( st, + round_fx( L_shl( Mpy_32_16_1( L_mult0( L_frame, st->L_frame ) /*Q0*/, + getInvFrameLen( hTcxEnc->L_frameTCX ) /*Q21*/ ) /*Q6*/, + 16 - 6 ) ), + L_frame, + left_overlap, right_overlap, + spectrum, *spectrum_e, + pWinMDST, + 16 - *spectrum_e, + powerSpec, &powerSpec_e ); +#else AnalyzePowerSpectrum_fx( st, round_fx( L_shl( Mpy_32_16_1( L_mult0( L_frame, st->L_frame ) /*Q0*/, getInvFrameLen( hTcxEnc->L_frameTCX ) /*Q21*/ ) /*Q6*/, @@ -3843,6 +3854,7 @@ void coder_tcx_fx( spectrum, *spectrum_e, pWinMDST, powerSpec, &powerSpec_e ); +#endif IF( hTcxCfg->fIsTNSAllowed != 0 ) { diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index 33181714765ea239bdf078dacdcc47392a934156..3a45821520d9d24cb16466277148399677475ca8 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -395,9 +395,15 @@ void core_signal_analysis_high_bitrate_fx( } /* Compute noise-measure flags for spectrum filling and quantization */ +#ifdef FIX_2387_ANALYZEPOWERSPECTRUM + AnalyzePowerSpectrum_ivas_fx( st, div_l( L_mult( L_subframe, st->L_frame ), hTcxEnc->L_frameTCX ), + L_subframe, left_overlap, right_overlap, spectrum[frameno], spectrum_e[frameno], + pMdstWin, 16 - spectrum_e[frameno], powerSpec, &powerSpec_e ); +#else AnalyzePowerSpectrum_fx( st, div_l( L_mult( L_subframe, st->L_frame ), hTcxEnc->L_frameTCX ), L_subframe, left_overlap, right_overlap, spectrum[frameno], spectrum_e[frameno], pMdstWin, powerSpec, &powerSpec_e ); +#endif } } } diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 9765655ba4d880bab90ca7e255273a39d60d3b79..98df09a3d2bd69a1a0d4326f9e0c74bc667c5426 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -316,6 +316,7 @@ static void detectLowpassFac( const Word32 *powerSpec, Word16 powerSpec_e, Word1 move16(); } +#ifndef FIX_2387_ANALYZEPOWERSPECTRUM /*-----------------------------------------------------------* * Compute noise-measure flags for spectrum filling * * and quantization (0: tonal, 1: noise-like). * @@ -426,6 +427,7 @@ void AnalyzePowerSpectrum_fx( move16(); } } +#endif /* FIX_2387_ANALYZEPOWERSPECTRUM */ void AnalyzePowerSpectrum_ivas_fx( Encoder_State *st, /* i/o: encoder states */