[Spice-devel] [spice-common v2 5/6] quic: Fix "corelate" typo
Christophe Fergeau
cfergeau at redhat.com
Tue Aug 1 13:55:08 UTC 2017
Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
common/quic_rgb_tmpl.c | 28 ++++++++--------
common/quic_tmpl.c | 88 +++++++++++++++++++++++++-------------------------
2 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c
index f3d07a5..15d14b9 100644
--- a/common/quic_rgb_tmpl.c
+++ b/common/quic_rgb_tmpl.c
@@ -114,20 +114,20 @@
/* a */
-#define DECORELATE_0(channel, curr, bpc_mask)\
+#define DECORRELATE_0(channel, curr, bpc_mask)\
family.xlatU2L[(unsigned)((int)GET_##channel(curr) - (int)_PIXEL_A(channel, curr)) & bpc_mask]
-#define CORELATE_0(channel, curr, correlate, bpc_mask)\
+#define CORRELATE_0(channel, curr, correlate, bpc_mask)\
((family.xlatL2U[correlate] + _PIXEL_A(channel, curr)) & bpc_mask)
#ifdef PRED_1
/* (a+b)/2 */
-#define DECORELATE(channel, prev, curr, bpc_mask, r) \
+#define DECORRELATE(channel, prev, curr, bpc_mask, r) \
r = family.xlatU2L[(unsigned)((int)GET_##channel(curr) - (int)((_PIXEL_A(channel, curr) + \
_PIXEL_B(channel, prev)) >> 1)) & bpc_mask]
-#define CORELATE(channel, prev, curr, correlate, bpc_mask, r) \
+#define CORRELATE(channel, prev, curr, correlate, bpc_mask, r) \
SET_##channel(r, ((family.xlatL2U[correlate] + \
(int)((_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev)) >> 1)) & bpc_mask))
#endif
@@ -135,7 +135,7 @@
#ifdef PRED_2
/* .75a+.75b-.5c */
-#define DECORELATE(channel, prev, curr, bpc_mask, r) { \
+#define DECORRELATE(channel, prev, curr, bpc_mask, r) { \
int p = ((int)(3 * (_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev))) - \
(int)(_PIXEL_C(channel, prev) << 1)) >> 2; \
if (p < 0) { \
@@ -146,7 +146,7 @@
r = family.xlatU2L[(unsigned)((int)GET_##channel(curr) - p) & bpc_mask]; \
}
-#define CORELATE(channel, prev, curr, correlate, bpc_mask, r) { \
+#define CORRELATE(channel, prev, curr, correlate, bpc_mask, r) { \
const int p = ((int)(3 * (_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev))) - \
(int)(_PIXEL_C(channel, prev) << 1) ) >> 2; \
const unsigned int s = family.xlatL2U[correlate]; \
@@ -170,7 +170,7 @@
encode(encoder, codeword, codewordlen);
#define COMPRESS_ONE_ROW0(channel, index) \
- correlate_row_##channel[index] = DECORELATE_0(channel, &cur_row[index], bpc_mask); \
+ correlate_row_##channel[index] = DECORRELATE_0(channel, &cur_row[index], bpc_mask); \
golomb_coding(correlate_row_##channel[index], find_bucket(channel_##channel, \
correlate_row_##channel[index -1])->bestcode, \
&codeword, &codewordlen); \
@@ -319,7 +319,7 @@ static void FNAME(compress_row0)(Encoder *encoder, const PIXEL *cur_row,
encode(encoder, codeword, codewordlen);
#define COMPRESS_ONE(channel, index) \
- DECORELATE(channel, &prev_row[index], &cur_row[index],bpc_mask, \
+ DECORRELATE(channel, &prev_row[index], &cur_row[index],bpc_mask, \
correlate_row_##channel[index]); \
golomb_coding(correlate_row_##channel[index], \
find_bucket(channel_##channel, correlate_row_##channel[index - 1])->bestcode, \
@@ -470,7 +470,7 @@ static void FNAME(compress_row)(Encoder *encoder,
correlate_row_##channel[i - 1])->bestcode, \
encoder->io_word, \
&codewordlen); \
- SET_##channel(&cur_row[i], CORELATE_0(channel, &cur_row[i], correlate_row_##channel[i], \
+ SET_##channel(&cur_row[i], CORRELATE_0(channel, &cur_row[i], correlate_row_##channel[i], \
bpc_mask)); \
decode_eatbits(encoder, codewordlen);
@@ -585,7 +585,7 @@ static void FNAME(uncompress_row0)(Encoder *encoder,
correlate_row_##channel[i - 1])->bestcode, \
encoder->io_word, \
&codewordlen); \
- CORELATE(channel, &prev_row[i], &cur_row[i], correlate_row_##channel[i], bpc_mask, \
+ CORRELATE(channel, &prev_row[i], &cur_row[i], correlate_row_##channel[i], bpc_mask, \
&cur_row[i]); \
decode_eatbits(encoder, codewordlen);
@@ -736,14 +736,14 @@ static void FNAME(uncompress_row)(Encoder *encoder,
#undef RLE_PRED_2_IMP
#undef RLE_PRED_3_IMP
#undef UPDATE_MODEL
-#undef DECORELATE_0
-#undef DECORELATE
+#undef DECORRELATE_0
+#undef DECORRELATE
#undef COMPRESS_ONE_ROW0_0
#undef COMPRESS_ONE_ROW0
#undef COMPRESS_ONE_0
#undef COMPRESS_ONE
-#undef CORELATE_0
-#undef CORELATE
+#undef CORRELATE_0
+#undef CORRELATE
#undef UNCOMPRESS_ONE_ROW0_0
#undef UNCOMPRESS_ONE_ROW0
#undef UNCOMPRESS_ONE_0
diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c
index 4f76743..b77dc07 100644
--- a/common/quic_tmpl.c
+++ b/common/quic_tmpl.c
@@ -83,31 +83,31 @@ if (i > 1 && cur_row[i - 1].a == cur_row[i - 2].a && i != run_index) { \
#endif
/* a */
-static inline BYTE FNAME(decorelate_0)(const PIXEL * const curr, const unsigned int bpc_mask)
+static inline BYTE FNAME(decorrelate_0)(const PIXEL * const curr, const unsigned int bpc_mask)
{
return family.xlatU2L[(unsigned)((int)curr[0].a - (int)_PIXEL_A) & bpc_mask];
}
-static inline void FNAME(corelate_0)(PIXEL *curr, const BYTE corelate,
- const unsigned int bpc_mask)
+static inline void FNAME(correlate_0)(PIXEL *curr, const BYTE correlate,
+ const unsigned int bpc_mask)
{
- curr->a = (family.xlatL2U[corelate] + _PIXEL_A) & bpc_mask;
+ curr->a = (family.xlatL2U[correlate] + _PIXEL_A) & bpc_mask;
}
#ifdef PRED_1
/* (a+b)/2 */
-static inline BYTE FNAME(decorelate)(const PIXEL *const prev, const PIXEL * const curr,
- const unsigned int bpc_mask)
+static inline BYTE FNAME(decorrelate)(const PIXEL *const prev, const PIXEL * const curr,
+ const unsigned int bpc_mask)
{
return family.xlatU2L[(unsigned)((int)curr->a - (int)((_PIXEL_A + _PIXEL_B) >> 1)) & bpc_mask];
}
-static inline void FNAME(corelate)(const PIXEL *prev, PIXEL *curr, const BYTE corelate,
- const unsigned int bpc_mask)
+static inline void FNAME(correlate)(const PIXEL *prev, PIXEL *curr, const BYTE correlate,
+ const unsigned int bpc_mask)
{
- curr->a = (family.xlatL2U[corelate] + (int)((_PIXEL_A + _PIXEL_B) >> 1)) & bpc_mask;
+ curr->a = (family.xlatL2U[correlate] + (int)((_PIXEL_A + _PIXEL_B) >> 1)) & bpc_mask;
}
#endif
@@ -115,8 +115,8 @@ static inline void FNAME(corelate)(const PIXEL *prev, PIXEL *curr, const BYTE co
#ifdef PRED_2
/* .75a+.75b-.5c */
-static inline BYTE FNAME(decorelate)(const PIXEL *const prev, const PIXEL * const curr,
- const unsigned int bpc_mask)
+static inline BYTE FNAME(decorrelate)(const PIXEL *const prev, const PIXEL * const curr,
+ const unsigned int bpc_mask)
{
int p = ((int)(3 * (_PIXEL_A + _PIXEL_B)) - (int)(_PIXEL_C << 1)) >> 2;
@@ -131,11 +131,11 @@ static inline BYTE FNAME(decorelate)(const PIXEL *const prev, const PIXEL * cons
}
}
-static inline void FNAME(corelate)(const PIXEL *prev, PIXEL *curr, const BYTE corelate,
- const unsigned int bpc_mask)
+static inline void FNAME(correlate)(const PIXEL *prev, PIXEL *curr, const BYTE correlate,
+ const unsigned int bpc_mask)
{
const int p = ((int)(3 * (_PIXEL_A + _PIXEL_B)) - (int)(_PIXEL_C << 1)) >> 2;
- const unsigned int s = family.xlatL2U[corelate];
+ const unsigned int s = family.xlatL2U[correlate];
if (!(p & ~bpc_mask)) {
curr->a = (s + (unsigned)p) & bpc_mask;
@@ -155,7 +155,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
- BYTE * const decorelate_drow = channel->correlate_row;
+ BYTE * const decorrelate_drow = channel->correlate_row;
int stopidx;
spice_assert(end - i > 0);
@@ -163,8 +163,8 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
if (i == 0) {
unsigned int codeword, codewordlen;
- decorelate_drow[0] = family.xlatU2L[cur_row->a];
- golomb_coding(decorelate_drow[0], find_bucket(channel, decorelate_drow[-1])->bestcode,
+ decorrelate_drow[0] = family.xlatU2L[cur_row->a];
+ golomb_coding(decorrelate_drow[0], find_bucket(channel, decorrelate_drow[-1])->bestcode,
&codeword, &codewordlen);
encode(encoder, codeword, codewordlen);
@@ -172,8 +172,8 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
channel->state.waitcnt--;
} else {
channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
- update_model(&channel->state, find_bucket(channel, decorelate_drow[-1]),
- decorelate_drow[i]);
+ update_model(&channel->state, find_bucket(channel, decorrelate_drow[-1]),
+ decorrelate_drow[i]);
}
stopidx = ++i + channel->state.waitcnt;
} else {
@@ -183,22 +183,22 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
while (stopidx < end) {
for (; i <= stopidx; i++) {
unsigned int codeword, codewordlen;
- decorelate_drow[i] = FNAME(decorelate_0)(&cur_row[i], bpc_mask);
- golomb_coding(decorelate_drow[i],
- find_bucket(channel, decorelate_drow[i - 1])->bestcode, &codeword,
+ decorrelate_drow[i] = FNAME(decorrelate_0)(&cur_row[i], bpc_mask);
+ golomb_coding(decorrelate_drow[i],
+ find_bucket(channel, decorrelate_drow[i - 1])->bestcode, &codeword,
&codewordlen);
encode(encoder, codeword, codewordlen);
}
- update_model(&channel->state, find_bucket(channel, decorelate_drow[stopidx - 1]),
- decorelate_drow[stopidx]);
+ update_model(&channel->state, find_bucket(channel, decorrelate_drow[stopidx - 1]),
+ decorrelate_drow[stopidx]);
stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
}
for (; i < end; i++) {
unsigned int codeword, codewordlen;
- decorelate_drow[i] = FNAME(decorelate_0)(&cur_row[i], bpc_mask);
- golomb_coding(decorelate_drow[i], find_bucket(channel, decorelate_drow[i - 1])->bestcode,
+ decorrelate_drow[i] = FNAME(decorrelate_0)(&cur_row[i], bpc_mask);
+ golomb_coding(decorrelate_drow[i], find_bucket(channel, decorrelate_drow[i - 1])->bestcode,
&codeword, &codewordlen);
encode(encoder, codeword, codewordlen);
}
@@ -246,7 +246,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
- BYTE * const decorelate_drow = channel->correlate_row;
+ BYTE * const decorrelate_drow = channel->correlate_row;
int stopidx;
#ifdef RLE
int run_index = 0;
@@ -258,11 +258,11 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
if (!i) {
unsigned int codeword, codewordlen;
- decorelate_drow[0] = family.xlatU2L[(unsigned)((int)cur_row->a -
+ decorrelate_drow[0] = family.xlatU2L[(unsigned)((int)cur_row->a -
(int)prev_row->a) & bpc_mask];
- golomb_coding(decorelate_drow[0],
- find_bucket(channel, decorelate_drow[-1])->bestcode,
+ golomb_coding(decorrelate_drow[0],
+ find_bucket(channel, decorrelate_drow[-1])->bestcode,
&codeword,
&codewordlen);
encode(encoder, codeword, codewordlen);
@@ -271,8 +271,8 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
channel->state.waitcnt--;
} else {
channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
- update_model(&channel->state, find_bucket(channel, decorelate_drow[-1]),
- decorelate_drow[0]);
+ update_model(&channel->state, find_bucket(channel, decorrelate_drow[-1]),
+ decorrelate_drow[0]);
}
stopidx = ++i + channel->state.waitcnt;
} else {
@@ -287,15 +287,15 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
RLE_PRED_2_IMP;
RLE_PRED_3_IMP;
#endif
- decorelate_drow[i] = FNAME(decorelate)(&prev_row[i], &cur_row[i], bpc_mask);
- golomb_coding(decorelate_drow[i],
- find_bucket(channel, decorelate_drow[i - 1])->bestcode, &codeword,
+ decorrelate_drow[i] = FNAME(decorrelate)(&prev_row[i], &cur_row[i], bpc_mask);
+ golomb_coding(decorrelate_drow[i],
+ find_bucket(channel, decorrelate_drow[i - 1])->bestcode, &codeword,
&codewordlen);
encode(encoder, codeword, codewordlen);
}
- update_model(&channel->state, find_bucket(channel, decorelate_drow[stopidx - 1]),
- decorelate_drow[stopidx]);
+ update_model(&channel->state, find_bucket(channel, decorrelate_drow[stopidx - 1]),
+ decorrelate_drow[stopidx]);
stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
}
@@ -306,9 +306,9 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
RLE_PRED_2_IMP;
RLE_PRED_3_IMP;
#endif
- decorelate_drow[i] = FNAME(decorelate)(&prev_row[i], &cur_row[i], bpc_mask);
- golomb_coding(decorelate_drow[i], find_bucket(channel,
- decorelate_drow[i - 1])->bestcode,
+ decorrelate_drow[i] = FNAME(decorrelate)(&prev_row[i], &cur_row[i], bpc_mask);
+ golomb_coding(decorrelate_drow[i], find_bucket(channel,
+ decorrelate_drow[i - 1])->bestcode,
&codeword, &codewordlen);
encode(encoder, codeword, codewordlen);
}
@@ -422,7 +422,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
pbucket = find_bucket(channel, correlate_row[i - 1]);
correlate_row[i] = (BYTE)golomb_decoding(pbucket->bestcode, encoder->io_word,
&codewordlen);
- FNAME(corelate_0)(&cur_row[i], correlate_row[i], bpc_mask);
+ FNAME(correlate_0)(&cur_row[i], correlate_row[i], bpc_mask);
decode_eatbits(encoder, codewordlen);
}
@@ -437,7 +437,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
correlate_row[i] = (BYTE)golomb_decoding(find_bucket(channel,
correlate_row[i - 1])->bestcode,
encoder->io_word, &codewordlen);
- FNAME(corelate_0)(&cur_row[i], correlate_row[i], bpc_mask);
+ FNAME(correlate_0)(&cur_row[i], correlate_row[i], bpc_mask);
decode_eatbits(encoder, codewordlen);
}
channel->state.waitcnt = stopidx - end;
@@ -531,7 +531,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
pbucket = find_bucket(channel, correlate_row[i - 1]);
correlate_row[i] = (BYTE)golomb_decoding(pbucket->bestcode, encoder->io_word,
&codewordlen);
- FNAME(corelate)(&prev_row[i], &cur_row[i], correlate_row[i], bpc_mask);
+ FNAME(correlate)(&prev_row[i], &cur_row[i], correlate_row[i], bpc_mask);
decode_eatbits(encoder, codewordlen);
}
@@ -550,7 +550,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
correlate_row[i] = (BYTE)golomb_decoding(find_bucket(channel,
correlate_row[i - 1])->bestcode,
encoder->io_word, &codewordlen);
- FNAME(corelate)(&prev_row[i], &cur_row[i], correlate_row[i], bpc_mask);
+ FNAME(correlate)(&prev_row[i], &cur_row[i], correlate_row[i], bpc_mask);
decode_eatbits(encoder, codewordlen);
}
--
2.13.3
More information about the Spice-devel
mailing list