From aad281878d650f680a895730eaa386df7cb3e8f0 Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" Date: Mon, 1 Dec 2014 10:47:25 -0800 Subject: [PATCH] Fix celt_pitch_xcorr_c signature. This should not take an arch parameter, so it can properly be used as a fallback for accelerated versions which do not. This patch instead provides a separate version which can call accelerated helpers for platforms that have taken that approach. --- celt/mips/pitch_mipsr1.h | 8 ++++++-- celt/pitch.c | 40 ++++++++++++++++++++++++---------------- celt/pitch.h | 19 ++++++++++++------- celt/x86/pitch_sse.h | 5 +++-- 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/celt/mips/pitch_mipsr1.h b/celt/mips/pitch_mipsr1.h index 9c5dc34d..e2f017e9 100644 --- a/celt/mips/pitch_mipsr1.h +++ b/celt/mips/pitch_mipsr1.h @@ -58,8 +58,8 @@ static inline void dual_inner_prod(const opus_val16 *x, const opus_val16 *y01, c *xy2 = xy02; } -#define OVERRIDE_XCORR_KERNEL -static inline void xcorr_kernel(const opus_val16 * x, const opus_val16 * y, opus_val32 sum[4], int len) +static inline void xcorr_kernel_mips(const opus_val16 * x, + const opus_val16 * y, opus_val32 sum[4], int len) { int j; opus_val16 y_0, y_1, y_2, y_3; @@ -151,4 +151,8 @@ static inline void xcorr_kernel(const opus_val16 * x, const opus_val16 * y, opus sum[3] = (opus_val32)sum_3; } +#define OVERRIDE_XCORR_KERNEL +#define xcorr_kernel(x, y, sum, len, arch) \ + ((void)(arch), xcorr_kernel_mips(x, y, sum, len)) + #endif /* PITCH_MIPSR1_H */ diff --git a/celt/pitch.c b/celt/pitch.c index 154c8484..43647030 100644 --- a/celt/pitch.c +++ b/celt/pitch.c @@ -214,25 +214,35 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x celt_fir5(x_lp, lpc2, x_lp, len>>1, mem); } -#if 0 /* This is a simple version of the pitch correlation that should work - well on DSPs like Blackfin and TI C5x/C6x */ - +/* Pure C implementation. */ #ifdef FIXED_POINT opus_val32 #else void #endif -celt_pitch_xcorr(opus_val16 *x, opus_val16 *y, opus_val32 *xcorr, int len, int max_pitch) +#if defined(OVERRIDE_PITCH_XCORR) +celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y, + opus_val32 *xcorr, int len, int max_pitch) +#else +celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, + opus_val32 *xcorr, int len, int max_pitch, int arch) +#endif { + +#if 0 /* This is a simple version of the pitch correlation that should work + well on DSPs like Blackfin and TI C5x/C6x */ int i, j; #ifdef FIXED_POINT opus_val32 maxcorr=1; +#endif +#if !defined(OVERRIDE_PITCH_XCORR) + (void)arch; #endif for (i=0;i