ref: c9c2035355b8e028d1b62992b277b0c376634cf3
parent: 50d6701e2a0352954026caf40383d10dad3a2be4
author: Rhishikesh Agashe <[email protected]>
date: Wed Oct 7 09:55:12 EDT 2015
Fixes compile problems for MIPS Brings MIPS in sync with the ARM/SSE optimizations that added "arch" parameters. Signed-off-by: Jean-Marc Valin <[email protected]>
--- a/celt/mips/celt_mipsr1.h
+++ b/celt/mips/celt_mipsr1.h
@@ -61,6 +61,8 @@
int i;
opus_val32 x0, x1, x2, x3, x4;
+ (void)arch;
+
/* printf ("%d %d %f %f\n", T0, T1, g0, g1); */
opus_val16 g00, g01, g02, g10, g11, g12;
static const opus_val16 gains[3][3] = {
--- a/celt/mips/pitch_mipsr1.h
+++ b/celt/mips/pitch_mipsr1.h
@@ -36,11 +36,14 @@
#define OVERRIDE_DUAL_INNER_PROD
static inline void dual_inner_prod(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02,
- int N, opus_val32 *xy1, opus_val32 *xy2)
+ int N, opus_val32 *xy1, opus_val32 *xy2, int arch)
{
int j;
opus_val32 xy01=0;
opus_val32 xy02=0;
+
+ (void)arch;
+
asm volatile("MULT $ac1, $0, $0");
asm volatile("MULT $ac2, $0, $0");
/* Compute the norm of X+Y and X-Y as |X|^2 + |Y|^2 +/- sum(xy) */
--- a/celt/mips/vq_mipsr1.h
+++ b/celt/mips/vq_mipsr1.h
@@ -34,16 +34,12 @@
#endif
#include "mathops.h"
-#include "cwrs.h"
-#include "vq.h"
#include "arch.h"
-#include "os_support.h"
-#include "bands.h"
-#include "rate.h"
static unsigned extract_collapse_mask(int *iy, int N, int B);
static void normalise_residual(int * OPUS_RESTRICT iy, celt_norm * OPUS_RESTRICT X, int N, opus_val32 Ryy, opus_val16 gain);
static void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread);
+static void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain, int arch);
#define OVERRIDE_vq_exp_rotation1
static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s)
@@ -75,9 +71,9 @@
#define OVERRIDE_renormalise_vector
#define renormalise_vector(X, N, gain, arch) \
- ((void)(arch), renormalize_vector_mips(x, N, gain))
+ (renormalise_vector_mips(X, N, gain, arch))
-void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain)
+void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain, int arch)
{
int i;
#ifdef FIXED_POINT
@@ -87,8 +83,10 @@
opus_val16 g;
opus_val32 t;
celt_norm *xptr = X;
+ int X0, X1;
- int X0, X2, X3, X1;
+ (void)arch;
+
asm volatile("mult $ac1, $0, $0");
asm volatile("MTLO %0, $ac1" : :"r" (E));
/*if(N %4)
--- a/celt/vq.c
+++ b/celt/vq.c
@@ -39,10 +39,6 @@
#include "rate.h"
#include "pitch.h"
-#if defined(MIPSr1_ASM)
-#include "mips/vq_mipsr1.h"
-#endif
-
#ifndef OVERRIDE_vq_exp_rotation1
static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s)
{
--- a/celt/vq.h
+++ b/celt/vq.h
@@ -37,6 +37,11 @@
#include "entdec.h"
#include "modes.h"
+#if defined(MIPSr1_ASM)
+#include "mips/vq_mipsr1.h"
+#endif
+
+
/** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of
* the pitch and a combination of pulses such that its norm is still equal
* to 1. This is the function that will typically require the most CPU.
--- a/silk/fixed/mips/prefilter_FIX_mipsr1.h
+++ b/silk/fixed/mips/prefilter_FIX_mipsr1.h
@@ -43,7 +43,8 @@
const opus_int16 input[], /* I Input signal [length] */
const opus_int16 lambda_Q16, /* I Warping factor */
const opus_int length, /* I Length of input signal */
- const opus_int order /* I Filter order (even) */
+ const opus_int order, /* I Filter order (even) */
+ int arch
)
{
opus_int n, i;
@@ -50,8 +51,10 @@
opus_int32 acc_Q11, acc_Q22, tmp1, tmp2, tmp3, tmp4;
opus_int32 state_cur, state_next;
+ (void)arch;
+
/* Order must be even */
- /*Length must be even */
+ /* Length must be even */
silk_assert( ( order & 1 ) == 0 );
silk_assert( ( length & 1 ) == 0 );
--- a/silk/fixed/prefilter_FIX.c
+++ b/silk/fixed/prefilter_FIX.c
@@ -38,6 +38,11 @@
#endif
+#if !defined(OVERRIDE_silk_warped_LPC_analysis_filter_FIX)
+#define silk_warped_LPC_analysis_filter_FIX(state, res_Q2, coef_Q13, input, lambda_Q16, length, order, arch) \
+ ((void)(arch),silk_warped_LPC_analysis_filter_FIX_c(state, res_Q2, coef_Q13, input, lambda_Q16, length, order))
+#endif
+
/* Prefilter for finding Quantizer input signal */
static OPUS_INLINE void silk_prefilt_FIX(
silk_prefilter_state_FIX *P, /* I/O state */
--- a/silk/main.h
+++ b/silk/main.h
@@ -468,23 +468,4 @@
opus_int condCoding /* I The type of conditional coding to use */
);
-void silk_warped_LPC_analysis_filter_FIX_c(
- opus_int32 state[], /* I/O State [order + 1] */
- opus_int32 res_Q2[], /* O Residual signal [length] */
- const opus_int16 coef_Q13[], /* I Coefficients [order] */
- const opus_int16 input[], /* I Input signal [length] */
- const opus_int16 lambda_Q16, /* I Warping factor */
- const opus_int length, /* I Length of input signal */
- const opus_int order /* I Filter order (even) */
-);
-
-#if !defined(OVERRIDE_silk_warped_LPC_analysis_filter_FIX)
-#define silk_warped_LPC_analysis_filter_FIX(state, res_Q2, coef_Q13, input, lambda_Q16, length, order, arch) \
- ((void)(arch),silk_warped_LPC_analysis_filter_FIX_c(state, res_Q2, coef_Q13, input, lambda_Q16, length, order))
-#endif
-
-#if !defined(OPUS_X86_MAY_HAVE_SSE4_1)
-
-#endif
-
#endif