/* csvorbis * Copyright (C) 2000 ymnk, JCraft,Inc. * * Written by: 2000 ymnk * Ported to C# from JOrbis by: Mark Crichton * * Thanks go to the JOrbis team, for licencing the code under the * LGPL, making my job a lot easier. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ using System; namespace csvorbis { class Drft { int n; float[] trigcache; int[] splitcache; internal void backward(float[] data) { if(n==1)return; drftb1(n,data,trigcache,trigcache,n,splitcache); } internal void init(int n) { this.n=n; trigcache=new float[3*n]; splitcache=new int[32]; fdrffti(n, trigcache, splitcache); } internal void clear() { if(trigcache!=null)trigcache=null; if(splitcache!=null)splitcache=null; } static int[] ntryh = { 4,2,3,5 }; static float tpi = 6.28318530717958647692528676655900577f; static float hsqt2 = .70710678118654752440084436210485f; static float taui = .86602540378443864676372317075293618f; static float taur = -.5f; static float sqrt2 = 1.4142135623730950488016887242097f; static void drfti1(int n, float[] wa, int index, int[] ifac) { float arg,argh,argld,fi; int ntry=0,i,j=-1; int k1, l1, l2, ib; int ld, ii, ip, iis, nq, nr; int ido, ipm, nfm1; int nl=n; int nf=0; L101: j++; if (j < 4) ntry=ntryh[j]; else ntry+=2; L104: nq=nl/ntry; nr=nl-ntry*nq; if(nr!=0) goto L101; nf++; ifac[nf+1]=ntry; nl=nq; if(ntry!=2) goto L107; if(nf==1) goto L107; for(i=1;i>1; ipp2=ip; idp2=ido; nbd=(ido-1)>>1; t0=l1*ido; t10=ip*ido; if(ido==1) goto L119; for(ik=0;ikl1) { for(j=1;j>1); ipp2=ip; ipph=(int)((uint)(ip+1)>>1); if(idol1) goto L139; iis= -ido-1; t1=0; for(j=1;j