shithub: opus

Download patch

ref: 71766ef7a451a48536255c62c273b037ebcb2c42
parent: 7fd98c571f781c32d5de0ec83be3f38b678e73fe
author: Jean-Marc Valin <[email protected]>
date: Sun Jun 16 20:44:12 EDT 2013

Avoids symbol clashes with Speex (pitch_xcorr) and libm (y1)

--- a/celt/celt_lpc.c
+++ b/celt/celt_lpc.c
@@ -263,7 +263,7 @@
          xx[i] = VSHR32(xx[i], shift);
    }
 #endif
-   pitch_xcorr(xx, xx, ac, fastN, lag+1);
+   celt_pitch_xcorr(xx, xx, ac, fastN, lag+1);
    while (lag>=0)
    {
       for (i = lag+fastN, d = 0; i < n; i++)
--- a/celt/pitch.c
+++ b/celt/pitch.c
@@ -222,7 +222,7 @@
 #else
 void
 #endif
-pitch_xcorr(opus_val16 *x, opus_val16 *y, opus_val32 *xcorr, int len, int max_pitch)
+celt_pitch_xcorr(opus_val16 *x, opus_val16 *y, opus_val32 *xcorr, int len, int max_pitch)
 {
    int i, j;
 #ifdef FIXED_POINT
@@ -250,7 +250,7 @@
 #else
 void
 #endif
-pitch_xcorr(opus_val16 *_x, opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch)
+celt_pitch_xcorr(opus_val16 *_x, opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch)
 {
    int i,j;
 #ifdef FIXED_POINT
@@ -342,7 +342,7 @@
 #ifdef FIXED_POINT
    maxcorr =
 #endif
-   pitch_xcorr(x_lp4, y_lp4, xcorr, len>>2, max_pitch>>2);
+   celt_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
@@ -395,14 +395,14 @@
 }
 
 #ifndef OVERRIDE_DUAL_INNER_PROD
-static opus_val32 dual_inner_prod(opus_val16 *x, opus_val16 *y1, opus_val16 *y2, int N)
+static opus_val32 dual_inner_prod(opus_val16 *x, opus_val16 *y01, opus_val16 *y02, int N)
 {
    int i;
    opus_val32 xy=0;
    for (i=0;i<N;i++)
    {
-      xy = MAC16_16(xy, x[i], y1[i]);
-      xy = MAC16_16(xy, x[i], y2[i]);
+      xy = MAC16_16(xy, x[i], y01[i]);
+      xy = MAC16_16(xy, x[i], y02[i]);
    }
    return xy;
 }
--- a/celt/pitch.h
+++ b/celt/pitch.h
@@ -123,6 +123,6 @@
 #else
 void
 #endif
-pitch_xcorr(opus_val16 *_x, opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch);
+celt_pitch_xcorr(opus_val16 *_x, opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch);
 
 #endif
--- a/celt/x86/pitch_sse.h
+++ b/celt/x86/pitch_sse.h
@@ -72,7 +72,7 @@
 }
 
 #define OVERRIDE_DUAL_INNER_PROD
-static inline opus_val32 dual_inner_prod(const opus_val16 *x, const opus_val16 *y1, const opus_val16 *y2, int N)
+static inline opus_val32 dual_inner_prod(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, int N)
 {
    int i;
    __m128 xsum1, xsum2;
@@ -82,8 +82,8 @@
    for (i=0;i<N-3;i+=4)
    {
       __m128 xi = _mm_loadu_ps(x+i);
-      __m128 y1i = _mm_loadu_ps(y1+i);
-      __m128 y2i = _mm_loadu_ps(y2+i);
+      __m128 y1i = _mm_loadu_ps(y01+i);
+      __m128 y2i = _mm_loadu_ps(y02+i);
       xsum1 = _mm_add_ps(xsum1,_mm_mul_ps(xi, y1i));
       xsum2 = _mm_add_ps(xsum2,_mm_mul_ps(xi, y2i));
    }
@@ -94,8 +94,8 @@
    _mm_store_ss(&xy, xsum1);
    for (;i<N;i++)
    {
-      xy = MAC16_16(xy, x[i], y1[i]);
-      xy = MAC16_16(xy, x[i], y2[i]);
+      xy = MAC16_16(xy, x[i], y01[i]);
+      xy = MAC16_16(xy, x[i], y02[i]);
    }
    return xy;
 }