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

Unified Diff: webrtc/common_audio/fft4g.c

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/common_audio/fft4g.h ('k') | webrtc/common_audio/include/audio_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/fft4g.c
diff --git a/webrtc/common_audio/fft4g.c b/webrtc/common_audio/fft4g.c
index 24d45eb6b31ab650cfad278808b0354ce82689e1..9cf7b9f6cad21d8a8368d7367912b798c179a7f4 100644
--- a/webrtc/common_audio/fft4g.c
+++ b/webrtc/common_audio/fft4g.c
@@ -27,7 +27,7 @@ functions
dfst: Sine Transform of RDFT (Real Anti-symmetric DFT)
function prototypes
void cdft(int, int, float *, int *, float *);
- void rdft(int, int, float *, int *, float *);
+ void rdft(size_t, int, float *, size_t *, float *);
void ddct(int, int, float *, int *, float *);
void ddst(int, int, float *, int *, float *);
void dfct(int, float *, float *, int *, float *);
@@ -94,7 +94,7 @@ function prototypes
ip[0] = 0; // first time only
rdft(n, -1, a, ip, w);
[parameters]
- n :data length (int)
+ n :data length (size_t)
n >= 2, n = power of 2
a[0...n-1] :input/output data (float *)
<case1>
@@ -107,7 +107,7 @@ function prototypes
a[2*j] = R[j], 0<=j<n/2
a[2*j+1] = I[j], 0<j<n/2
a[1] = R[n/2]
- ip[0...*] :work area for bit reversal (int *)
+ ip[0...*] :work area for bit reversal (size_t *)
length of ip >= 2+sqrt(n/2)
strictly,
length of ip >=
@@ -286,18 +286,20 @@ Appendix :
w[] and ip[] are compatible with all routines.
*/
-static void makewt(int nw, int *ip, float *w);
-static void makect(int nc, int *ip, float *c);
-static void bitrv2(int n, int *ip, float *a);
+#include <stddef.h>
+
+static void makewt(size_t nw, size_t *ip, float *w);
+static void makect(size_t nc, size_t *ip, float *c);
+static void bitrv2(size_t n, size_t *ip, float *a);
#if 0 // Not used.
static void bitrv2conj(int n, int *ip, float *a);
#endif
-static void cftfsub(int n, float *a, float *w);
-static void cftbsub(int n, float *a, float *w);
-static void cft1st(int n, float *a, float *w);
-static void cftmdl(int n, int l, float *a, float *w);
-static void rftfsub(int n, float *a, int nc, float *c);
-static void rftbsub(int n, float *a, int nc, float *c);
+static void cftfsub(size_t n, float *a, float *w);
+static void cftbsub(size_t n, float *a, float *w);
+static void cft1st(size_t n, float *a, float *w);
+static void cftmdl(size_t n, size_t l, float *a, float *w);
+static void rftfsub(size_t n, float *a, size_t nc, float *c);
+static void rftbsub(size_t n, float *a, size_t nc, float *c);
#if 0 // Not used.
static void dctsub(int n, float *a, int nc, float *c)
static void dstsub(int n, float *a, int nc, float *c)
@@ -325,9 +327,9 @@ void WebRtc_cdft(int n, int isgn, float *a, int *ip, float *w)
#endif
-void WebRtc_rdft(int n, int isgn, float *a, int *ip, float *w)
+void WebRtc_rdft(size_t n, int isgn, float *a, size_t *ip, float *w)
{
- int nw, nc;
+ size_t nw, nc;
float xi;
nw = ip[0];
@@ -643,9 +645,9 @@ static void dfst(int n, float *a, float *t, int *ip, float *w)
#include <math.h>
-static void makewt(int nw, int *ip, float *w)
+static void makewt(size_t nw, size_t *ip, float *w)
{
- int j, nwh;
+ size_t j, nwh;
float delta, x, y;
ip[0] = nw;
@@ -672,9 +674,9 @@ static void makewt(int nw, int *ip, float *w)
}
-static void makect(int nc, int *ip, float *c)
+static void makect(size_t nc, size_t *ip, float *c)
{
- int j, nch;
+ size_t j, nch;
float delta;
ip[1] = nc;
@@ -694,9 +696,9 @@ static void makect(int nc, int *ip, float *c)
/* -------- child routines -------- */
-static void bitrv2(int n, int *ip, float *a)
+static void bitrv2(size_t n, size_t *ip, float *a)
{
- int j, j1, k, k1, l, m, m2;
+ size_t j, j1, k, k1, l, m, m2;
float xr, xi, yr, yi;
ip[0] = 0;
@@ -903,9 +905,9 @@ static void bitrv2conj(int n, int *ip, float *a)
}
#endif
-static void cftfsub(int n, float *a, float *w)
+static void cftfsub(size_t n, float *a, float *w)
{
- int j, j1, j2, j3, l;
+ size_t j, j1, j2, j3, l;
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
l = 2;
@@ -953,9 +955,9 @@ static void cftfsub(int n, float *a, float *w)
}
-static void cftbsub(int n, float *a, float *w)
+static void cftbsub(size_t n, float *a, float *w)
{
- int j, j1, j2, j3, l;
+ size_t j, j1, j2, j3, l;
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
l = 2;
@@ -1003,9 +1005,9 @@ static void cftbsub(int n, float *a, float *w)
}
-static void cft1st(int n, float *a, float *w)
+static void cft1st(size_t n, float *a, float *w)
{
- int j, k1, k2;
+ size_t j, k1, k2;
float wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
@@ -1108,9 +1110,9 @@ static void cft1st(int n, float *a, float *w)
}
-static void cftmdl(int n, int l, float *a, float *w)
+static void cftmdl(size_t n, size_t l, float *a, float *w)
{
- int j, j1, j2, j3, k, k1, k2, m, m2;
+ size_t j, j1, j2, j3, k, k1, k2, m, m2;
float wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
@@ -1235,9 +1237,9 @@ static void cftmdl(int n, int l, float *a, float *w)
}
-static void rftfsub(int n, float *a, int nc, float *c)
+static void rftfsub(size_t n, float *a, size_t nc, float *c)
{
- int j, k, kk, ks, m;
+ size_t j, k, kk, ks, m;
float wkr, wki, xr, xi, yr, yi;
m = n >> 1;
@@ -1260,9 +1262,9 @@ static void rftfsub(int n, float *a, int nc, float *c)
}
-static void rftbsub(int n, float *a, int nc, float *c)
+static void rftbsub(size_t n, float *a, size_t nc, float *c)
{
- int j, k, kk, ks, m;
+ size_t j, k, kk, ks, m;
float wkr, wki, xr, xi, yr, yi;
a[1] = -a[1];
« no previous file with comments | « webrtc/common_audio/fft4g.h ('k') | webrtc/common_audio/include/audio_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698