diff --git a/lib_com/cldfb_evs_fx.c b/lib_com/cldfb_evs_fx.c index f319c56fccee7448a030f87e67f05dbc29486a13..2d611b27ef9e811c8264b761cebe6ee89838e7ef 100644 --- a/lib_com/cldfb_evs_fx.c +++ b/lib_com/cldfb_evs_fx.c @@ -1216,25 +1216,36 @@ void analysisCldfbEncoder_fx( &enerScale.lb_scale16 ); /* get the energy */ - GetEnergyCldfb( &st_fx->energyCoreLookahead_Fx, - &st_fx->sf_energyCoreLookahead_Fx, - num_slots, - ppBuf_Real16, - ppBuf_Imag16, - enerScale.lb_scale16, - st_fx->cldfbAnaEnc->no_channels, - st_fx->cldfbAnaEnc->no_col, - &st_fx->currEnergyHF_fx, - &st_fx->currEnergyHF_e_fx, - enerBuffSum, - enerBuffSum_exp, - st_fx->hTECEnc ); +#ifdef HARMONIZE_2564_GetEnergyCldfb + GetEnergyCldfb( + EVS_MONO, +#else + GetEnergyCldfb( +#endif + &st_fx->energyCoreLookahead_Fx, + &st_fx->sf_energyCoreLookahead_Fx, + num_slots, + ppBuf_Real16, + ppBuf_Imag16, + enerScale.lb_scale16, + st_fx->cldfbAnaEnc->no_channels, + st_fx->cldfbAnaEnc->no_col, + &st_fx->currEnergyHF_fx, + &st_fx->currEnergyHF_e_fx, + enerBuffSum, + enerBuffSum_exp, + st_fx->hTECEnc ); return; } +#ifdef HARMONIZE_2564_GetEnergyCldfb +void GetEnergyCldfb( + Word16 element_mode, /*!< i: | Is IVAS or EVS? */ +#else void GetEnergyCldfb( +#endif Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ @@ -1309,7 +1320,15 @@ void GetEnergyCldfb( move16(); energyValuesSum[j] = L_shr_r( energyValuesSum[j], 1 ); move32(); - nrg = L_shr_r( energyValues[k][j], 1 ); +#ifdef HARMONIZE_2564_GetEnergyCldfb + nrg = L_shr_r( nrg, 1 ); + if ( EQ_16( element_mode, EVS_MONO ) ) + { +#endif + nrg = L_shr_r( energyValues[k][j], 1 ); +#ifdef HARMONIZE_2564_GetEnergyCldfb + } +#endif } energyValuesSum[j] = L_add( energyValuesSum[j], nrg ); move32(); diff --git a/lib_com/cldfb_fx.c b/lib_com/cldfb_fx.c index f0c0d815810314a05676293396037a3e71db2ebb..6126a6ee2b6200550a40cfade71d2b58cc9789b7 100644 --- a/lib_com/cldfb_fx.c +++ b/lib_com/cldfb_fx.c @@ -55,6 +55,7 @@ static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ); +#ifndef HARMONIZE_2564_GetEnergyCldfb static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ @@ -68,7 +69,7 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e Word32 *energyValuesSum, /*!< o: Q(2*sf_Values-4) | pointer to sum array of energy values, not initialized*/ Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ TEC_ENC_HANDLE hTecEnc ); - +#endif /*-------------------------------------------------------------------* * cldfbAnalysis_ivas() @@ -1455,7 +1456,7 @@ void resampleCldfb_ivas_fx( return; } - +#ifndef HARMONIZE_2564_GetEnergyCldfb static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ @@ -1614,6 +1615,7 @@ static void GetEnergyCldfb_ivas_fx( *energyHF_Exp = 17; move16(); } +#endif void analysisCldfbEncoder_ivas_fx( @@ -1675,8 +1677,11 @@ void analysisCldfbEncoder_ivas_fx( move16(); AnalysisPostSpectrumScaling_Fx( st->cldfbAnaEnc, ppBuf_Real, ppBuf_Imag, ppBuf_Real16, ppBuf_Imag16, &enerScale.lb_scale16 ); - +#ifdef HARMONIZE_2564_GetEnergyCldfb + GetEnergyCldfb( st->element_mode, &st->energyCoreLookahead_Fx, &st->sf_energyCoreLookahead_Fx, 1, ppBuf_Real16, ppBuf_Imag16, enerScale.lb_scale16, st->cldfbAnaEnc->no_channels, st->cldfbAnaEnc->no_col, &st->currEnergyHF_fx, &st->currEnergyHF_e_fx, ppBuf_Ener, enerBuffSum_exp, st->hTECEnc ); +#else GetEnergyCldfb_ivas_fx( &st->energyCoreLookahead_Fx, &st->sf_energyCoreLookahead_Fx, 1, ppBuf_Real16, ppBuf_Imag16, enerScale.lb_scale16, st->cldfbAnaEnc->no_channels, st->cldfbAnaEnc->no_col, &st->currEnergyHF_fx, &st->currEnergyHF_e_fx, ppBuf_Ener, enerBuffSum_exp, st->hTECEnc ); +#endif return; } diff --git a/lib_com/options.h b/lib_com/options.h index 0d3c1fa93ae22bd5693c752dd96248ce04339906..0af77e89ca45b68c5fe645fcedbced25c785604c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -105,6 +105,7 @@ #define HARMONIZE_2537_SetTCXModeInfo /* FhG: Harmonize SetTCXModeInfo - IVAS_VERSION OBVIOUSLY NOT FITTING FOR EVS - pipes not green */ #define HARMONIZE_2537_GetTCXMaxenergyChange /* FhG: Harmonize GetTCXMaxenergyChange */ #define HARMONIZE_2508_InitTransientDetection /* FhG: harmonize GetAttackForTCXDecision derivates for evs/ivas */ +#define HARMONIZE_2564_GetEnergyCldfb /* FhG: harmonize GetEnergyCldfb derivates for evs/ivas */ #define FIX_BASOP_2555_FRAMELEN_CALC /* FhG: BASOP issue 2555: Simplify (sub-)framelength calculation in ivas_mdct_core_tns_ns_fx() */ #define FIX_BASOP_2095_REMOVE_TABLES_PT01 /* FhG: BASOP issue 2095: remove unused tables, part 01 */ #define FIX_2346_DUPLICATED_IGF_FUNCTIONS_2 /* FhG: part 2 of basop issue 2346: Review potentially duplicated IGF functions */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 347c72941c204b5307c86511ecbbeef7cf1f38fa..420b40463e56fd4c67f6ced83317414d26927b2e 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -4155,7 +4155,12 @@ void analysisCldfbEncoder_fx( Word16 *enerBuffSum_exp, CLDFB_SCALE_FACTOR *scale ); +#ifdef HARMONIZE_2564_GetEnergyCldfb void GetEnergyCldfb( + Word16 element_mode, /*!< i: | Is IVAS or EVS? */ +#else +void GetEnergyCldfb( +#endif Word32 *energyLookahead, /*!< o: Q31 | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot - apply as negative exponent*/ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */