ref: 5607d5d1c8f0d7110927bb145754017a84059e3a
parent: 32ada84b5b5a147c38c428fb0863d419dd802b37
author: Jean-Marc Valin <[email protected]>
date: Tue Dec 10 13:10:27 EST 2013
Annotating pointer arguments with OPUS_RESTRICT and const
--- a/celt/bands.c
+++ b/celt/bands.c
@@ -253,8 +253,8 @@
/* This prevents energy collapse for transients with multiple short MDCTs */
void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size,
- int start, int end, opus_val16 *logE, opus_val16 *prev1logE,
- opus_val16 *prev2logE, int *pulses, opus_uint32 seed)
+ int start, int end, const opus_val16 *logE, const opus_val16 *prev1logE,
+ const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed)
{
int c, i, j, k;
for (i=start;i<end;i++)
@@ -347,7 +347,7 @@
}
}
-static void intensity_stereo(const CELTMode *m, celt_norm *X, celt_norm *Y, const celt_ener *bandE, int bandID, int N)
+static void intensity_stereo(const CELTMode *m, celt_norm * OPUS_RESTRICT X, const celt_norm * OPUS_RESTRICT Y, const celt_ener *bandE, int bandID, int N)
{
int i = bandID;
int j;
@@ -372,7 +372,7 @@
}
}
-static void stereo_split(celt_norm *X, celt_norm *Y, int N)
+static void stereo_split(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT Y, int N)
{
int j;
for (j=0;j<N;j++)
@@ -385,7 +385,7 @@
}
}
-static void stereo_merge(celt_norm *X, celt_norm *Y, opus_val16 mid, int N)
+static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT Y, opus_val16 mid, int N)
{
int j;
opus_val32 xp=0, side=0;
@@ -438,7 +438,7 @@
}
/* Decide whether we should spread the pulses in the current frame */
-int spreading_decision(const CELTMode *m, celt_norm *X, int *average,
+int spreading_decision(const CELTMode *m, const celt_norm *X, int *average,
int last_decision, int *hf_average, int *tapset_decision, int update_hf,
int end, int C, int M)
{
@@ -459,7 +459,7 @@
{
int j, N, tmp=0;
int tcount[3] = {0,0,0};
- celt_norm * OPUS_RESTRICT x = X+M*eBands[i]+c*N0;
+ const celt_norm * OPUS_RESTRICT x = X+M*eBands[i]+c*N0;
N = M*(eBands[i+1]-eBands[i]);
if (N<=8)
continue;
--- a/celt/bands.h
+++ b/celt/bands.h
@@ -66,7 +66,7 @@
#define SPREAD_NORMAL (2)
#define SPREAD_AGGRESSIVE (3)
-int spreading_decision(const CELTMode *m, celt_norm *X, int *average,
+int spreading_decision(const CELTMode *m, const celt_norm *X, int *average,
int last_decision, int *hf_average, int *tapset_decision, int update_hf,
int end, int C, int M);
@@ -104,8 +104,8 @@
opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed);
void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size,
- int start, int end, opus_val16 *logE, opus_val16 *prev1logE,
- opus_val16 *prev2logE, int *pulses, opus_uint32 seed);
+ int start, int end, const opus_val16 *logE, const opus_val16 *prev1logE,
+ const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed);
opus_uint32 celt_lcg_rand(opus_uint32 seed);
--- a/celt/vq.c
+++ b/celt/vq.c
@@ -371,7 +371,7 @@
/*return celt_sqrt(E);*/
}
-int stereo_itheta(celt_norm *X, celt_norm *Y, int stereo, int N)
+int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N)
{
int i;
int itheta;
--- a/celt/vq.h
+++ b/celt/vq.h
@@ -65,6 +65,6 @@
void renormalise_vector(celt_norm *X, int N, opus_val16 gain);
-int stereo_itheta(celt_norm *X, celt_norm *Y, int stereo, int N);
+int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N);
#endif /* VQ_H */