Cleaned up leaky symbols in NS.
Review URL: http://webrtc-codereview.appspot.com/337001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1288 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ebcb6421b1
commit
f4d3b9d5a1
@ -111,7 +111,7 @@ int WebRtcNs_InitCore(NSinst_t* inst, WebRtc_UWord32 fs) {
|
|||||||
// Initialize fft work arrays.
|
// Initialize fft work arrays.
|
||||||
inst->ip[0] = 0; // Setting this triggers initialization.
|
inst->ip[0] = 0; // Setting this triggers initialization.
|
||||||
memset(inst->dataBuf, 0, sizeof(float) * ANAL_BLOCKL_MAX);
|
memset(inst->dataBuf, 0, sizeof(float) * ANAL_BLOCKL_MAX);
|
||||||
rdft(inst->anaLen, 1, inst->dataBuf, inst->ip, inst->wfft);
|
WebRtc_rdft(inst->anaLen, 1, inst->dataBuf, inst->ip, inst->wfft);
|
||||||
|
|
||||||
memset(inst->dataBuf, 0, sizeof(float) * ANAL_BLOCKL_MAX);
|
memset(inst->dataBuf, 0, sizeof(float) * ANAL_BLOCKL_MAX);
|
||||||
memset(inst->syntBuf, 0, sizeof(float) * ANAL_BLOCKL_MAX);
|
memset(inst->syntBuf, 0, sizeof(float) * ANAL_BLOCKL_MAX);
|
||||||
@ -862,7 +862,7 @@ int WebRtcNs_ProcessCore(NSinst_t* inst,
|
|||||||
//
|
//
|
||||||
inst->blockInd++; // Update the block index only when we process a block.
|
inst->blockInd++; // Update the block index only when we process a block.
|
||||||
// FFT
|
// FFT
|
||||||
rdft(inst->anaLen, 1, winData, inst->ip, inst->wfft);
|
WebRtc_rdft(inst->anaLen, 1, winData, inst->ip, inst->wfft);
|
||||||
|
|
||||||
imag[0] = 0;
|
imag[0] = 0;
|
||||||
real[0] = winData[0];
|
real[0] = winData[0];
|
||||||
@ -1155,7 +1155,7 @@ int WebRtcNs_ProcessCore(NSinst_t* inst,
|
|||||||
winData[2 * i] = real[i];
|
winData[2 * i] = real[i];
|
||||||
winData[2 * i + 1] = imag[i];
|
winData[2 * i + 1] = imag[i];
|
||||||
}
|
}
|
||||||
rdft(inst->anaLen, -1, winData, inst->ip, inst->wfft);
|
WebRtc_rdft(inst->anaLen, -1, winData, inst->ip, inst->wfft);
|
||||||
|
|
||||||
for (i = 0; i < inst->anaLen; i++) {
|
for (i = 0; i < inst->anaLen; i++) {
|
||||||
real[i] = 2.0f * winData[i] / inst->anaLen; // fft scaling
|
real[i] = 2.0f * winData[i] / inst->anaLen; // fft scaling
|
||||||
|
@ -286,14 +286,24 @@ Appendix :
|
|||||||
w[] and ip[] are compatible with all routines.
|
w[] and ip[] are compatible with all routines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void cdft(int n, int isgn, float *a, int *ip, float *w)
|
static void makewt(int nw, int *ip, float *w);
|
||||||
{
|
static void makect(int nc, int *ip, float *c);
|
||||||
void makewt(int nw, int *ip, float *w);
|
static void bitrv2(int n, int *ip, float *a);
|
||||||
void bitrv2(int n, int *ip, float *a);
|
static void bitrv2conj(int n, int *ip, float *a);
|
||||||
void bitrv2conj(int n, int *ip, float *a);
|
static void cftfsub(int n, float *a, float *w);
|
||||||
void cftfsub(int n, float *a, float *w);
|
static void cftbsub(int n, float *a, float *w);
|
||||||
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);
|
||||||
|
#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)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void WebRtc_cdft(int n, int isgn, float *a, int *ip, float *w)
|
||||||
|
{
|
||||||
if (n > (ip[0] << 2)) {
|
if (n > (ip[0] << 2)) {
|
||||||
makewt(n >> 2, ip, w);
|
makewt(n >> 2, ip, w);
|
||||||
}
|
}
|
||||||
@ -311,15 +321,8 @@ void cdft(int n, int isgn, float *a, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rdft(int n, int isgn, float *a, int *ip, float *w)
|
void WebRtc_rdft(int n, int isgn, float *a, int *ip, float *w)
|
||||||
{
|
{
|
||||||
void makewt(int nw, int *ip, float *w);
|
|
||||||
void makect(int nc, int *ip, float *c);
|
|
||||||
void bitrv2(int n, int *ip, float *a);
|
|
||||||
void cftfsub(int n, float *a, float *w);
|
|
||||||
void cftbsub(int n, float *a, float *w);
|
|
||||||
void rftfsub(int n, float *a, int nc, float *c);
|
|
||||||
void rftbsub(int n, float *a, int nc, float *c);
|
|
||||||
int nw, nc;
|
int nw, nc;
|
||||||
float xi;
|
float xi;
|
||||||
|
|
||||||
@ -357,17 +360,9 @@ void rdft(int n, int isgn, float *a, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 // Not used.
|
||||||
void ddct(int n, int isgn, float *a, int *ip, float *w)
|
static void ddct(int n, int isgn, float *a, int *ip, float *w)
|
||||||
{
|
{
|
||||||
void makewt(int nw, int *ip, float *w);
|
|
||||||
void makect(int nc, int *ip, float *c);
|
|
||||||
void bitrv2(int n, int *ip, float *a);
|
|
||||||
void cftfsub(int n, float *a, float *w);
|
|
||||||
void cftbsub(int n, float *a, float *w);
|
|
||||||
void rftfsub(int n, float *a, int nc, float *c);
|
|
||||||
void rftbsub(int n, float *a, int nc, float *c);
|
|
||||||
void dctsub(int n, float *a, int nc, float *c);
|
|
||||||
int j, nw, nc;
|
int j, nw, nc;
|
||||||
float xr;
|
float xr;
|
||||||
|
|
||||||
@ -417,16 +412,8 @@ void ddct(int n, int isgn, float *a, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ddst(int n, int isgn, float *a, int *ip, float *w)
|
static void ddst(int n, int isgn, float *a, int *ip, float *w)
|
||||||
{
|
{
|
||||||
void makewt(int nw, int *ip, float *w);
|
|
||||||
void makect(int nc, int *ip, float *c);
|
|
||||||
void bitrv2(int n, int *ip, float *a);
|
|
||||||
void cftfsub(int n, float *a, float *w);
|
|
||||||
void cftbsub(int n, float *a, float *w);
|
|
||||||
void rftfsub(int n, float *a, int nc, float *c);
|
|
||||||
void rftbsub(int n, float *a, int nc, float *c);
|
|
||||||
void dstsub(int n, float *a, int nc, float *c);
|
|
||||||
int j, nw, nc;
|
int j, nw, nc;
|
||||||
float xr;
|
float xr;
|
||||||
|
|
||||||
@ -476,14 +463,8 @@ void ddst(int n, int isgn, float *a, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void dfct(int n, float *a, float *t, int *ip, float *w)
|
static void dfct(int n, float *a, float *t, int *ip, float *w)
|
||||||
{
|
{
|
||||||
void makewt(int nw, int *ip, float *w);
|
|
||||||
void makect(int nc, int *ip, float *c);
|
|
||||||
void bitrv2(int n, int *ip, float *a);
|
|
||||||
void cftfsub(int n, float *a, float *w);
|
|
||||||
void rftfsub(int n, float *a, int nc, float *c);
|
|
||||||
void dctsub(int n, float *a, int nc, float *c);
|
|
||||||
int j, k, l, m, mh, nw, nc;
|
int j, k, l, m, mh, nw, nc;
|
||||||
float xr, xi, yr, yi;
|
float xr, xi, yr, yi;
|
||||||
|
|
||||||
@ -571,15 +552,8 @@ void dfct(int n, float *a, float *t, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dfst(int n, float *a, float *t, int *ip, float *w)
|
||||||
void dfst(int n, float *a, float *t, int *ip, float *w)
|
|
||||||
{
|
{
|
||||||
void makewt(int nw, int *ip, float *w);
|
|
||||||
void makect(int nc, int *ip, float *c);
|
|
||||||
void bitrv2(int n, int *ip, float *a);
|
|
||||||
void cftfsub(int n, float *a, float *w);
|
|
||||||
void rftfsub(int n, float *a, int nc, float *c);
|
|
||||||
void dstsub(int n, float *a, int nc, float *c);
|
|
||||||
int j, k, l, m, mh, nw, nc;
|
int j, k, l, m, mh, nw, nc;
|
||||||
float xr, xi, yr, yi;
|
float xr, xi, yr, yi;
|
||||||
|
|
||||||
@ -657,6 +631,7 @@ void dfst(int n, float *a, float *t, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
a[0] = 0;
|
a[0] = 0;
|
||||||
}
|
}
|
||||||
|
#endif // Not used.
|
||||||
|
|
||||||
|
|
||||||
/* -------- initializing routines -------- */
|
/* -------- initializing routines -------- */
|
||||||
@ -664,9 +639,8 @@ void dfst(int n, float *a, float *t, int *ip, float *w)
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
void makewt(int nw, int *ip, float *w)
|
static void makewt(int nw, int *ip, float *w)
|
||||||
{
|
{
|
||||||
void bitrv2(int n, int *ip, float *a);
|
|
||||||
int j, nwh;
|
int j, nwh;
|
||||||
float delta, x, y;
|
float delta, x, y;
|
||||||
|
|
||||||
@ -694,7 +668,7 @@ void makewt(int nw, int *ip, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void makect(int nc, int *ip, float *c)
|
static void makect(int nc, int *ip, float *c)
|
||||||
{
|
{
|
||||||
int j, nch;
|
int j, nch;
|
||||||
float delta;
|
float delta;
|
||||||
@ -716,7 +690,7 @@ void makect(int nc, int *ip, float *c)
|
|||||||
/* -------- child routines -------- */
|
/* -------- child routines -------- */
|
||||||
|
|
||||||
|
|
||||||
void bitrv2(int n, int *ip, float *a)
|
static void bitrv2(int n, int *ip, float *a)
|
||||||
{
|
{
|
||||||
int j, j1, k, k1, l, m, m2;
|
int j, j1, k, k1, l, m, m2;
|
||||||
float xr, xi, yr, yi;
|
float xr, xi, yr, yi;
|
||||||
@ -816,7 +790,7 @@ void bitrv2(int n, int *ip, float *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void bitrv2conj(int n, int *ip, float *a)
|
static void bitrv2conj(int n, int *ip, float *a)
|
||||||
{
|
{
|
||||||
int j, j1, k, k1, l, m, m2;
|
int j, j1, k, k1, l, m, m2;
|
||||||
float xr, xi, yr, yi;
|
float xr, xi, yr, yi;
|
||||||
@ -925,10 +899,8 @@ void bitrv2conj(int n, int *ip, float *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cftfsub(int n, float *a, float *w)
|
static void cftfsub(int n, float *a, float *w)
|
||||||
{
|
{
|
||||||
void cft1st(int n, float *a, float *w);
|
|
||||||
void cftmdl(int n, int l, float *a, float *w);
|
|
||||||
int j, j1, j2, j3, l;
|
int j, j1, j2, j3, l;
|
||||||
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
|
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
|
||||||
|
|
||||||
@ -977,10 +949,8 @@ void cftfsub(int n, float *a, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cftbsub(int n, float *a, float *w)
|
static void cftbsub(int n, float *a, float *w)
|
||||||
{
|
{
|
||||||
void cft1st(int n, float *a, float *w);
|
|
||||||
void cftmdl(int n, int l, float *a, float *w);
|
|
||||||
int j, j1, j2, j3, l;
|
int j, j1, j2, j3, l;
|
||||||
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
|
float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
|
||||||
|
|
||||||
@ -1029,7 +999,7 @@ void cftbsub(int n, float *a, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cft1st(int n, float *a, float *w)
|
static void cft1st(int n, float *a, float *w)
|
||||||
{
|
{
|
||||||
int j, k1, k2;
|
int j, k1, k2;
|
||||||
float wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
|
float wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
|
||||||
@ -1134,7 +1104,7 @@ void cft1st(int n, float *a, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cftmdl(int n, int l, float *a, float *w)
|
static void cftmdl(int n, int l, float *a, float *w)
|
||||||
{
|
{
|
||||||
int j, j1, j2, j3, k, k1, k2, m, m2;
|
int j, j1, j2, j3, k, k1, k2, m, m2;
|
||||||
float wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
|
float wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
|
||||||
@ -1261,7 +1231,7 @@ void cftmdl(int n, int l, float *a, float *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rftfsub(int n, float *a, int nc, float *c)
|
static void rftfsub(int n, float *a, int nc, float *c)
|
||||||
{
|
{
|
||||||
int j, k, kk, ks, m;
|
int j, k, kk, ks, m;
|
||||||
float wkr, wki, xr, xi, yr, yi;
|
float wkr, wki, xr, xi, yr, yi;
|
||||||
@ -1286,7 +1256,7 @@ void rftfsub(int n, float *a, int nc, float *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rftbsub(int n, float *a, int nc, float *c)
|
static void rftbsub(int n, float *a, int nc, float *c)
|
||||||
{
|
{
|
||||||
int j, k, kk, ks, m;
|
int j, k, kk, ks, m;
|
||||||
float wkr, wki, xr, xi, yr, yi;
|
float wkr, wki, xr, xi, yr, yi;
|
||||||
@ -1312,8 +1282,8 @@ void rftbsub(int n, float *a, int nc, float *c)
|
|||||||
a[m + 1] = -a[m + 1];
|
a[m + 1] = -a[m + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 // Not used.
|
||||||
void dctsub(int n, float *a, int nc, float *c)
|
static void dctsub(int n, float *a, int nc, float *c)
|
||||||
{
|
{
|
||||||
int j, k, kk, ks, m;
|
int j, k, kk, ks, m;
|
||||||
float wkr, wki, xr;
|
float wkr, wki, xr;
|
||||||
@ -1334,7 +1304,7 @@ void dctsub(int n, float *a, int nc, float *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void dstsub(int n, float *a, int nc, float *c)
|
static void dstsub(int n, float *a, int nc, float *c)
|
||||||
{
|
{
|
||||||
int j, k, kk, ks, m;
|
int j, k, kk, ks, m;
|
||||||
float wkr, wki, xr;
|
float wkr, wki, xr;
|
||||||
@ -1353,4 +1323,4 @@ void dstsub(int n, float *a, int nc, float *c)
|
|||||||
}
|
}
|
||||||
a[m] *= c[0];
|
a[m] *= c[0];
|
||||||
}
|
}
|
||||||
|
#endif // Not used.
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_FFT4G_H_
|
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_FFT4G_H_
|
||||||
#define WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_FFT4G_H_
|
#define WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_FFT4G_H_
|
||||||
|
|
||||||
void rdft(int, int, float *, int *, float *);
|
void WebRtc_rdft(int, int, float *, int *, float *);
|
||||||
void cdft(int, int, float *, int *, float *);
|
void WebRtc_cdft(int, int, float *, int *, float *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user