| 1 | /******************************************************************** |
| 2 | * * |
| 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * |
| 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
| 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
| 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
| 7 | * * |
| 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * |
| 9 | * by the Xiph.Org Foundation https://xiph.org/ * |
| 10 | * * |
| 11 | ******************************************************************** |
| 12 | |
| 13 | function: *unnormalized* fft transform |
| 14 | |
| 15 | ********************************************************************/ |
| 16 | |
| 17 | /* FFT implementation from OggSquish, minus cosine transforms, |
| 18 | * minus all but radix 2/4 case. In Vorbis we only need this |
| 19 | * cut-down version. |
| 20 | * |
| 21 | * To do more than just power-of-two sized vectors, see the full |
| 22 | * version I wrote for NetLib. |
| 23 | * |
| 24 | * Note that the packing is a little strange; rather than the FFT r/i |
| 25 | * packing following R_0, I_n, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, |
| 26 | * it follows R_0, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, I_n like the |
| 27 | * FORTRAN version |
| 28 | */ |
| 29 | |
| 30 | #include "vorbis_smallft.h"cxx . . $ `<file>/external/vorbis/vorbis_smallft.h`/ |
| 31 | #include "vorbis_os.h"cxx . . $ `<file>/external/vorbis/vorbis_os.h`/ |
| 32 | #include "vorbis_misc.h"cxx . . $ `<file>/external/vorbis/vorbis_misc.h`/ |
| 33 | |
| 34 | static void drfti1cxx . . $ drfti1(7f0b50ce5e93e2bf).(int n, float *wa, int *ifac){ |
| 35 | static int ntryh[4] = { 4,2,3,5 }; |
| 36 | static float tpi = 6.28318530717958648f; |
| 37 | float arg,argh,argld,fi; |
| 38 | int ntry=0,i,j=-1; |
| 39 | int k1, l1, l2, ib; |
| 40 | int ld, ii, ip, is, nq, nr; |
| 41 | int ido, ipm, nfm1; |
| 42 | int nl=n; |
| 43 | int nf=0; |
| 44 | |
| 45 | L101: |
| 46 | j++; |
| 47 | if (j < 4) |
| 48 | ntry=ntryh[j]; |
| 49 | else |
| 50 | ntry+=2; |
| 51 | |
| 52 | L104: |
| 53 | nq=nl/ntry; |
| 54 | nr=nl-ntry*nq; |
| 55 | if (nr!=0) goto L101; |
| 56 | |
| 57 | nf++; |
| 58 | ifac[nf+1]=ntry; |
| 59 | nl=nq; |
| 60 | if(ntry!=2)goto L107; |
| 61 | if(nf==1)goto L107; |
| 62 | |
| 63 | for (i=1;i<nf;i++){ |
| 64 | ib=nf-i+1; |
| 65 | ifac[ib+1]=ifac[ib]; |
| 66 | } |
| 67 | ifac[2] = 2; |
| 68 | |
| 69 | L107: |
| 70 | if(nl!=1)goto L104; |
| 71 | ifac[0]=n; |
| 72 | ifac[1]=nf; |
| 73 | argh=tpi/n; |
| 74 | is=0; |
| 75 | nfm1=nf-1; |
| 76 | l1=1; |
| 77 | |
| 78 | if(nfm1==0)return; |
| 79 | |
| 80 | for (k1=0;k1<nfm1;k1++){ |
| 81 | ip=ifac[k1+2]; |
| 82 | ld=0; |
| 83 | l2=l1*ip; |
| 84 | ido=n/l2; |
| 85 | ipm=ip-1; |
| 86 | |
| 87 | for (j=0;j<ipm;j++){ |
| 88 | ld+=l1; |
| 89 | i=is; |
| 90 | argld=(float)ld*argh; |
| 91 | fi=0.f; |
| 92 | for (ii=2;ii<ido;ii+=2){ |
| 93 | fi+=1.f; |
| 94 | arg=fi*argld; |
| 95 | wa[i++]=coscxx . . $ cos(fbcf3211dfe1bfd1).(arg); |
| 96 | wa[i++]=sincxx . . $ sin(fbcf3211dfe1bfd1).(arg); |
| 97 | } |
| 98 | is+=ido; |
| 99 | } |
| 100 | l1=l2; |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | static void fdrffticxx . . $ fdrffti(7f0b50ce5e93e2bf).(int n, float *wsave, int *ifac){ |
| 105 | |
| 106 | if (n == 1) return; |
| 107 | drfti1cxx . . $ drfti1(7f0b50ce5e93e2bf).(n, wsave+n, ifac); |
| 108 | } |
| 109 | |
| 110 | static void dradf2cxx . . $ dradf2(316126486be241a9).(int ido,int l1,float *cc,float *ch,float *wa1){ |
| 111 | int i,k; |
| 112 | float ti2,tr2; |
| 113 | int t0,t1,t2,t3,t4,t5,t6; |
| 114 | |
| 115 | t1=0; |
| 116 | t0=(t2=l1*ido); |
| 117 | t3=ido<<1; |
| 118 | for(k=0;k<l1;k++){ |
| 119 | ch[t1<<1]=cc[t1]+cc[t2]; |
| 120 | ch[(t1<<1)+t3-1]=cc[t1]-cc[t2]; |
| 121 | t1+=ido; |
| 122 | t2+=ido; |
| 123 | } |
| 124 | |
| 125 | if(ido<2)return; |
| 126 | if(ido==2)goto L105; |
| 127 | |
| 128 | t1=0; |
| 129 | t2=t0; |
| 130 | for(k=0;k<l1;k++){ |
| 131 | t3=t2; |
| 132 | t4=(t1<<1)+(ido<<1); |
| 133 | t5=t1; |
| 134 | t6=t1+t1; |
| 135 | for(i=2;i<ido;i+=2){ |
| 136 | t3+=2; |
| 137 | t4-=2; |
| 138 | t5+=2; |
| 139 | t6+=2; |
| 140 | tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3]; |
| 141 | ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1]; |
| 142 | ch[t6]=cc[t5]+ti2; |
| 143 | ch[t4]=ti2-cc[t5]; |
| 144 | ch[t6-1]=cc[t5-1]+tr2; |
| 145 | ch[t4-1]=cc[t5-1]-tr2; |
| 146 | } |
| 147 | t1+=ido; |
| 148 | t2+=ido; |
| 149 | } |
| 150 | |
| 151 | if(ido%2==1)return; |
| 152 | |
| 153 | L105: |
| 154 | t3=(t2=(t1=ido)-1); |
| 155 | t2+=t0; |
| 156 | for(k=0;k<l1;k++){ |
| 157 | ch[t1]=-cc[t2]; |
| 158 | ch[t1-1]=cc[t3]; |
| 159 | t1+=ido<<1; |
| 160 | t2+=ido; |
| 161 | t3+=ido; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | static void dradf4cxx . . $ dradf4(426e437cf5453b78).(int ido,int l1,float *cc,float *ch,float *wa1, |
| 166 | float *wa2,float *wa3){ |
| 167 | static float hsqt2 = .70710678118654752f; |
| 168 | int i,k,t0,t1,t2,t3,t4,t5,t6; |
| 169 | float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4; |
| 170 | t0=l1*ido; |
| 171 | |
| 172 | t1=t0; |
| 173 | t4=t1<<1; |
| 174 | t2=t1+(t1<<1); |
| 175 | t3=0; |
| 176 | |
| 177 | for(k=0;k<l1;k++){ |
| 178 | tr1=cc[t1]+cc[t2]; |
| 179 | tr2=cc[t3]+cc[t4]; |
| 180 | |
| 181 | ch[t5=t3<<2]=tr1+tr2; |
| 182 | ch[(ido<<2)+t5-1]=tr2-tr1; |
| 183 | ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4]; |
| 184 | ch[t5]=cc[t2]-cc[t1]; |
| 185 | |
| 186 | t1+=ido; |
| 187 | t2+=ido; |
| 188 | t3+=ido; |
| 189 | t4+=ido; |
| 190 | } |
| 191 | |
| 192 | if(ido<2)return; |
| 193 | if(ido==2)goto L105; |
| 194 | |
| 195 | |
| 196 | t1=0; |
| 197 | for(k=0;k<l1;k++){ |
| 198 | t2=t1; |
| 199 | t4=t1<<2; |
| 200 | t5=(t6=ido<<1)+t4; |
| 201 | for(i=2;i<ido;i+=2){ |
| 202 | t3=(t2+=2); |
| 203 | t4+=2; |
| 204 | t5-=2; |
| 205 | |
| 206 | t3+=t0; |
| 207 | cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3]; |
| 208 | ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1]; |
| 209 | t3+=t0; |
| 210 | cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3]; |
| 211 | ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1]; |
| 212 | t3+=t0; |
| 213 | cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3]; |
| 214 | ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1]; |
| 215 | |
| 216 | tr1=cr2+cr4; |
| 217 | tr4=cr4-cr2; |
| 218 | ti1=ci2+ci4; |
| 219 | ti4=ci2-ci4; |
| 220 | |
| 221 | ti2=cc[t2]+ci3; |
| 222 | ti3=cc[t2]-ci3; |
| 223 | tr2=cc[t2-1]+cr3; |
| 224 | tr3=cc[t2-1]-cr3; |
| 225 | |
| 226 | ch[t4-1]=tr1+tr2; |
| 227 | ch[t4]=ti1+ti2; |
| 228 | |
| 229 | ch[t5-1]=tr3-ti4; |
| 230 | ch[t5]=tr4-ti3; |
| 231 | |
| 232 | ch[t4+t6-1]=ti4+tr3; |
| 233 | ch[t4+t6]=tr4+ti3; |
| 234 | |
| 235 | ch[t5+t6-1]=tr2-tr1; |
| 236 | ch[t5+t6]=ti1-ti2; |
| 237 | } |
| 238 | t1+=ido; |
| 239 | } |
| 240 | if(ido&1)return; |
| 241 | |
| 242 | L105: |
| 243 | |
| 244 | t2=(t1=t0+ido-1)+(t0<<1); |
| 245 | t3=ido<<2; |
| 246 | t4=ido; |
| 247 | t5=ido<<1; |
| 248 | t6=ido; |
| 249 | |
| 250 | for(k=0;k<l1;k++){ |
| 251 | ti1=-hsqt2*(cc[t1]+cc[t2]); |
| 252 | tr1=hsqt2*(cc[t1]-cc[t2]); |
| 253 | |
| 254 | ch[t4-1]=tr1+cc[t6-1]; |
| 255 | ch[t4+t5-1]=cc[t6-1]-tr1; |
| 256 | |
| 257 | ch[t4]=ti1-cc[t1+t0]; |
| 258 | ch[t4+t5]=ti1+cc[t1+t0]; |
| 259 | |
| 260 | t1+=ido; |
| 261 | t2+=ido; |
| 262 | t4+=t3; |
| 263 | t6+=ido; |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | static void dradfgcxx . . $ dradfg(fff473e644e84730).(int ido,int ip,int l1,int idl1,float *cc,float *c1, |
| 268 | float *c2,float *ch,float *ch2,float *wa){ |
| 269 | |
| 270 | static float tpi=6.283185307179586f; |
| 271 | int idij,ipph,i,j,k,l,ic,ik,is; |
| 272 | int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; |
| 273 | float dc2,ai1,ai2,ar1,ar2,ds2; |
| 274 | int nbd; |
| 275 | float dcp,arg,dsp,ar1h,ar2h; |
| 276 | int idp2,ipp2; |
| 277 | |
| 278 | arg=tpi/(float)ip; |
| 279 | dcp=coscxx . . $ cos(fbcf3211dfe1bfd1).(arg); |
| 280 | dsp=sincxx . . $ sin(fbcf3211dfe1bfd1).(arg); |
| 281 | ipph=(ip+1)>>1; |
| 282 | ipp2=ip; |
| 283 | idp2=ido; |
| 284 | nbd=(ido-1)>>1; |
| 285 | t0=l1*ido; |
| 286 | t10=ip*ido; |
| 287 | |
| 288 | if(ido==1)goto L119; |
| 289 | for(ik=0;ik<idl1;ik++)ch2[ik]=c2[ik]; |
| 290 | |
| 291 | t1=0; |
| 292 | for(j=1;j<ip;j++){ |
| 293 | t1+=t0; |
| 294 | t2=t1; |
| 295 | for(k=0;k<l1;k++){ |
| 296 | ch[t2]=c1[t2]; |
| 297 | t2+=ido; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | is=-ido; |
| 302 | t1=0; |
| 303 | if(nbd>l1){ |
| 304 | for(j=1;j<ip;j++){ |
| 305 | t1+=t0; |
| 306 | is+=ido; |
| 307 | t2= -ido+t1; |
| 308 | for(k=0;k<l1;k++){ |
| 309 | idij=is-1; |
| 310 | t2+=ido; |
| 311 | t3=t2; |
| 312 | for(i=2;i<ido;i+=2){ |
| 313 | idij+=2; |
| 314 | t3+=2; |
| 315 | ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3]; |
| 316 | ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1]; |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | }else{ |
| 321 | |
| 322 | for(j=1;j<ip;j++){ |
| 323 | is+=ido; |
| 324 | idij=is-1; |
| 325 | t1+=t0; |
| 326 | t2=t1; |
| 327 | for(i=2;i<ido;i+=2){ |
| 328 | idij+=2; |
| 329 | t2+=2; |
| 330 | t3=t2; |
| 331 | for(k=0;k<l1;k++){ |
| 332 | ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3]; |
| 333 | ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1]; |
| 334 | t3+=ido; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | t1=0; |
| 341 | t2=ipp2*t0; |
| 342 | if(nbd<l1){ |
| 343 | for(j=1;j<ipph;j++){ |
| 344 | t1+=t0; |
| 345 | t2-=t0; |
| 346 | t3=t1; |
| 347 | t4=t2; |
| 348 | for(i=2;i<ido;i+=2){ |
| 349 | t3+=2; |
| 350 | t4+=2; |
| 351 | t5=t3-ido; |
| 352 | t6=t4-ido; |
| 353 | for(k=0;k<l1;k++){ |
| 354 | t5+=ido; |
| 355 | t6+=ido; |
| 356 | c1[t5-1]=ch[t5-1]+ch[t6-1]; |
| 357 | c1[t6-1]=ch[t5]-ch[t6]; |
| 358 | c1[t5]=ch[t5]+ch[t6]; |
| 359 | c1[t6]=ch[t6-1]-ch[t5-1]; |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | }else{ |
| 364 | for(j=1;j<ipph;j++){ |
| 365 | t1+=t0; |
| 366 | t2-=t0; |
| 367 | t3=t1; |
| 368 | t4=t2; |
| 369 | for(k=0;k<l1;k++){ |
| 370 | t5=t3; |
| 371 | t6=t4; |
| 372 | for(i=2;i<ido;i+=2){ |
| 373 | t5+=2; |
| 374 | t6+=2; |
| 375 | c1[t5-1]=ch[t5-1]+ch[t6-1]; |
| 376 | c1[t6-1]=ch[t5]-ch[t6]; |
| 377 | c1[t5]=ch[t5]+ch[t6]; |
| 378 | c1[t6]=ch[t6-1]-ch[t5-1]; |
| 379 | } |
| 380 | t3+=ido; |
| 381 | t4+=ido; |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | L119: |
| 387 | for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik]; |
| 388 | |
| 389 | t1=0; |
| 390 | t2=ipp2*idl1; |
| 391 | for(j=1;j<ipph;j++){ |
| 392 | t1+=t0; |
| 393 | t2-=t0; |
| 394 | t3=t1-ido; |
| 395 | t4=t2-ido; |
| 396 | for(k=0;k<l1;k++){ |
| 397 | t3+=ido; |
| 398 | t4+=ido; |
| 399 | c1[t3]=ch[t3]+ch[t4]; |
| 400 | c1[t4]=ch[t4]-ch[t3]; |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | ar1=1.f; |
| 405 | ai1=0.f; |
| 406 | t1=0; |
| 407 | t2=ipp2*idl1; |
| 408 | t3=(ip-1)*idl1; |
| 409 | for(l=1;l<ipph;l++){ |
| 410 | t1+=idl1; |
| 411 | t2-=idl1; |
| 412 | ar1h=dcp*ar1-dsp*ai1; |
| 413 | ai1=dcp*ai1+dsp*ar1; |
| 414 | ar1=ar1h; |
| 415 | t4=t1; |
| 416 | t5=t2; |
| 417 | t6=t3; |
| 418 | t7=idl1; |
| 419 | |
| 420 | for(ik=0;ik<idl1;ik++){ |
| 421 | ch2[t4++]=c2[ik]+ar1*c2[t7++]; |
| 422 | ch2[t5++]=ai1*c2[t6++]; |
| 423 | } |
| 424 | |
| 425 | dc2=ar1; |
| 426 | ds2=ai1; |
| 427 | ar2=ar1; |
| 428 | ai2=ai1; |
| 429 | |
| 430 | t4=idl1; |
| 431 | t5=(ipp2-1)*idl1; |
| 432 | for(j=2;j<ipph;j++){ |
| 433 | t4+=idl1; |
| 434 | t5-=idl1; |
| 435 | |
| 436 | ar2h=dc2*ar2-ds2*ai2; |
| 437 | ai2=dc2*ai2+ds2*ar2; |
| 438 | ar2=ar2h; |
| 439 | |
| 440 | t6=t1; |
| 441 | t7=t2; |
| 442 | t8=t4; |
| 443 | t9=t5; |
| 444 | for(ik=0;ik<idl1;ik++){ |
| 445 | ch2[t6++]+=ar2*c2[t8++]; |
| 446 | ch2[t7++]+=ai2*c2[t9++]; |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | t1=0; |
| 452 | for(j=1;j<ipph;j++){ |
| 453 | t1+=idl1; |
| 454 | t2=t1; |
| 455 | for(ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++]; |
| 456 | } |
| 457 | |
| 458 | if(ido<l1)goto L132; |
| 459 | |
| 460 | t1=0; |
| 461 | t2=0; |
| 462 | for(k=0;k<l1;k++){ |
| 463 | t3=t1; |
| 464 | t4=t2; |
| 465 | for(i=0;i<ido;i++)cc[t4++]=ch[t3++]; |
| 466 | t1+=ido; |
| 467 | t2+=t10; |
| 468 | } |
| 469 | |
| 470 | goto L135; |
| 471 | |
| 472 | L132: |
| 473 | for(i=0;i<ido;i++){ |
| 474 | t1=i; |
| 475 | t2=i; |
| 476 | for(k=0;k<l1;k++){ |
| 477 | cc[t2]=ch[t1]; |
| 478 | t1+=ido; |
| 479 | t2+=t10; |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | L135: |
| 484 | t1=0; |
| 485 | t2=ido<<1; |
| 486 | t3=0; |
| 487 | t4=ipp2*t0; |
| 488 | for(j=1;j<ipph;j++){ |
| 489 | |
| 490 | t1+=t2; |
| 491 | t3+=t0; |
| 492 | t4-=t0; |
| 493 | |
| 494 | t5=t1; |
| 495 | t6=t3; |
| 496 | t7=t4; |
| 497 | |
| 498 | for(k=0;k<l1;k++){ |
| 499 | cc[t5-1]=ch[t6]; |
| 500 | cc[t5]=ch[t7]; |
| 501 | t5+=t10; |
| 502 | t6+=ido; |
| 503 | t7+=ido; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | if(ido==1)return; |
| 508 | if(nbd<l1)goto L141; |
| 509 | |
| 510 | t1=-ido; |
| 511 | t3=0; |
| 512 | t4=0; |
| 513 | t5=ipp2*t0; |
| 514 | for(j=1;j<ipph;j++){ |
| 515 | t1+=t2; |
| 516 | t3+=t2; |
| 517 | t4+=t0; |
| 518 | t5-=t0; |
| 519 | t6=t1; |
| 520 | t7=t3; |
| 521 | t8=t4; |
| 522 | t9=t5; |
| 523 | for(k=0;k<l1;k++){ |
| 524 | for(i=2;i<ido;i+=2){ |
| 525 | ic=idp2-i; |
| 526 | cc[i+t7-1]=ch[i+t8-1]+ch[i+t9-1]; |
| 527 | cc[ic+t6-1]=ch[i+t8-1]-ch[i+t9-1]; |
| 528 | cc[i+t7]=ch[i+t8]+ch[i+t9]; |
| 529 | cc[ic+t6]=ch[i+t9]-ch[i+t8]; |
| 530 | } |
| 531 | t6+=t10; |
| 532 | t7+=t10; |
| 533 | t8+=ido; |
| 534 | t9+=ido; |
| 535 | } |
| 536 | } |
| 537 | return; |
| 538 | |
| 539 | L141: |
| 540 | |
| 541 | t1=-ido; |
| 542 | t3=0; |
| 543 | t4=0; |
| 544 | t5=ipp2*t0; |
| 545 | for(j=1;j<ipph;j++){ |
| 546 | t1+=t2; |
| 547 | t3+=t2; |
| 548 | t4+=t0; |
| 549 | t5-=t0; |
| 550 | for(i=2;i<ido;i+=2){ |
| 551 | t6=idp2+t1-i; |
| 552 | t7=i+t3; |
| 553 | t8=i+t4; |
| 554 | t9=i+t5; |
| 555 | for(k=0;k<l1;k++){ |
| 556 | cc[t7-1]=ch[t8-1]+ch[t9-1]; |
| 557 | cc[t6-1]=ch[t8-1]-ch[t9-1]; |
| 558 | cc[t7]=ch[t8]+ch[t9]; |
| 559 | cc[t6]=ch[t9]-ch[t8]; |
| 560 | t6+=t10; |
| 561 | t7+=t10; |
| 562 | t8+=ido; |
| 563 | t9+=ido; |
| 564 | } |
| 565 | } |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | static void drftf1cxx . . $ drftf1(d85715335264d1b2).(int n,float *c,float *ch,float *wa,int *ifac){ |
| 570 | int i,k1,l1,l2; |
| 571 | int na,kh,nf; |
| 572 | int ip,iw,ido,idl1,ix2,ix3; |
| 573 | |
| 574 | nf=ifac[1]; |
| 575 | na=1; |
| 576 | l2=n; |
| 577 | iw=n; |
| 578 | |
| 579 | for(k1=0;k1<nf;k1++){ |
| 580 | kh=nf-k1; |
| 581 | ip=ifac[kh+1]; |
| 582 | l1=l2/ip; |
| 583 | ido=n/l2; |
| 584 | idl1=ido*l1; |
| 585 | iw-=(ip-1)*ido; |
| 586 | na=1-na; |
| 587 | |
| 588 | if(ip!=4)goto L102; |
| 589 | |
| 590 | ix2=iw+ido; |
| 591 | ix3=ix2+ido; |
| 592 | if(na!=0) |
| 593 | dradf4cxx . . $ dradf4(426e437cf5453b78).(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1); |
| 594 | else |
| 595 | dradf4cxx . . $ dradf4(426e437cf5453b78).(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1); |
| 596 | goto L110; |
| 597 | |
| 598 | L102: |
| 599 | if(ip!=2)goto L104; |
| 600 | if(na!=0)goto L103; |
| 601 | |
| 602 | dradf2cxx . . $ dradf2(316126486be241a9).(ido,l1,c,ch,wa+iw-1); |
| 603 | goto L110; |
| 604 | |
| 605 | L103: |
| 606 | dradf2cxx . . $ dradf2(316126486be241a9).(ido,l1,ch,c,wa+iw-1); |
| 607 | goto L110; |
| 608 | |
| 609 | L104: |
| 610 | if(ido==1)na=1-na; |
| 611 | if(na!=0)goto L109; |
| 612 | |
| 613 | dradfgcxx . . $ dradfg(fff473e644e84730).(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1); |
| 614 | na=1; |
| 615 | goto L110; |
| 616 | |
| 617 | L109: |
| 618 | dradfgcxx . . $ dradfg(fff473e644e84730).(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1); |
| 619 | na=0; |
| 620 | |
| 621 | L110: |
| 622 | l2=l1; |
| 623 | } |
| 624 | |
| 625 | if(na==1)return; |
| 626 | |
| 627 | for(i=0;i<n;i++)c[i]=ch[i]; |
| 628 | } |
| 629 | |
| 630 | static void dradb2cxx . . $ dradb2(316126486be241a9).(int ido,int l1,float *cc,float *ch,float *wa1){ |
| 631 | int i,k,t0,t1,t2,t3,t4,t5,t6; |
| 632 | float ti2,tr2; |
| 633 | |
| 634 | t0=l1*ido; |
| 635 | |
| 636 | t1=0; |
| 637 | t2=0; |
| 638 | t3=(ido<<1)-1; |
| 639 | for(k=0;k<l1;k++){ |
| 640 | ch[t1]=cc[t2]+cc[t3+t2]; |
| 641 | ch[t1+t0]=cc[t2]-cc[t3+t2]; |
| 642 | t2=(t1+=ido)<<1; |
| 643 | } |
| 644 | |
| 645 | if(ido<2)return; |
| 646 | if(ido==2)goto L105; |
| 647 | |
| 648 | t1=0; |
| 649 | t2=0; |
| 650 | for(k=0;k<l1;k++){ |
| 651 | t3=t1; |
| 652 | t5=(t4=t2)+(ido<<1); |
| 653 | t6=t0+t1; |
| 654 | for(i=2;i<ido;i+=2){ |
| 655 | t3+=2; |
| 656 | t4+=2; |
| 657 | t5-=2; |
| 658 | t6+=2; |
| 659 | ch[t3-1]=cc[t4-1]+cc[t5-1]; |
| 660 | tr2=cc[t4-1]-cc[t5-1]; |
| 661 | ch[t3]=cc[t4]-cc[t5]; |
| 662 | ti2=cc[t4]+cc[t5]; |
| 663 | ch[t6-1]=wa1[i-2]*tr2-wa1[i-1]*ti2; |
| 664 | ch[t6]=wa1[i-2]*ti2+wa1[i-1]*tr2; |
| 665 | } |
| 666 | t2=(t1+=ido)<<1; |
| 667 | } |
| 668 | |
| 669 | if(ido%2==1)return; |
| 670 | |
| 671 | L105: |
| 672 | t1=ido-1; |
| 673 | t2=ido-1; |
| 674 | for(k=0;k<l1;k++){ |
| 675 | ch[t1]=cc[t2]+cc[t2]; |
| 676 | ch[t1+t0]=-(cc[t2+1]+cc[t2+1]); |
| 677 | t1+=ido; |
| 678 | t2+=ido<<1; |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | static void dradb3cxx . . $ dradb3(14a98bcc73aa69c7).(int ido,int l1,float *cc,float *ch,float *wa1, |
| 683 | float *wa2){ |
| 684 | static float taur = -.5f; |
| 685 | static float taui = .8660254037844386f; |
| 686 | int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; |
| 687 | float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2; |
| 688 | t0=l1*ido; |
| 689 | |
| 690 | t1=0; |
| 691 | t2=t0<<1; |
| 692 | t3=ido<<1; |
| 693 | t4=ido+(ido<<1); |
| 694 | t5=0; |
| 695 | for(k=0;k<l1;k++){ |
| 696 | tr2=cc[t3-1]+cc[t3-1]; |
| 697 | cr2=cc[t5]+(taur*tr2); |
| 698 | ch[t1]=cc[t5]+tr2; |
| 699 | ci3=taui*(cc[t3]+cc[t3]); |
| 700 | ch[t1+t0]=cr2-ci3; |
| 701 | ch[t1+t2]=cr2+ci3; |
| 702 | t1+=ido; |
| 703 | t3+=t4; |
| 704 | t5+=t4; |
| 705 | } |
| 706 | |
| 707 | if(ido==1)return; |
| 708 | |
| 709 | t1=0; |
| 710 | t3=ido<<1; |
| 711 | for(k=0;k<l1;k++){ |
| 712 | t7=t1+(t1<<1); |
| 713 | t6=(t5=t7+t3); |
| 714 | t8=t1; |
| 715 | t10=(t9=t1+t0)+t0; |
| 716 | |
| 717 | for(i=2;i<ido;i+=2){ |
| 718 | t5+=2; |
| 719 | t6-=2; |
| 720 | t7+=2; |
| 721 | t8+=2; |
| 722 | t9+=2; |
| 723 | t10+=2; |
| 724 | tr2=cc[t5-1]+cc[t6-1]; |
| 725 | cr2=cc[t7-1]+(taur*tr2); |
| 726 | ch[t8-1]=cc[t7-1]+tr2; |
| 727 | ti2=cc[t5]-cc[t6]; |
| 728 | ci2=cc[t7]+(taur*ti2); |
| 729 | ch[t8]=cc[t7]+ti2; |
| 730 | cr3=taui*(cc[t5-1]-cc[t6-1]); |
| 731 | ci3=taui*(cc[t5]+cc[t6]); |
| 732 | dr2=cr2-ci3; |
| 733 | dr3=cr2+ci3; |
| 734 | di2=ci2+cr3; |
| 735 | di3=ci2-cr3; |
| 736 | ch[t9-1]=wa1[i-2]*dr2-wa1[i-1]*di2; |
| 737 | ch[t9]=wa1[i-2]*di2+wa1[i-1]*dr2; |
| 738 | ch[t10-1]=wa2[i-2]*dr3-wa2[i-1]*di3; |
| 739 | ch[t10]=wa2[i-2]*di3+wa2[i-1]*dr3; |
| 740 | } |
| 741 | t1+=ido; |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | static void dradb4cxx . . $ dradb4(426e437cf5453b78).(int ido,int l1,float *cc,float *ch,float *wa1, |
| 746 | float *wa2,float *wa3){ |
| 747 | static float sqrt2=1.414213562373095f; |
| 748 | int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8; |
| 749 | float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4; |
| 750 | t0=l1*ido; |
| 751 | |
| 752 | t1=0; |
| 753 | t2=ido<<2; |
| 754 | t3=0; |
| 755 | t6=ido<<1; |
| 756 | for(k=0;k<l1;k++){ |
| 757 | t4=t3+t6; |
| 758 | t5=t1; |
| 759 | tr3=cc[t4-1]+cc[t4-1]; |
| 760 | tr4=cc[t4]+cc[t4]; |
| 761 | tr1=cc[t3]-cc[(t4+=t6)-1]; |
| 762 | tr2=cc[t3]+cc[t4-1]; |
| 763 | ch[t5]=tr2+tr3; |
| 764 | ch[t5+=t0]=tr1-tr4; |
| 765 | ch[t5+=t0]=tr2-tr3; |
| 766 | ch[t5+=t0]=tr1+tr4; |
| 767 | t1+=ido; |
| 768 | t3+=t2; |
| 769 | } |
| 770 | |
| 771 | if(ido<2)return; |
| 772 | if(ido==2)goto L105; |
| 773 | |
| 774 | t1=0; |
| 775 | for(k=0;k<l1;k++){ |
| 776 | t5=(t4=(t3=(t2=t1<<2)+t6))+t6; |
| 777 | t7=t1; |
| 778 | for(i=2;i<ido;i+=2){ |
| 779 | t2+=2; |
| 780 | t3+=2; |
| 781 | t4-=2; |
| 782 | t5-=2; |
| 783 | t7+=2; |
| 784 | ti1=cc[t2]+cc[t5]; |
| 785 | ti2=cc[t2]-cc[t5]; |
| 786 | ti3=cc[t3]-cc[t4]; |
| 787 | tr4=cc[t3]+cc[t4]; |
| 788 | tr1=cc[t2-1]-cc[t5-1]; |
| 789 | tr2=cc[t2-1]+cc[t5-1]; |
| 790 | ti4=cc[t3-1]-cc[t4-1]; |
| 791 | tr3=cc[t3-1]+cc[t4-1]; |
| 792 | ch[t7-1]=tr2+tr3; |
| 793 | cr3=tr2-tr3; |
| 794 | ch[t7]=ti2+ti3; |
| 795 | ci3=ti2-ti3; |
| 796 | cr2=tr1-tr4; |
| 797 | cr4=tr1+tr4; |
| 798 | ci2=ti1+ti4; |
| 799 | ci4=ti1-ti4; |
| 800 | |
| 801 | ch[(t8=t7+t0)-1]=wa1[i-2]*cr2-wa1[i-1]*ci2; |
| 802 | ch[t8]=wa1[i-2]*ci2+wa1[i-1]*cr2; |
| 803 | ch[(t8+=t0)-1]=wa2[i-2]*cr3-wa2[i-1]*ci3; |
| 804 | ch[t8]=wa2[i-2]*ci3+wa2[i-1]*cr3; |
| 805 | ch[(t8+=t0)-1]=wa3[i-2]*cr4-wa3[i-1]*ci4; |
| 806 | ch[t8]=wa3[i-2]*ci4+wa3[i-1]*cr4; |
| 807 | } |
| 808 | t1+=ido; |
| 809 | } |
| 810 | |
| 811 | if(ido%2 == 1)return; |
| 812 | |
| 813 | L105: |
| 814 | |
| 815 | t1=ido; |
| 816 | t2=ido<<2; |
| 817 | t3=ido-1; |
| 818 | t4=ido+(ido<<1); |
| 819 | for(k=0;k<l1;k++){ |
| 820 | t5=t3; |
| 821 | ti1=cc[t1]+cc[t4]; |
| 822 | ti2=cc[t4]-cc[t1]; |
| 823 | tr1=cc[t1-1]-cc[t4-1]; |
| 824 | tr2=cc[t1-1]+cc[t4-1]; |
| 825 | ch[t5]=tr2+tr2; |
| 826 | ch[t5+=t0]=sqrt2*(tr1-ti1); |
| 827 | ch[t5+=t0]=ti2+ti2; |
| 828 | ch[t5+=t0]=-sqrt2*(tr1+ti1); |
| 829 | |
| 830 | t3+=ido; |
| 831 | t1+=t2; |
| 832 | t4+=t2; |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | static void dradbgcxx . . $ dradbg(fff473e644e84730).(int ido,int ip,int l1,int idl1,float *cc,float *c1, |
| 837 | float *c2,float *ch,float *ch2,float *wa){ |
| 838 | static float tpi=6.283185307179586f; |
| 839 | int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10, |
| 840 | t11,t12; |
| 841 | float dc2,ai1,ai2,ar1,ar2,ds2; |
| 842 | int nbd; |
| 843 | float dcp,arg,dsp,ar1h,ar2h; |
| 844 | int ipp2; |
| 845 | |
| 846 | t10=ip*ido; |
| 847 | t0=l1*ido; |
| 848 | arg=tpi/(float)ip; |
| 849 | dcp=coscxx . . $ cos(fbcf3211dfe1bfd1).(arg); |
| 850 | dsp=sincxx . . $ sin(fbcf3211dfe1bfd1).(arg); |
| 851 | nbd=(ido-1)>>1; |
| 852 | ipp2=ip; |
| 853 | ipph=(ip+1)>>1; |
| 854 | if(ido<l1)goto L103; |
| 855 | |
| 856 | t1=0; |
| 857 | t2=0; |
| 858 | for(k=0;k<l1;k++){ |
| 859 | t3=t1; |
| 860 | t4=t2; |
| 861 | for(i=0;i<ido;i++){ |
| 862 | ch[t3]=cc[t4]; |
| 863 | t3++; |
| 864 | t4++; |
| 865 | } |
| 866 | t1+=ido; |
| 867 | t2+=t10; |
| 868 | } |
| 869 | goto L106; |
| 870 | |
| 871 | L103: |
| 872 | t1=0; |
| 873 | for(i=0;i<ido;i++){ |
| 874 | t2=t1; |
| 875 | t3=t1; |
| 876 | for(k=0;k<l1;k++){ |
| 877 | ch[t2]=cc[t3]; |
| 878 | t2+=ido; |
| 879 | t3+=t10; |
| 880 | } |
| 881 | t1++; |
| 882 | } |
| 883 | |
| 884 | L106: |
| 885 | t1=0; |
| 886 | t2=ipp2*t0; |
| 887 | t7=(t5=ido<<1); |
| 888 | for(j=1;j<ipph;j++){ |
| 889 | t1+=t0; |
| 890 | t2-=t0; |
| 891 | t3=t1; |
| 892 | t4=t2; |
| 893 | t6=t5; |
| 894 | for(k=0;k<l1;k++){ |
| 895 | ch[t3]=cc[t6-1]+cc[t6-1]; |
| 896 | ch[t4]=cc[t6]+cc[t6]; |
| 897 | t3+=ido; |
| 898 | t4+=ido; |
| 899 | t6+=t10; |
| 900 | } |
| 901 | t5+=t7; |
| 902 | } |
| 903 | |
| 904 | if (ido == 1)goto L116; |
| 905 | if(nbd<l1)goto L112; |
| 906 | |
| 907 | t1=0; |
| 908 | t2=ipp2*t0; |
| 909 | t7=0; |
| 910 | for(j=1;j<ipph;j++){ |
| 911 | t1+=t0; |
| 912 | t2-=t0; |
| 913 | t3=t1; |
| 914 | t4=t2; |
| 915 | |
| 916 | t7+=(ido<<1); |
| 917 | t8=t7; |
| 918 | for(k=0;k<l1;k++){ |
| 919 | t5=t3; |
| 920 | t6=t4; |
| 921 | t9=t8; |
| 922 | t11=t8; |
| 923 | for(i=2;i<ido;i+=2){ |
| 924 | t5+=2; |
| 925 | t6+=2; |
| 926 | t9+=2; |
| 927 | t11-=2; |
| 928 | ch[t5-1]=cc[t9-1]+cc[t11-1]; |
| 929 | ch[t6-1]=cc[t9-1]-cc[t11-1]; |
| 930 | ch[t5]=cc[t9]-cc[t11]; |
| 931 | ch[t6]=cc[t9]+cc[t11]; |
| 932 | } |
| 933 | t3+=ido; |
| 934 | t4+=ido; |
| 935 | t8+=t10; |
| 936 | } |
| 937 | } |
| 938 | goto L116; |
| 939 | |
| 940 | L112: |
| 941 | t1=0; |
| 942 | t2=ipp2*t0; |
| 943 | t7=0; |
| 944 | for(j=1;j<ipph;j++){ |
| 945 | t1+=t0; |
| 946 | t2-=t0; |
| 947 | t3=t1; |
| 948 | t4=t2; |
| 949 | t7+=(ido<<1); |
| 950 | t8=t7; |
| 951 | t9=t7; |
| 952 | for(i=2;i<ido;i+=2){ |
| 953 | t3+=2; |
| 954 | t4+=2; |
| 955 | t8+=2; |
| 956 | t9-=2; |
| 957 | t5=t3; |
| 958 | t6=t4; |
| 959 | t11=t8; |
| 960 | t12=t9; |
| 961 | for(k=0;k<l1;k++){ |
| 962 | ch[t5-1]=cc[t11-1]+cc[t12-1]; |
| 963 | ch[t6-1]=cc[t11-1]-cc[t12-1]; |
| 964 | ch[t5]=cc[t11]-cc[t12]; |
| 965 | ch[t6]=cc[t11]+cc[t12]; |
| 966 | t5+=ido; |
| 967 | t6+=ido; |
| 968 | t11+=t10; |
| 969 | t12+=t10; |
| 970 | } |
| 971 | } |
| 972 | } |
| 973 | |
| 974 | L116: |
| 975 | ar1=1.f; |
| 976 | ai1=0.f; |
| 977 | t1=0; |
| 978 | t9=(t2=ipp2*idl1); |
| 979 | t3=(ip-1)*idl1; |
| 980 | for(l=1;l<ipph;l++){ |
| 981 | t1+=idl1; |
| 982 | t2-=idl1; |
| 983 | |
| 984 | ar1h=dcp*ar1-dsp*ai1; |
| 985 | ai1=dcp*ai1+dsp*ar1; |
| 986 | ar1=ar1h; |
| 987 | t4=t1; |
| 988 | t5=t2; |
| 989 | t6=0; |
| 990 | t7=idl1; |
| 991 | t8=t3; |
| 992 | for(ik=0;ik<idl1;ik++){ |
| 993 | c2[t4++]=ch2[t6++]+ar1*ch2[t7++]; |
| 994 | c2[t5++]=ai1*ch2[t8++]; |
| 995 | } |
| 996 | dc2=ar1; |
| 997 | ds2=ai1; |
| 998 | ar2=ar1; |
| 999 | ai2=ai1; |
| 1000 | |
| 1001 | t6=idl1; |
| 1002 | t7=t9-idl1; |
| 1003 | for(j=2;j<ipph;j++){ |
| 1004 | t6+=idl1; |
| 1005 | t7-=idl1; |
| 1006 | ar2h=dc2*ar2-ds2*ai2; |
| 1007 | ai2=dc2*ai2+ds2*ar2; |
| 1008 | ar2=ar2h; |
| 1009 | t4=t1; |
| 1010 | t5=t2; |
| 1011 | t11=t6; |
| 1012 | t12=t7; |
| 1013 | for(ik=0;ik<idl1;ik++){ |
| 1014 | c2[t4++]+=ar2*ch2[t11++]; |
| 1015 | c2[t5++]+=ai2*ch2[t12++]; |
| 1016 | } |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | t1=0; |
| 1021 | for(j=1;j<ipph;j++){ |
| 1022 | t1+=idl1; |
| 1023 | t2=t1; |
| 1024 | for(ik=0;ik<idl1;ik++)ch2[ik]+=ch2[t2++]; |
| 1025 | } |
| 1026 | |
| 1027 | t1=0; |
| 1028 | t2=ipp2*t0; |
| 1029 | for(j=1;j<ipph;j++){ |
| 1030 | t1+=t0; |
| 1031 | t2-=t0; |
| 1032 | t3=t1; |
| 1033 | t4=t2; |
| 1034 | for(k=0;k<l1;k++){ |
| 1035 | ch[t3]=c1[t3]-c1[t4]; |
| 1036 | ch[t4]=c1[t3]+c1[t4]; |
| 1037 | t3+=ido; |
| 1038 | t4+=ido; |
| 1039 | } |
| 1040 | } |
| 1041 | |
| 1042 | if(ido==1)goto L132; |
| 1043 | if(nbd<l1)goto L128; |
| 1044 | |
| 1045 | t1=0; |
| 1046 | t2=ipp2*t0; |
| 1047 | for(j=1;j<ipph;j++){ |
| 1048 | t1+=t0; |
| 1049 | t2-=t0; |
| 1050 | t3=t1; |
| 1051 | t4=t2; |
| 1052 | for(k=0;k<l1;k++){ |
| 1053 | t5=t3; |
| 1054 | t6=t4; |
| 1055 | for(i=2;i<ido;i+=2){ |
| 1056 | t5+=2; |
| 1057 | t6+=2; |
| 1058 | ch[t5-1]=c1[t5-1]-c1[t6]; |
| 1059 | ch[t6-1]=c1[t5-1]+c1[t6]; |
| 1060 | ch[t5]=c1[t5]+c1[t6-1]; |
| 1061 | ch[t6]=c1[t5]-c1[t6-1]; |
| 1062 | } |
| 1063 | t3+=ido; |
| 1064 | t4+=ido; |
| 1065 | } |
| 1066 | } |
| 1067 | goto L132; |
| 1068 | |
| 1069 | L128: |
| 1070 | t1=0; |
| 1071 | t2=ipp2*t0; |
| 1072 | for(j=1;j<ipph;j++){ |
| 1073 | t1+=t0; |
| 1074 | t2-=t0; |
| 1075 | t3=t1; |
| 1076 | t4=t2; |
| 1077 | for(i=2;i<ido;i+=2){ |
| 1078 | t3+=2; |
| 1079 | t4+=2; |
| 1080 | t5=t3; |
| 1081 | t6=t4; |
| 1082 | for(k=0;k<l1;k++){ |
| 1083 | ch[t5-1]=c1[t5-1]-c1[t6]; |
| 1084 | ch[t6-1]=c1[t5-1]+c1[t6]; |
| 1085 | ch[t5]=c1[t5]+c1[t6-1]; |
| 1086 | ch[t6]=c1[t5]-c1[t6-1]; |
| 1087 | t5+=ido; |
| 1088 | t6+=ido; |
| 1089 | } |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | L132: |
| 1094 | if(ido==1)return; |
| 1095 | |
| 1096 | for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik]; |
| 1097 | |
| 1098 | t1=0; |
| 1099 | for(j=1;j<ip;j++){ |
| 1100 | t2=(t1+=t0); |
| 1101 | for(k=0;k<l1;k++){ |
| 1102 | c1[t2]=ch[t2]; |
| 1103 | t2+=ido; |
| 1104 | } |
| 1105 | } |
| 1106 | |
| 1107 | if(nbd>l1)goto L139; |
| 1108 | |
| 1109 | is= -ido-1; |
| 1110 | t1=0; |
| 1111 | for(j=1;j<ip;j++){ |
| 1112 | is+=ido; |
| 1113 | t1+=t0; |
| 1114 | idij=is; |
| 1115 | t2=t1; |
| 1116 | for(i=2;i<ido;i+=2){ |
| 1117 | t2+=2; |
| 1118 | idij+=2; |
| 1119 | t3=t2; |
| 1120 | for(k=0;k<l1;k++){ |
| 1121 | c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3]; |
| 1122 | c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1]; |
| 1123 | t3+=ido; |
| 1124 | } |
| 1125 | } |
| 1126 | } |
| 1127 | return; |
| 1128 | |
| 1129 | L139: |
| 1130 | is= -ido-1; |
| 1131 | t1=0; |
| 1132 | for(j=1;j<ip;j++){ |
| 1133 | is+=ido; |
| 1134 | t1+=t0; |
| 1135 | t2=t1; |
| 1136 | for(k=0;k<l1;k++){ |
| 1137 | idij=is; |
| 1138 | t3=t2; |
| 1139 | for(i=2;i<ido;i+=2){ |
| 1140 | idij+=2; |
| 1141 | t3+=2; |
| 1142 | c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3]; |
| 1143 | c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1]; |
| 1144 | } |
| 1145 | t2+=ido; |
| 1146 | } |
| 1147 | } |
| 1148 | } |
| 1149 | |
| 1150 | static void drftb1cxx . . $ drftb1(d85715335264d1b2).(int n, float *c, float *ch, float *wa, int *ifac){ |
| 1151 | int i,k1,l1,l2; |
| 1152 | int na; |
| 1153 | int nf,ip,iw,ix2,ix3,ido,idl1; |
| 1154 | |
| 1155 | nf=ifac[1]; |
| 1156 | na=0; |
| 1157 | l1=1; |
| 1158 | iw=1; |
| 1159 | |
| 1160 | for(k1=0;k1<nf;k1++){ |
| 1161 | ip=ifac[k1 + 2]; |
| 1162 | l2=ip*l1; |
| 1163 | ido=n/l2; |
| 1164 | idl1=ido*l1; |
| 1165 | if(ip!=4)goto L103; |
| 1166 | ix2=iw+ido; |
| 1167 | ix3=ix2+ido; |
| 1168 | |
| 1169 | if(na!=0) |
| 1170 | dradb4cxx . . $ dradb4(426e437cf5453b78).(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1); |
| 1171 | else |
| 1172 | dradb4cxx . . $ dradb4(426e437cf5453b78).(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1); |
| 1173 | na=1-na; |
| 1174 | goto L115; |
| 1175 | |
| 1176 | L103: |
| 1177 | if(ip!=2)goto L106; |
| 1178 | |
| 1179 | if(na!=0) |
| 1180 | dradb2cxx . . $ dradb2(316126486be241a9).(ido,l1,ch,c,wa+iw-1); |
| 1181 | else |
| 1182 | dradb2cxx . . $ dradb2(316126486be241a9).(ido,l1,c,ch,wa+iw-1); |
| 1183 | na=1-na; |
| 1184 | goto L115; |
| 1185 | |
| 1186 | L106: |
| 1187 | if(ip!=3)goto L109; |
| 1188 | |
| 1189 | ix2=iw+ido; |
| 1190 | if(na!=0) |
| 1191 | dradb3cxx . . $ dradb3(14a98bcc73aa69c7).(ido,l1,ch,c,wa+iw-1,wa+ix2-1); |
| 1192 | else |
| 1193 | dradb3cxx . . $ dradb3(14a98bcc73aa69c7).(ido,l1,c,ch,wa+iw-1,wa+ix2-1); |
| 1194 | na=1-na; |
| 1195 | goto L115; |
| 1196 | |
| 1197 | L109: |
| 1198 | /* The radix five case can be translated later..... */ |
| 1199 | /* if(ip!=5)goto L112; |
| 1200 | |
| 1201 | ix2=iw+ido; |
| 1202 | ix3=ix2+ido; |
| 1203 | ix4=ix3+ido; |
| 1204 | if(na!=0) |
| 1205 | dradb5(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1); |
| 1206 | else |
| 1207 | dradb5(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1); |
| 1208 | na=1-na; |
| 1209 | goto L115; |
| 1210 | |
| 1211 | L112:*/ |
| 1212 | if(na!=0) |
| 1213 | dradbgcxx . . $ dradbg(fff473e644e84730).(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1); |
| 1214 | else |
| 1215 | dradbgcxx . . $ dradbg(fff473e644e84730).(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1); |
| 1216 | if(ido==1)na=1-na; |
| 1217 | |
| 1218 | L115: |
| 1219 | l1=l2; |
| 1220 | iw+=(ip-1)*ido; |
| 1221 | } |
| 1222 | |
| 1223 | if(na==0)return; |
| 1224 | |
| 1225 | for(i=0;i<n;i++)c[i]=ch[i]; |
| 1226 | } |
| 1227 | |
| 1228 | void drft_forwardcxx . . $ drft_forward(30182bdd78ee8026).(drft_lookupcxx . . $ drft_lookup# *l,float *data){ |
| 1229 | if(l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.==1)return; |
| 1230 | drftf1cxx . . $ drftf1(d85715335264d1b2).(l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.,data,l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache.,l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache.+l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.,l->splitcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#splitcache.); |
| 1231 | } |
| 1232 | |
| 1233 | void drft_backwardcxx . . $ drft_backward(30182bdd78ee8026).(drft_lookupcxx . . $ drft_lookup# *l,float *data){ |
| 1234 | if (l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.==1)return; |
| 1235 | drftb1cxx . . $ drftb1(d85715335264d1b2).(l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.,data,l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache.,l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache.+l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.,l->splitcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#splitcache.); |
| 1236 | } |
| 1237 | |
| 1238 | void drft_initcxx . . $ drft_init(20ab4c45b20a5f46).(drft_lookupcxx . . $ drft_lookup# *l,int n){ |
| 1239 | l->ncxx . . $ $anonymous_type_2066ffd46f28d436_0#n.=n; |
| 1240 | l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache. = (float *) _Melder_calloccxx . . $ _Melder_calloc(d58a73cf1dc24cbb).(3*n,sizeof(*l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache.)); |
| 1241 | l->splitcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#splitcache. = (int *) _Melder_calloccxx . . $ _Melder_calloc(d58a73cf1dc24cbb).(32,sizeof(*l->splitcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#splitcache.)); |
| 1242 | fdrffticxx . . $ fdrffti(7f0b50ce5e93e2bf).(n, l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache., l->splitcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#splitcache.); |
| 1243 | } |
| 1244 | |
| 1245 | void drft_clearcxx . . $ drft_clear(fe3126ea1d6ccb3e).(drft_lookupcxx . . $ drft_lookup# *l){ |
| 1246 | if(l){ |
| 1247 | if(l->trigcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#trigcache.)Melder_freecxx . . $ `melder/melder_alloc.h:38:9`!(l->trigcache); |
| 1248 | if(l->splitcachecxx . . $ $anonymous_type_2066ffd46f28d436_0#splitcache.)Melder_freecxx . . $ `melder/melder_alloc.h:38:9`!(l->splitcache); |
| 1249 | memset(l,0,sizeof(*l)); |
| 1250 | } |
| 1251 | } |