private void applyLtp(SingleChannelElement sce){
  LongTermPrediction ltp=sce.ics.ltp;
  final int offsets[]=sce.ics.swbOffset;
  if (sce.ics.windowSequence[0] != EIGHT_SHORT_SEQUENCE) {
    final float predTime[]=sce.ret;
    final float predFreq[]=ac.bufMdct;
    int numSamples=2048;
    if (ltp.lag < 1024) {
      numSamples=ltp.lag + 1024;
    }
    for (int i=0; i < numSamples; i++) {
      predTime[i]=sce.ltpState[i + 2048 - ltp.lag] * ltp.coef;
    }
    Arrays.fill(predTime,numSamples,2048,0f);
    windowingAndMdctLtp(predFreq,predTime,sce.ics);
    if (sce.tns.present) {
      applyTns(predFreq,sce.tns,sce.ics,false);
    }
    for (int sfb=0; sfb < Math.min(sce.ics.maxSfb,MAX_LTP_LONG_SFB); sfb++) {
      if (ltp.used[sfb]) {
        for (int i=offsets[sfb]; i < offsets[sfb + 1]; i++) {
          sce.coeffs[i]+=predFreq[i];
        }
      }
    }
  }
}

private void applyLtp ( SingleChannelElement sce ) { LongTermPrediction ltp = sce . ics . ltp ; final int offsets [ ] = sce . ics . swbOffset ; if ( sce . ics . windowSequence [ 0 ] != EIGHT_SHORT_SEQUENCE ) { final float predTime [ ] = sce . ret ; final float predFreq [ ] = ac . bufMdct ; int numSamples = 2048 ; if ( ltp . lag < 1024 ) { numSamples = ltp . lag + 1024 ; } for ( int i = 0 ; i < numSamples ; i ++ ) { predTime [ i ] = sce . ltpState [ i + 2048 - ltp . lag ] * ltp . coef ; } Arrays . fill ( predTime , numSamples , 2048 , 0f ) ; windowingAndMdctLtp ( predFreq , predTime , sce . ics ) ; if ( sce . tns . present ) { applyTns ( predFreq , sce . tns , sce . ics , false ) ; } for ( int sfb = 0 ; sfb < Math . min ( sce . ics . maxSfb , MAX_LTP_LONG_SFB ) ; sfb ++ ) { if ( ltp . used [ sfb ] ) { for ( int i = offsets [ sfb ] ; i < offsets [ sfb + 1 ] ; i ++ ) { sce . coeffs [ i ] += predFreq [ i ] ; } } } } }
apply the long term prediction
