aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2024-03-22 00:10:58 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2024-03-22 00:10:58 -0400
commit51dc185175325aefe823c59d2d38e525535374dd (patch)
treeceded3d90708a9762800069ff6bd17893262aca3
parent7f449bf8bd3b933891d12c30112268c4090e4d59 (diff)
downloadrnnoise-51dc185175325aefe823c59d2d38e525535374dd.tar.gz
Rename symbols to avoid clashes with Opus
-rw-r--r--src/celt_lpc.c10
-rw-r--r--src/celt_lpc.h8
-rw-r--r--src/denoise.c6
-rw-r--r--src/pitch.c14
-rw-r--r--src/pitch.h8
5 files changed, 23 insertions, 23 deletions
diff --git a/src/celt_lpc.c b/src/celt_lpc.c
index 521351e..39dd38d 100644
--- a/src/celt_lpc.c
+++ b/src/celt_lpc.c
@@ -34,7 +34,7 @@
#include "common.h"
#include "pitch.h"
-void _celt_lpc(
+void _rnnoise_lpc(
opus_val16 *_lpc, /* out: [0...p-1] LPC coefficients */
const opus_val32 *ac, /* in: [0...p] autocorrelation values */
int p
@@ -88,7 +88,7 @@ int p
}
-void celt_fir(
+void rnnoise_fir(
const opus_val16 *x,
const opus_val16 *num,
opus_val16 *y,
@@ -121,7 +121,7 @@ void celt_fir(
}
}
-void celt_iir(const opus_val32 *_x,
+void rnnoise_iir(const opus_val32 *_x,
const opus_val16 *den,
opus_val32 *_y,
int N,
@@ -195,7 +195,7 @@ void celt_iir(const opus_val32 *_x,
#endif
}
-int _celt_autocorr(
+int _rnnoise_autocorr(
const opus_val16 *x, /* in: [0...n-1] samples x */
opus_val32 *ac, /* out: [0...lag-1] ac values */
const opus_val16 *window,
@@ -247,7 +247,7 @@ int _celt_autocorr(
shift = 0;
}
#endif
- celt_pitch_xcorr(xptr, xptr, ac, fastN, lag+1);
+ rnnoise_pitch_xcorr(xptr, xptr, ac, fastN, lag+1);
for (k=0;k<=lag;k++)
{
for (i = k+fastN, d = 0; i < n; i++)
diff --git a/src/celt_lpc.h b/src/celt_lpc.h
index 34e0ff9..058c769 100644
--- a/src/celt_lpc.h
+++ b/src/celt_lpc.h
@@ -37,23 +37,23 @@
#define LPC_ORDER 24
-void _celt_lpc(opus_val16 *_lpc, const opus_val32 *ac, int p);
+void _rnnoise_lpc(opus_val16 *_lpc, const opus_val32 *ac, int p);
-void celt_fir(
+void rnnoise_fir(
const opus_val16 *x,
const opus_val16 *num,
opus_val16 *y,
int N,
int ord);
-void celt_iir(const opus_val32 *x,
+void rnnoise_iir(const opus_val32 *x,
const opus_val16 *den,
opus_val32 *y,
int N,
int ord,
opus_val16 *mem);
-int _celt_autocorr(const opus_val16 *x, opus_val32 *ac,
+int _rnnoise_autocorr(const opus_val16 *x, opus_val32 *ac,
const opus_val16 *window, int overlap, int lag, int n);
#endif /* PLC_H */
diff --git a/src/denoise.c b/src/denoise.c
index 5a62844..213c042 100644
--- a/src/denoise.c
+++ b/src/denoise.c
@@ -325,12 +325,12 @@ static int compute_frame_features(DenoiseState *st, kiss_fft_cpx *X, kiss_fft_cp
RNN_MOVE(st->pitch_buf, &st->pitch_buf[FRAME_SIZE], PITCH_BUF_SIZE-FRAME_SIZE);
RNN_COPY(&st->pitch_buf[PITCH_BUF_SIZE-FRAME_SIZE], in, FRAME_SIZE);
pre[0] = &st->pitch_buf[0];
- pitch_downsample(pre, pitch_buf, PITCH_BUF_SIZE, 1);
- pitch_search(pitch_buf+(PITCH_MAX_PERIOD>>1), pitch_buf, PITCH_FRAME_SIZE,
+ rnnoise_pitch_downsample(pre, pitch_buf, PITCH_BUF_SIZE, 1);
+ rnnoise_pitch_search(pitch_buf+(PITCH_MAX_PERIOD>>1), pitch_buf, PITCH_FRAME_SIZE,
PITCH_MAX_PERIOD-3*PITCH_MIN_PERIOD, &pitch_index);
pitch_index = PITCH_MAX_PERIOD-pitch_index;
- gain = remove_doubling(pitch_buf, PITCH_MAX_PERIOD, PITCH_MIN_PERIOD,
+ gain = rnnoise_remove_doubling(pitch_buf, PITCH_MAX_PERIOD, PITCH_MIN_PERIOD,
PITCH_FRAME_SIZE, &pitch_index, st->last_period, st->last_gain);
st->last_period = pitch_index;
st->last_gain = gain;
diff --git a/src/pitch.c b/src/pitch.c
index bd101a6..b0fdefc 100644
--- a/src/pitch.c
+++ b/src/pitch.c
@@ -145,7 +145,7 @@ static void celt_fir5(const opus_val16 *x,
}
-void pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
+void rnnoise_pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
int len, int C)
{
int i;
@@ -180,7 +180,7 @@ void pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
x_lp[0] += SHR32(HALF32(HALF32(x[1][1])+x[1][0]), shift);
}
- _celt_autocorr(x_lp, ac, NULL, 0,
+ _rnnoise_autocorr(x_lp, ac, NULL, 0,
4, len>>1);
/* Noise floor -40 dB */
@@ -200,7 +200,7 @@ void pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
#endif
}
- _celt_lpc(lpc, ac, 4);
+ _rnnoise_lpc(lpc, ac, 4);
for (i=0;i<4;i++)
{
tmp = MULT16_16_Q15(QCONST16(.9f,15), tmp);
@@ -215,7 +215,7 @@ void pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
celt_fir5(x_lp, lpc2, x_lp, len>>1, mem);
}
-void celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
+void rnnoise_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch)
{
@@ -280,7 +280,7 @@ void celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
#endif
}
-void pitch_search(const opus_val16 *x_lp, opus_val16 *y,
+void rnnoise_pitch_search(const opus_val16 *x_lp, opus_val16 *y,
int len, int max_pitch, int *pitch)
{
int i, j;
@@ -329,7 +329,7 @@ void pitch_search(const opus_val16 *x_lp, opus_val16 *y,
#ifdef FIXED_POINT
maxcorr =
#endif
- celt_pitch_xcorr(x_lp4, y_lp4, xcorr, len>>2, max_pitch>>2);
+ rnnoise_pitch_xcorr(x_lp4, y_lp4, xcorr, len>>2, max_pitch>>2);
find_best_pitch(xcorr, y_lp4, len>>2, max_pitch>>2, best_pitch
#ifdef FIXED_POINT
@@ -420,7 +420,7 @@ static opus_val16 compute_pitch_gain(opus_val32 xy, opus_val32 xx, opus_val32 yy
#endif
static const int second_check[16] = {0, 0, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2};
-opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
+opus_val16 rnnoise_remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
int N, int *T0_, int prev_period, opus_val16 prev_gain)
{
int k, i, T, T0;
diff --git a/src/pitch.h b/src/pitch.h
index 9bd31b4..09a7b4e 100644
--- a/src/pitch.h
+++ b/src/pitch.h
@@ -38,13 +38,13 @@
//#include "cpu_support.h"
#include "arch.h"
-void pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
+void rnnoise_pitch_downsample(celt_sig *x[], opus_val16 *x_lp,
int len, int C);
-void pitch_search(const opus_val16 *x_lp, opus_val16 *y,
+void rnnoise_pitch_search(const opus_val16 *x_lp, opus_val16 *y,
int len, int max_pitch, int *pitch);
-opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
+opus_val16 rnnoise_remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
int N, int *T0, int prev_period, opus_val16 prev_gain);
@@ -143,7 +143,7 @@ static OPUS_INLINE opus_val32 celt_inner_prod(const opus_val16 *x,
return xy;
}
-void celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
+void rnnoise_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch);
#endif