Commit 5de868c6 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

A bunch of pointers marked as "restrict" to ease the job of the compiler

parent 1bc8a2e4
...@@ -269,7 +269,7 @@ void compute_pitch_gain(const CELTMode *m, const celt_norm_t *X, const celt_norm ...@@ -269,7 +269,7 @@ void compute_pitch_gain(const CELTMode *m, const celt_norm_t *X, const celt_norm
} }
/* Apply the (quantised) gain to each "pitch band" */ /* Apply the (quantised) gain to each "pitch band" */
void pitch_quant_bands(const CELTMode *m, celt_norm_t *P, const celt_pgain_t *gains) void pitch_quant_bands(const CELTMode *m, celt_norm_t * restrict P, const celt_pgain_t * restrict gains)
{ {
int i, B; int i, B;
const celt_int16_t *pBands = m->pBands; const celt_int16_t *pBands = m->pBands;
...@@ -287,7 +287,7 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t *P, const celt_pgain_t *ga ...@@ -287,7 +287,7 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t *P, const celt_pgain_t *ga
/* Quantisation of the residual */ /* Quantisation of the residual */
void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_mask_t *W, int total_bits, ec_enc *enc) void quant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, celt_mask_t *W, int total_bits, ec_enc *enc)
{ {
int i, j, B, bits; int i, j, B, bits;
const celt_int16_t *eBands = m->eBands; const celt_int16_t *eBands = m->eBands;
...@@ -347,7 +347,7 @@ void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_mask_t ...@@ -347,7 +347,7 @@ void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_mask_t
} }
/* Decoding of the residual */ /* Decoding of the residual */
void unquant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, int total_bits, ec_dec *dec) void unquant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, int total_bits, ec_dec *dec)
{ {
int i, j, B, bits; int i, j, B, bits;
const celt_int16_t *eBands = m->eBands; const celt_int16_t *eBands = m->eBands;
......
...@@ -147,7 +147,7 @@ celt_uint64_t ncwrs64(int _n,int _m) ...@@ -147,7 +147,7 @@ celt_uint64_t ncwrs64(int _n,int _m)
with associated sign bits. with associated sign bits.
_x: Returns the combination with elements sorted in ascending order. _x: Returns the combination with elements sorted in ascending order.
_s: Returns the associated sign bits.*/ _s: Returns the associated sign bits.*/
void cwrsi(int _n,int _m,celt_uint32_t _i,int *_x,int *_s){ void cwrsi(int _n,int _m,celt_uint32_t _i,int * restrict _x,int * restrict _s){
int j; int j;
int k; int k;
VARDECL(celt_uint32_t, nc); VARDECL(celt_uint32_t, nc);
...@@ -237,7 +237,7 @@ celt_uint32_t icwrs(int _n,int _m,const int *_x,const int *_s, celt_uint32_t *bo ...@@ -237,7 +237,7 @@ celt_uint32_t icwrs(int _n,int _m,const int *_x,const int *_s, celt_uint32_t *bo
with associated sign bits. with associated sign bits.
_x: Returns the combination with elements sorted in ascending order. _x: Returns the combination with elements sorted in ascending order.
_s: Returns the associated sign bits.*/ _s: Returns the associated sign bits.*/
void cwrsi64(int _n,int _m,celt_uint64_t _i,int *_x,int *_s){ void cwrsi64(int _n,int _m,celt_uint64_t _i,int * restrict _x,int * restrict _s){
int j; int j;
int k; int k;
VARDECL(celt_uint64_t, nc); VARDECL(celt_uint64_t, nc);
......
...@@ -129,7 +129,7 @@ static void spreading_func(const struct PsyDecay *d, celt_word32_t * restrict ps ...@@ -129,7 +129,7 @@ static void spreading_func(const struct PsyDecay *d, celt_word32_t * restrict ps
} }
/* Compute a marking threshold from the spectrum X. */ /* Compute a marking threshold from the spectrum X. */
void compute_masking(const struct PsyDecay *decay, celt_word16_t *X, celt_mask_t *mask, int len) void compute_masking(const struct PsyDecay *decay, celt_word16_t *X, celt_mask_t * restrict mask, int len)
{ {
int i; int i;
int N; int N;
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
/** Takes the pitch vector and the decoded residual vector (non-compressed), /** Takes the pitch vector and the decoded residual vector (non-compressed),
applies the compression in the pitch direction, computes the gain that will applies the compression in the pitch direction, computes the gain that will
give ||p+g*y||=1 and mixes the residual with the pitch. */ give ||p+g*y||=1 and mixes the residual with the pitch. */
static void mix_pitch_and_residual(int *iy, celt_norm_t *X, int N, int K, const celt_norm_t *P) static void mix_pitch_and_residual(int * restrict iy, celt_norm_t * restrict X, int N, int K, const celt_norm_t * restrict P)
{ {
int i; int i;
celt_word32_t Ryp, Ryy, Rpp; celt_word32_t Ryp, Ryy, Rpp;
...@@ -240,7 +240,7 @@ static const celt_word16_t pg[11] = {1.f, .75f, .65f, 0.6f, 0.6f, .6f, .55f, .55 ...@@ -240,7 +240,7 @@ static const celt_word16_t pg[11] = {1.f, .75f, .65f, 0.6f, 0.6f, .6f, .55f, .55
#define MAX_INTRA 32 #define MAX_INTRA 32
#define LOG_MAX_INTRA 5 #define LOG_MAX_INTRA 5
void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_enc *enc) void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t *Y, celt_norm_t * restrict P, int B, int N0, ec_enc *enc)
{ {
int i,j; int i,j;
int best=0; int best=0;
...@@ -318,7 +318,7 @@ void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t ...@@ -318,7 +318,7 @@ void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t
} }
void intra_unquant(celt_norm_t *x, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_dec *dec) void intra_unquant(celt_norm_t *x, int N, int K, celt_norm_t *Y, celt_norm_t * restrict P, int B, int N0, ec_dec *dec)
{ {
int j; int j;
int sign; int sign;
...@@ -363,7 +363,7 @@ void intra_unquant(celt_norm_t *x, int N, int K, celt_norm_t *Y, celt_norm_t *P, ...@@ -363,7 +363,7 @@ void intra_unquant(celt_norm_t *x, int N, int K, celt_norm_t *Y, celt_norm_t *P,
} }
} }
void intra_fold(celt_norm_t *x, int N, celt_norm_t *Y, celt_norm_t *P, int B, int N0, int Nmax) void intra_fold(celt_norm_t *x, int N, celt_norm_t *Y, celt_norm_t * restrict P, int B, int N0, int Nmax)
{ {
int i, j; int i, j;
celt_word32_t E; celt_word32_t E;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment