ref: 7fc2fbdb14af2ae7e9fb44cf56555f549ac65929
parent: 4ee5753966fb78f11292a5545cf5f1cf26ed7f6c
author: Jean-Marc Valin <[email protected]>
date: Thu Sep 1 09:40:39 EDT 2011
Renamed some funciton that were likely to clash with other (non-Opus) code
--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -41,7 +41,7 @@
#include "mathops.h"
#include "rate.h"
-opus_uint32 lcg_rand(opus_uint32 seed)
+opus_uint32 celt_lcg_rand(opus_uint32 seed)
{
return 1664525 * seed + 1013904223;
}
@@ -283,7 +283,7 @@
/* Fill with noise */
for (j=0;j<N0;j++)
{
- seed = lcg_rand(seed);
+ seed = celt_lcg_rand(seed);
X[(j<<LM)+k] = (seed&0x8000 ? r : -r);
}
renormalize = 1;
@@ -1082,7 +1082,7 @@
/* Noise */
for (j=0;j<N;j++)
{
- *seed = lcg_rand(*seed);
+ *seed = celt_lcg_rand(*seed);
X[j] = (celt_norm)((opus_int32)*seed>>20);
}
cm = cm_mask;
@@ -1091,7 +1091,7 @@
for (j=0;j<N;j++)
{
opus_val16 tmp;
- *seed = lcg_rand(*seed);
+ *seed = celt_lcg_rand(*seed);
/* About 48 dB below the "normal" folding level */
tmp = QCONST16(1.0f/256, 10);
tmp = (*seed)&0x8000 ? tmp : -tmp;
--- a/libcelt/bands.h
+++ b/libcelt/bands.h
@@ -92,6 +92,6 @@
int start, int end, opus_val16 *logE, opus_val16 *prev1logE,
opus_val16 *prev2logE, int *pulses, opus_uint32 seed);
-opus_uint32 lcg_rand(opus_uint32 seed);
+opus_uint32 celt_lcg_rand(opus_uint32 seed);
#endif /* BANDS_H */
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -2038,7 +2038,7 @@
blen = (st->mode->eBands[i+1]-st->mode->eBands[i])<<LM;
for (j=0;j<blen;j++)
{
- seed = lcg_rand(seed);
+ seed = celt_lcg_rand(seed);
X[boffs+j] = (celt_norm)((opus_int32)seed>>20);
}
renormalise_vector(X+boffs, blen, Q15ONE);
@@ -2122,7 +2122,7 @@
}
for (i=0;i<LPC_ORDER;i++)
mem[i] = ROUND16(out_mem[c][MAX_PERIOD-1-i], SIG_SHIFT);
- fir(exc, lpc+c*LPC_ORDER, exc, MAX_PERIOD, LPC_ORDER, mem);
+ celt_fir(exc, lpc+c*LPC_ORDER, exc, MAX_PERIOD, LPC_ORDER, mem);
/*for (i=0;i<MAX_PERIOD;i++)printf("%d ", exc[i]); printf("\n");*/
/* Check if the waveform is decaying (and if so how fast) */
{
@@ -2159,7 +2159,7 @@
mem[i] = ROUND16(out_mem[c][MAX_PERIOD-1-i], SIG_SHIFT);
for (i=0;i<len+st->mode->overlap;i++)
e[i] = MULT16_32_Q15(fade, e[i]);
- iir(e, lpc+c*LPC_ORDER, e, len+st->mode->overlap, LPC_ORDER, mem);
+ celt_iir(e, lpc+c*LPC_ORDER, e, len+st->mode->overlap, LPC_ORDER, mem);
{
opus_val32 S2=0;
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -137,11 +137,11 @@
tmp = MULT16_16_Q15(QCONST16(.9f,15), tmp);
lpc[i] = MULT16_16_Q15(lpc[i], tmp);
}
- fir(x_lp, lpc, x_lp, len>>1, 4, mem);
+ celt_fir(x_lp, lpc, x_lp, len>>1, 4, mem);
mem[0]=0;
lpc[0]=QCONST16(.8f,12);
- fir(x_lp, lpc, x_lp, len>>1, 1, mem);
+ celt_fir(x_lp, lpc, x_lp, len>>1, 1, mem);
}
--- a/libcelt/plc.c
+++ b/libcelt/plc.c
@@ -87,7 +87,7 @@
#endif
}
-void fir(const opus_val16 *x,
+void celt_fir(const opus_val16 *x,
const opus_val16 *num,
opus_val16 *y,
int N,
@@ -112,7 +112,7 @@
}
}
-void iir(const opus_val32 *x,
+void celt_iir(const opus_val32 *x,
const opus_val16 *den,
opus_val32 *y,
int N,
--- a/libcelt/plc.h
+++ b/libcelt/plc.h
@@ -34,7 +34,7 @@
void _celt_lpc(opus_val16 *_lpc, const opus_val32 *ac, int p);
-void fir(const opus_val16 *x,
+void celt_fir(const opus_val16 *x,
const opus_val16 *num,
opus_val16 *y,
int N,
@@ -41,7 +41,7 @@
int ord,
opus_val16 *mem);
-void iir(const opus_val32 *x,
+void celt_iir(const opus_val32 *x,
const opus_val16 *den,
opus_val32 *y,
int N,