Renamed some funciton that were likely to clash with other (non-Opus) code

This commit is contained in:
Jean-Marc Valin 2011-09-01 13:40:39 -04:00
parent 4ee5753966
commit 7fc2fbdb14
6 changed files with 14 additions and 14 deletions

View file

@ -41,7 +41,7 @@
#include "mathops.h" #include "mathops.h"
#include "rate.h" #include "rate.h"
opus_uint32 lcg_rand(opus_uint32 seed) opus_uint32 celt_lcg_rand(opus_uint32 seed)
{ {
return 1664525 * seed + 1013904223; return 1664525 * seed + 1013904223;
} }
@ -283,7 +283,7 @@ void anti_collapse(const CELTMode *m, celt_norm *_X, unsigned char *collapse_mas
/* Fill with noise */ /* Fill with noise */
for (j=0;j<N0;j++) for (j=0;j<N0;j++)
{ {
seed = lcg_rand(seed); seed = celt_lcg_rand(seed);
X[(j<<LM)+k] = (seed&0x8000 ? r : -r); X[(j<<LM)+k] = (seed&0x8000 ? r : -r);
} }
renormalize = 1; renormalize = 1;
@ -1082,7 +1082,7 @@ static unsigned quant_band(int encode, const CELTMode *m, int i, celt_norm *X, c
/* Noise */ /* Noise */
for (j=0;j<N;j++) for (j=0;j<N;j++)
{ {
*seed = lcg_rand(*seed); *seed = celt_lcg_rand(*seed);
X[j] = (celt_norm)((opus_int32)*seed>>20); X[j] = (celt_norm)((opus_int32)*seed>>20);
} }
cm = cm_mask; cm = cm_mask;
@ -1091,7 +1091,7 @@ static unsigned quant_band(int encode, const CELTMode *m, int i, celt_norm *X, c
for (j=0;j<N;j++) for (j=0;j<N;j++)
{ {
opus_val16 tmp; opus_val16 tmp;
*seed = lcg_rand(*seed); *seed = celt_lcg_rand(*seed);
/* About 48 dB below the "normal" folding level */ /* About 48 dB below the "normal" folding level */
tmp = QCONST16(1.0f/256, 10); tmp = QCONST16(1.0f/256, 10);
tmp = (*seed)&0x8000 ? tmp : -tmp; tmp = (*seed)&0x8000 ? tmp : -tmp;

View file

@ -92,6 +92,6 @@ void anti_collapse(const CELTMode *m, celt_norm *_X, unsigned char *collapse_mas
int start, int end, opus_val16 *logE, opus_val16 *prev1logE, int start, int end, opus_val16 *logE, opus_val16 *prev1logE,
opus_val16 *prev2logE, int *pulses, opus_uint32 seed); 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 */ #endif /* BANDS_H */

View file

@ -2038,7 +2038,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, opus_val16 * restrict pc
blen = (st->mode->eBands[i+1]-st->mode->eBands[i])<<LM; blen = (st->mode->eBands[i+1]-st->mode->eBands[i])<<LM;
for (j=0;j<blen;j++) for (j=0;j<blen;j++)
{ {
seed = lcg_rand(seed); seed = celt_lcg_rand(seed);
X[boffs+j] = (celt_norm)((opus_int32)seed>>20); X[boffs+j] = (celt_norm)((opus_int32)seed>>20);
} }
renormalise_vector(X+boffs, blen, Q15ONE); renormalise_vector(X+boffs, blen, Q15ONE);
@ -2122,7 +2122,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, opus_val16 * restrict pc
} }
for (i=0;i<LPC_ORDER;i++) for (i=0;i<LPC_ORDER;i++)
mem[i] = ROUND16(out_mem[c][MAX_PERIOD-1-i], SIG_SHIFT); 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");*/ /*for (i=0;i<MAX_PERIOD;i++)printf("%d ", exc[i]); printf("\n");*/
/* Check if the waveform is decaying (and if so how fast) */ /* Check if the waveform is decaying (and if so how fast) */
{ {
@ -2159,7 +2159,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, opus_val16 * restrict pc
mem[i] = ROUND16(out_mem[c][MAX_PERIOD-1-i], SIG_SHIFT); mem[i] = ROUND16(out_mem[c][MAX_PERIOD-1-i], SIG_SHIFT);
for (i=0;i<len+st->mode->overlap;i++) for (i=0;i<len+st->mode->overlap;i++)
e[i] = MULT16_32_Q15(fade, e[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; opus_val32 S2=0;

View file

@ -137,11 +137,11 @@ void pitch_downsample(celt_sig * restrict x[], opus_val16 * restrict x_lp,
tmp = MULT16_16_Q15(QCONST16(.9f,15), tmp); tmp = MULT16_16_Q15(QCONST16(.9f,15), tmp);
lpc[i] = MULT16_16_Q15(lpc[i], 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; mem[0]=0;
lpc[0]=QCONST16(.8f,12); 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);
} }

View file

@ -87,7 +87,7 @@ int p
#endif #endif
} }
void fir(const opus_val16 *x, void celt_fir(const opus_val16 *x,
const opus_val16 *num, const opus_val16 *num,
opus_val16 *y, opus_val16 *y,
int N, int N,
@ -112,7 +112,7 @@ void fir(const opus_val16 *x,
} }
} }
void iir(const opus_val32 *x, void celt_iir(const opus_val32 *x,
const opus_val16 *den, const opus_val16 *den,
opus_val32 *y, opus_val32 *y,
int N, int N,

View file

@ -34,14 +34,14 @@
void _celt_lpc(opus_val16 *_lpc, const opus_val32 *ac, int p); 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, const opus_val16 *num,
opus_val16 *y, opus_val16 *y,
int N, int N,
int ord, int ord,
opus_val16 *mem); opus_val16 *mem);
void iir(const opus_val32 *x, void celt_iir(const opus_val32 *x,
const opus_val16 *den, const opus_val16 *den,
opus_val32 *y, opus_val32 *y,
int N, int N,