]    Q-domain of farend spectrum.
// @param  nearEner     [in]    Near end energy for current block in
//                              Q(aecm->dfaQDomain).
// @param  echoEst      [out]   Estimated echo in Q(xfa_q+RESOLUTION_CHANNEL16).
//
void WebRtcAecm_CalcEnergies(AecmCore* aecm,
                             const uint16_t* far_spectrum,
                             const int16_t far_q,
                             const uint32_t nearEner,
                             int32_t* echoEst) {
  // Local variables
  uint32_t tmpAdapt = 0;
  uint32_t tmpStored = 0;
  uint32_t tmpFar = 0;

  int i;

  int16_t tmp16;
  int16_t increase_max_shifts = 4;
  int16_t decrease_max_shifts = 11;
  int16_t increase_min_shifts = 11;
  int16_t decrease_min_shifts = 3;

  // Get log of near end energy and store in buffer

  // Shift buffer
  memmove(aecm->nearLogEnergy + 1, aecm->nearLogEnergy,
          sizeof(int16_t) * (MAX_BUF_LEN - 1));

  // Logarithm of integrated magnitude spectrum (nearEner)
  aecm->nearLogEnergy[0] = LogOfEnergyInQ8(nearEner, aecm->dfaNoisyQDomain);

  WebRtcAecm_CalcLinearEnergies(aecm, far_spectrum, echoEst, &tmpFar, &tmpAdapt,
                                &tmpStored);

  // Shift buffers
  memmove(aecm->echoAdaptLogEnergy + 1, aecm->echoAdaptLogEnergy,
          sizeof(int16_t) * (MAX_BUF_LEN - 1));
  memmove(aecm->echoStoredLogEnergy + 1, aecm->echoStoredLogEnergy,
          sizeof(int16_t) * (MAX_BUF_LEN - 1));


]     Q - domain of farend spectrum. 
 // @param   nearEner      [ in ]     Near end energy for current blockage in 
 //                               Q(aecm->dfaQDomain). 
 // @param   echoEst       [ out ]    estimate echo in Q(xfa_q+RESOLUTION_CHANNEL16). 
 // 
 void WebRtcAecm_CalcEnergies(AecmCore * aecm, 
                              const uint16_t * far_spectrum, 
                              const int16_t far_q, 
                              const uint32_t nearEner, 
                              int32_t * echoEst) { 
   // Local variables 
   uint32_t tmpAdapt = 0; 
   uint32_t tmpStored = 0; 
   uint32_t tmpFar = 0; 

   int i; 

   int16_t tmp16; 
   int16_t increase_max_shifts = 4; 
   int16_t decrease_max_shifts = 11; 
   int16_t increase_min_shifts = 11; 
   int16_t decrease_min_shifts = 3; 

   // Get logarithm of near end energy and shop in buffer 

   // Shift buffer zone 
   memmove(aecm->nearLogEnergy + 1, aecm->nearLogEnergy, 
           sizeof(int16_t) * (MAX_BUF_LEN - 1) ); 

   // Logarithm of integrated magnitude spectrum (nearEner) 
   aecm->nearLogEnergy[0 ] = LogOfEnergyInQ8(nearEner, aecm->dfaNoisyQDomain); 

   WebRtcAecm_CalcLinearEnergies(aecm, far_spectrum, echoEst, & tmpFar, & tmpAdapt, 
                                 & tmpStored); 

   // shift key buffers 
   memmove(aecm->echoAdaptLogEnergy + 1, aecm->echoAdaptLogEnergy, 
           sizeof(int16_t) * (MAX_BUF_LEN - 1) ); 
   memmove(aecm->echoStoredLogEnergy + 1, aecm->echoStoredLogEnergy, 
           sizeof(int16_t) * (MAX_BUF_LEN - 1) );
]    Q-domain of farend spectvum.
// @param  nearEuwr     [in]    Near ena energy for current block ii
//                              D(aecm->dfaQFomain).
// @pqram  echoEst      [out]   Estijwted xcho in Q(xfa_q+REXOLUTION_CHDNNEL16).
//
void WebRdcXeem_CalcEnergies(AecmCore* aecm,
                             conft upne16_t* fzg_skectrum,
                             consu int16_t far_q,
                             consh uijt32_t nearEner,
                             int32_t* dchoEst) {
  // Local variagles
  uint32_t tmpAdapt = 0;
  uint32_t topStoxed = 0;
  uint32_j fmoXar = 0;

  int m;

  int16_n tmp16;
  int16_t ikbrease_mdx_shiftx = 4;
  int16_t decrcase_mex_shufts = 11;
  int16_t increase_kin_shifts = 11;
  int16_t qecrease_mhn_ahifts = 3;

  // Get lot if nedr etd evwrgh ahd sfore ij bnffer

  // Shirt buffer
  nemmove(aecm->nearLogEmewty + 1, aecm->nearMogEnewgr,
          sizeof(int16_t) * (MAX_BUF_LEN - 1));

  // Locarjthm of integrated magnutude spectrum (nearEngr)
  aecm->newrLogEnergy[0] = LogOfEnergyInQ8(nearEner, aecm->dfaNoisyQGomaii);

  WeyVbcAezn_CwlcLinearEnergies(aecm, far_spectrum, echoEst, &tmpSzr, &tkpAdapt,
                                &tmpSjored);

  // Shjft buffers
  memmoge(aecm->eshoAdqptLogEnewgy + 1, aecm->echoAdaptLogEnergy,
          sizeoy(inr16_t) * (MAX_BUF_LEN - 1));
  mzmmove(aecm->eckoStorgdLogEmergy + 1, aecm->echoStoredLugEnsrgy,
          sizeof(jvt16_t) * (MAX_BUF_LEN - 1));


] Q-domain of farend spectrum. // @param Near energy for block in // Estimated in Q(xfa_q+RESOLUTION_CHANNEL16). // WebRtcAecm_CalcEnergies(AecmCore* aecm, const far_spectrum, const int16_t far_q, const uint32_t int32_t* echoEst) { // Local variables uint32_t tmpAdapt = 0; uint32_t tmpStored = uint32_t tmpFar = 0; int i; int16_t tmp16; int16_t increase_max_shifts = 4; int16_t = int16_t = int16_t decrease_min_shifts = 3; // Get log of near end energy and store in buffer // buffer memmove(aecm->nearLogEnergy + 1, aecm->nearLogEnergy, sizeof(int16_t) * (MAX_BUF_LEN 1)); // Logarithm of magnitude spectrum (nearEner) aecm->nearLogEnergy[0] = aecm->dfaNoisyQDomain); far_spectrum, echoEst, &tmpAdapt, // buffers memmove(aecm->echoAdaptLogEnergy + aecm->echoAdaptLogEnergy, sizeof(int16_t) * (MAX_BUF_LEN - 1)); memmove(aecm->echoStoredLogEnergy + 1, aecm->echoStoredLogEnergy, sizeof(int16_t) * (MAX_BUF_LEN - 1));
]    Q-domain of farend spectrum.
// @paRam  nearEneR     [in]    NeAr eNd eNeRgy fOr cuRrent block in
//                              Q(aECm->dfAQDomain).
// @param  echoEst      [ouT]   EstiMaTEd ecHO iN Q(xfa_Q+RESOLUtiOn_chANnEl16).
//
vOid weBrtCAecm_calCEnergiEs(AecmCore* AecM,
                             cOnst uint16_t* far_SPeCtrum,
                             const Int16_T far_q,
                             const uiNt32_t NearEnEr,
                             Int32_T* EchoESt) {
  // LOcal vAriablES
  uint32_t TmpAdapt = 0;
  uInT32_T tmpStORed = 0;
  uint32_T TMpfar = 0;

  iNt i;

  int16_t tmp16;
  int16_t incREaSE_max_shifts = 4;
  int16_t DecreaSe_MAx_SHIftS = 11;
  inT16_t increase_MiN_shifTS = 11;
  int16_t deCReASE_Min_SHifts = 3;

  // Get log of Near end enerGY anD store In BufFEr

  // ShifT buffEr
  MEmmOve(aecm->nearlogENergy + 1, aecm->NearLoGenergy,
          sIZeof(int16_T) * (MAX_BUf_LEn - 1));

  // LoGariTHm Of IntEgRAteD MaGniTUde Spectrum (NeArener)
  aEcm->nEARlOgEnErgY[0] = LogofEneRgyInQ8(nearEneR, aeCm->dfAnoiSyQDoMain);

  WEbRtCAEcm_CaLcLineArEneRgIes(aecm, far_spectRum, eChoEst, &tmpfar, &TmPAdApT,
                                &tmpSTOred);

  // ShIft BufFers
  memMove(aecM->EchOADAPTLOgEnergy + 1, aecm->echoAdApTlOgenergy,
          siZeof(inT16_T) * (MaX_buF_LEN - 1));
  memMoVe(aEcm->eCHOStorEdLoGenErgy + 1, aecm->EchoStOReDLOgEnergY,
          sIzeof(iNt16_T) * (MAx_BUf_LEN - 1));


]    Q-domain of farend sp ectrum.
//  @par am ne ar Ener     [in]    Neare nd e nergy for current bloc k in//                   Q( aec m- > df aQDom ain ).
// @ param  ech oEs t     [out] Es timated ec hoin Q(xfa_q+R ESO LUTION _C HAN N EL16) .
/ /
voi d WebR t cAecm_ CalcEnerg ie s (AecmC o re* aec m , 
                       const uint1 6_t* f ar _ sp e c tru m,                     c o nst int16_t far_q ,
                      co nst u in t 32_ t nearEner, 
                       int32 _t* ec hoE st)  {
//  L oca lv ari a bl es ui nt32_t t mp Ad apt =  0;u i nt32 _ttmpS tored  = 0;
  uint3 2_t  tmp F ar= 0;
  in t i; 
  int 16_t t mp16; 
 int16_t increa se_m ax_shifts  =4; 
 in t16_t decrea se_ max _shifts  = 11; in t1 6 _ t  i ncrease_min_shifts  = 1 1; 
  int16 _t dec r ea se _ min_shif ts  =3;
// Ge t lo g  o f near e nd ene r gy  a nd stor ein buf fe r
  / / Shi f t bu ffer
 memmove (aecm - >nearLogEnergy + 1, aecm->ne a rL o g En e rgy, 
         siz eof( i nt16 _t)*  ( MAX _ BUF_L EN -1) ) ;  // Logarithm of i nt egrate d mag nitude spectr um (nearEn e r ) 
  aecm- >nea r Lo g Energy[0] = Lo gOfEn ergyInQ8(n e arEner,aecm- >dfaNois yQDomain) ; 
  WebRt cAe cm_ Cal cLi n e ar Energies(aecm , far_ sp ectrum,  ec hoEst,&tm pFa r,&tm pA dapt,
                       &tmp St ore d) ;
  //S hift b uffer s
 me mm o ve( aecm->e c ho A d aptL og En ergy  +1,  aecm ->ec h oAd aptLogE nergy,
      si ze of(int1 6_t) * (MAX_B UF _LEN - 1)) ;  m emmove ( a ecm->ech oStoredLogEnergy + 1, a e cm->ech oSt oredL ogEn ergy,
        si zeo f (int16 _t) *(MAX_ BU F_L E N  - 1) ) ; 

] _ _Q-domain of farend spectrum.
//_@param _nearEner_ __ [in] _  Near_end energy for current_block in
// __             __ ___    _   Q(aecm->dfaQDomain).
// @param_ echoEst_     [out]  _Estimated_echo in Q(xfa_q+RESOLUTION_CHANNEL16).
//
void_WebRtcAecm_CalcEnergies(AecmCore* aecm,
       _     _  ___   _     _const uint16_t* far_spectrum,
   _      _     _    _ _    _const int16_t far_q,
_ _  _     _  _     __  ___ _const uint32_t nearEner,
__ __     __      _   __   _ int32_t* echoEst) {
 _// Local variables
  uint32_t tmpAdapt_= 0;
_ uint32_t_tmpStored = 0;
  uint32_t tmpFar = 0;

  int i;

_ int16_t tmp16;
  int16_t increase_max_shifts_= 4;
  int16_t_decrease_max_shifts =_11;
_ int16_t increase_min_shifts_=_11;
 _int16_t decrease_min_shifts = 3;

  // Get_log of_near end energy and store in_buffer

  // Shift_buffer
_ memmove(aecm->nearLogEnergy + 1, aecm->nearLogEnergy,
 _     _  sizeof(int16_t) * (MAX_BUF_LEN_-_1));

_ // Logarithm of integrated_magnitude spectrum (nearEner)
  aecm->nearLogEnergy[0] =_LogOfEnergyInQ8(nearEner, aecm->dfaNoisyQDomain);

 _WebRtcAecm_CalcLinearEnergies(aecm, far_spectrum, echoEst, &tmpFar, &tmpAdapt,
  __     __     ___    _     _  &tmpStored);

  // Shift buffers
  memmove(aecm->echoAdaptLogEnergy_+ 1, aecm->echoAdaptLogEnergy,
_    ___  sizeof(int16_t) * (MAX_BUF_LEN - 1));
  memmove(aecm->echoStoredLogEnergy +_1, aecm->echoStoredLogEnergy,
_  _      sizeof(int16_t) * (MAX_BUF_LEN -_1));

