Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: webrtc/common_audio/fft4g.c

Issue 1168753002: Match existing type usage better. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html 2 * http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
3 * Copyright Takuya OOURA, 1996-2001 3 * Copyright Takuya OOURA, 1996-2001
4 * 4 *
5 * You may use, copy, modify and distribute this code for any purpose (include 5 * You may use, copy, modify and distribute this code for any purpose (include
6 * commercial use) and without fee. Please refer to this package when you modify 6 * commercial use) and without fee. Please refer to this package when you modify
7 * this code. 7 * this code.
8 * 8 *
9 * Changes: 9 * Changes:
10 * Trivial type modifications by the WebRTC authors. 10 * Trivial type modifications by the WebRTC authors.
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 641
642 static void makewt(int nw, int *ip, float *w) 642 static void makewt(int nw, int *ip, float *w)
643 { 643 {
644 int j, nwh; 644 int j, nwh;
645 float delta, x, y; 645 float delta, x, y;
646 646
647 ip[0] = nw; 647 ip[0] = nw;
648 ip[1] = 1; 648 ip[1] = 1;
649 if (nw > 2) { 649 if (nw > 2) {
650 nwh = nw >> 1; 650 nwh = nw >> 1;
651 delta = (float)atan(1.0f) / nwh; 651 delta = atanf(1.0f) / nwh;
652 w[0] = 1; 652 w[0] = 1;
653 w[1] = 0; 653 w[1] = 0;
654 w[nwh] = (float)cos(delta * nwh); 654 w[nwh] = (float)cos(delta * nwh);
655 w[nwh + 1] = w[nwh]; 655 w[nwh + 1] = w[nwh];
656 if (nwh > 2) { 656 if (nwh > 2) {
657 for (j = 2; j < nwh; j += 2) { 657 for (j = 2; j < nwh; j += 2) {
658 x = (float)cos(delta * j); 658 x = (float)cos(delta * j);
659 y = (float)sin(delta * j); 659 y = (float)sin(delta * j);
660 w[j] = x; 660 w[j] = x;
661 w[j + 1] = y; 661 w[j + 1] = y;
662 w[nw - j] = y; 662 w[nw - j] = y;
663 w[nw - j + 1] = x; 663 w[nw - j + 1] = x;
664 } 664 }
665 bitrv2(nw, ip + 2, w); 665 bitrv2(nw, ip + 2, w);
666 } 666 }
667 } 667 }
668 } 668 }
669 669
670 670
671 static void makect(int nc, int *ip, float *c) 671 static void makect(int nc, int *ip, float *c)
672 { 672 {
673 int j, nch; 673 int j, nch;
674 float delta; 674 float delta;
675 675
676 ip[1] = nc; 676 ip[1] = nc;
677 if (nc > 1) { 677 if (nc > 1) {
678 nch = nc >> 1; 678 nch = nc >> 1;
679 delta = (float)atan(1.0f) / nch; 679 delta = atanf(1.0f) / nch;
680 c[0] = (float)cos(delta * nch); 680 c[0] = (float)cos(delta * nch);
681 c[nch] = 0.5f * c[0]; 681 c[nch] = 0.5f * c[0];
682 for (j = 1; j < nch; j++) { 682 for (j = 1; j < nch; j++) {
683 c[j] = 0.5f * (float)cos(delta * j); 683 c[j] = 0.5f * (float)cos(delta * j);
684 c[nc - j] = 0.5f * (float)sin(delta * j); 684 c[nc - j] = 0.5f * (float)sin(delta * j);
685 } 685 }
686 } 686 }
687 } 687 }
688 688
689 689
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 kk += ks; 1317 kk += ks;
1318 wkr = c[kk] - c[nc - kk]; 1318 wkr = c[kk] - c[nc - kk];
1319 wki = c[kk] + c[nc - kk]; 1319 wki = c[kk] + c[nc - kk];
1320 xr = wki * a[k] - wkr * a[j]; 1320 xr = wki * a[k] - wkr * a[j];
1321 a[k] = wkr * a[k] + wki * a[j]; 1321 a[k] = wkr * a[k] + wki * a[j];
1322 a[j] = xr; 1322 a[j] = xr;
1323 } 1323 }
1324 a[m] *= c[0]; 1324 a[m] *= c[0];
1325 } 1325 }
1326 #endif // Not used. 1326 #endif // Not used.
OLDNEW
« no previous file with comments | « talk/app/webrtc/test/fakeaudiocapturemodule_unittest.cc ('k') | webrtc/common_audio/lapped_transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698