<html><head></head><body>Hi,<br><br>It's perfectly fine to have same named symbols in different libraries. If you get an error, there must be something wrong with link flags somewhere.<br><br><div class="gmail_quote">Le 20 octobre 2020 00:53:09 GMT+03:00, Tristan Matthews <tmatth@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">This avoids clashing with symbols of the same name in libopus<hr> contrib/src/rnnoise/dupe-symbols.patch | 134 +++++++++++++++++++++++++<br> contrib/src/rnnoise/rules.mak | 5 +-<br> 2 files changed, 137 insertions(+), 2 deletions(-)<br> create mode 100644 contrib/src/rnnoise/dupe-symbols.patch<br><br>diff --git a/contrib/src/rnnoise/dupe-symbols.patch b/contrib/src/rnnoise/dupe-symbols.patch<br>new file mode 100644<br>index 0000000000..f564511990<br>--- /dev/null<br>+++ b/contrib/src/rnnoise/dupe-symbols.patch<br>@@ -0,0 +1,134 @@<br>+diff -ruw rnnoise-orig/src/kiss_fft.c rnnoise/src/kiss_fft.c<br>+--- rnnoise-orig/src/kiss_fft.c 2020-10-18 22:52:44.956998651 -0400<br>++++ rnnoise/src/kiss_fft.c 2020-10-18 22:57:33.355740996 -0400<br>+@@ -515,7 +515,7 @@<br>+ <br>+ #endif /* CUSTOM_MODES */<br>+ <br>+-void opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout)<br>++void rnn_opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout)<br>+ {<br>+ int m2, m;<br>+ int p;<br>+@@ -563,7 +563,7 @@<br>+ }<br>+ }<br>+ <br>+-void opus_fft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)<br>++void rnn_opus_fft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)<br>+ {<br>+ int i;<br>+ opus_val16 scale;<br>+@@ -582,11 +582,11 @@<br>+ fout[st->bitrev[i]].r = SHR32(MULT16_32_Q16(scale, x.r), scale_shift);<br>+ fout[st->bitrev[i]].i = SHR32(MULT16_32_Q16(scale, x.i), scale_shift);<br>+ }<br>+- opus_fft_impl(st, fout);<br>++ rnn_opus_fft_impl(st, fout);<br>+ }<br>+ <br>+ <br>+-void opus_ifft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)<br>++void rnn_opus_ifft_c(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)<br>+ {<br>+ int i;<br>+ celt_assert2 (fin != fout, "In-place FFT not supported");<br>+@@ -595,7 +595,7 @@<br>+ fout[st->bitrev[i]] = fin[i];<br>+ for (i=0;i<st->nfft;i++)<br>+ fout[i].i = -fout[i].i;<br>+- opus_fft_impl(st, fout);<br>++ rnn_opus_fft_impl(st, fout);<br>+ for (i=0;i<st->nfft;i++)<br>+ fout[i].i = -fout[i].i;<br>+ }<br>+diff -ruw rnnoise-orig/src/kiss_fft.h rnnoise/src/kiss_fft.h<br>+--- rnnoise-orig/src/kiss_fft.h 2020-10-18 22:52:44.956998651 -0400<br>++++ rnnoise/src/kiss_fft.h 2020-10-18 22:57:40.283710784 -0400<br>+@@ -142,10 +142,10 @@<br>+ * Note that each element is complex and can be accessed like<br>+ f[k].r and f[k].i<br>+ * */<br>+-void opus_fft_c(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);<br>+-void opus_ifft_c(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);<br>++void rnn_opus_fft_c(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);<br>++void rnn_opus_ifft_c(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);<br>+ <br>+-void opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout);<br>++void rnn_opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout);<br>+ void opus_ifft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout);<br>+ <br>+ void opus_fft_free(const kiss_fft_state *cfg, int arch);<br>+@@ -188,10 +188,10 @@<br>+ ((void)(arch), opus_fft_free_arch_c(_st))<br>+ <br>+ #define opus_fft(_cfg, _fin, _fout, arch) \<br>+- ((void)(arch), opus_fft_c(_cfg, _fin, _fout))<br>++ ((void)(arch), rnn_opus_fft_c(_cfg, _fin, _fout))<br>+ <br>+ #define opus_ifft(_cfg, _fin, _fout, arch) \<br>+- ((void)(arch), opus_ifft_c(_cfg, _fin, _fout))<br>++ ((void)(arch), rnn_opus_ifft_c(_cfg, _fin, _fout))<br>+ <br>+ #endif /* end if defined(OPUS_HAVE_RTCD) && (defined(HAVE_ARM_NE10)) */<br>+ #endif /* end if !defined(OVERRIDE_OPUS_FFT) */<br>+diff -ruw rnnoise-orig/src/rnn.c rnnoise/src/rnn.c<br>+--- rnnoise-orig/src/rnn.c 2020-10-18 22:52:44.956998651 -0400<br>++++ rnnoise/src/rnn.c 2020-10-18 22:55:56.492163401 -0400<br>+@@ -76,7 +76,7 @@<br>+ return x < 0 ? 0 : x;<br>+ }<br>+ <br>+-void compute_dense(const DenseLayer *layer, float *output, const float *input)<br>++void rnn_compute_dense(const DenseLayer *layer, float *output, const float *input)<br>+ {<br>+ int i, j;<br>+ int N, M;<br>+@@ -106,7 +106,7 @@<br>+ }<br>+ }<br>+ <br>+-void compute_gru(const GRULayer *gru, float *state, const float *input)<br>++void rnn_compute_gru(const GRULayer *gru, float *state, const float *input)<br>+ {<br>+ int i, j;<br>+ int N, M;<br>+@@ -162,17 +162,17 @@<br>+ float dense_out[MAX_NEURONS];<br>+ float noise_input[MAX_NEURONS*3];<br>+ float denoise_input[MAX_NEURONS*3];<br>+- compute_dense(rnn->model->input_dense, dense_out, input);<br>+- compute_gru(rnn->model->vad_gru, rnn->vad_gru_state, dense_out);<br>+- compute_dense(rnn->model->vad_output, vad, rnn->vad_gru_state);<br>++ rnn_compute_dense(rnn->model->input_dense, dense_out, input);<br>++ rnn_compute_gru(rnn->model->vad_gru, rnn->vad_gru_state, dense_out);<br>++ rnn_compute_dense(rnn->model->vad_output, vad, rnn->vad_gru_state);<br>+ for (i=0;i<rnn->model->input_dense_size;i++) noise_input[i] = dense_out[i];<br>+ for (i=0;i<rnn->model->vad_gru_size;i++) noise_input[i+rnn->model->input_dense_size] = rnn->vad_gru_state[i];<br>+ for (i=0;i<INPUT_SIZE;i++) noise_input[i+rnn->model->input_dense_size+rnn->model->vad_gru_size] = input[i];<br>+- compute_gru(rnn->model->noise_gru, rnn->noise_gru_state, noise_input);<br>++ rnn_compute_gru(rnn->model->noise_gru, rnn->noise_gru_state, noise_input);<br>+ <br>+ for (i=0;i<rnn->model->vad_gru_size;i++) denoise_input[i] = rnn->vad_gru_state[i];<br>+ for (i=0;i<rnn->model->noise_gru_size;i++) denoise_input[i+rnn->model->vad_gru_size] = rnn->noise_gru_state[i];<br>+ for (i=0;i<INPUT_SIZE;i++) denoise_input[i+rnn->model->vad_gru_size+rnn->model->noise_gru_size] = input[i];<br>+- compute_gru(rnn->model->denoise_gru, rnn->denoise_gru_state, denoise_input);<br>+- compute_dense(rnn->model->denoise_output, gains, rnn->denoise_gru_state);<br>++ rnn_compute_gru(rnn->model->denoise_gru, rnn->denoise_gru_state, denoise_input);<br>++ rnn_compute_dense(rnn->model->denoise_output, gains, rnn->denoise_gru_state);<br>+ }<br>+diff -ruw rnnoise-orig/src/rnn.h rnnoise/src/rnn.h<br>+--- rnnoise-orig/src/rnn.h 2020-10-18 22:52:44.956998651 -0400<br>++++ rnnoise/src/rnn.h 2020-10-18 22:55:59.892148575 -0400<br>+@@ -60,9 +60,9 @@<br>+ <br>+ typedef struct RNNState RNNState;<br>+ <br>+-void compute_dense(const DenseLayer *layer, float *output, const float *input);<br>++void rnn_compute_dense(const DenseLayer *layer, float *output, const float *input);<br>+ <br>+-void compute_gru(const GRULayer *gru, float *state, const float *input);<br>++void rnn_compute_gru(const GRULayer *gru, float *state, const float *input);<br>+ <br>+ void compute_rnn(RNNState *rnn, float *gains, float *vad, const float *input);<br>+ <br>diff --git a/contrib/src/rnnoise/rules.mak b/contrib/src/rnnoise/rules.mak<br>index f6ded7ecda..3547322f90 100644<br>--- a/contrib/src/rnnoise/rules.mak<br>+++ b/contrib/src/rnnoise/rules.mak<br>@@ -3,9 +3,7 @@<br> RNNOISE_GITURL := <a href="http://github.com/xiph/rnnoise.git">http://github.com/xiph/rnnoise.git</a><br> RNNOISE_GITHASH := 90ec41ef659fd82cfec2103e9bb7fc235e9ea66c<br> <br>-ifndef HAVE_ANDROID<br> PKGS += rnnoise<br>-endif<br> <br> ifeq ($(call need_pkg,"rnnoise"),)<br> PKGS_FOUND += rnnoise<br>@@ -20,6 +18,9 @@ $(TARBALLS)/rnnoise-$(RNNOISE_GITHASH).tar.xz:<br> <br> rnnoise: rnnoise-$(RNNOISE_GITHASH).tar.xz .sum-rnnoise<br> $(UNPACK)<br>+ifdef HAVE_ANDROID<br>+ $(APPLY) $(SRC)/rnnoise/dupe-symbols.patch<br>+endif<br> $(MOVE)<br> <br> .rnnoise: rnnoise</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>