FPCM IFPCMFactory.GetZeroedGlobalFPCM(int samples, int start, int size) { FPCM fpcm = this.GetFPCM(samples); fpcm.Zero(start, size); return(fpcm); }
unsafe public override void AccumulateImpl(float *data, int start, int size, int prefBuffSz, FPCMFactoryGenLimit pcmFactory) { if (this.batch.Length == 0) { return; } float inv = 1.0f / this.batch.Length; FPCM fpcm = null; foreach (GenBase gb in this.batch) { if (fpcm == null) { fpcm = pcmFactory.GetZeroedFPCM(start, size); } else { fpcm.Zero(start, size); } float [] rf = fpcm.buffer; fixed(float *prf = rf) { gb.Accumulate(prf, start, size, prefBuffSz, pcmFactory); for (int i = start; i < start + size; ++i) { data[i] += prf[i] * inv; } } } }
FPCM IFPCMFactory.GetGlobalFPCM(int samples, bool zero) { FPCM fpcm = this.GetFPCM(samples); if (zero == true) { fpcm.Zero(); } return(fpcm); }