quic: Use DEFwminext constant rather than wminext variable

We never change its value, so we basically have 2 constants for the
same thing, DEFwminext and wminext. This commit removes the latter

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Christophe Fergeau 2017-08-01 15:03:37 +02:00
parent db5bff3728
commit f122d3dadc
3 changed files with 18 additions and 21 deletions

View File

@ -175,9 +175,6 @@ struct Encoder {
/* target wait mask index */
static const int wmimax = DEFwmimax;
/* number of symbols to encode before increasing wait mask index */
static const int wminext = DEFwminext;
/* bppmask[i] contains i ones as lsb-s */
static const unsigned long int bppmask[33] = {
0x00000000, /* [0] */
@ -1066,7 +1063,7 @@ static int encoder_reset(Encoder *encoder, uint32_t *io_ptr, uint32_t *io_ptr_en
encoder->rgb_state.waitcnt = 0;
encoder->rgb_state.tabrand_seed = stabrand();
encoder->rgb_state.wmidx = DEFwmistart;
encoder->rgb_state.wmileft = wminext;
encoder->rgb_state.wmileft = DEFwminext;
set_wm_trigger(&encoder->rgb_state);
#if defined(RLE) && defined(RLE_STAT)
@ -1130,7 +1127,7 @@ static int encoder_reset_channels(Encoder *encoder, int channels, int width, int
encoder->channels[i].state.waitcnt = 0;
encoder->channels[i].state.tabrand_seed = stabrand();
encoder->channels[i].state.wmidx = DEFwmistart;
encoder->channels[i].state.wmileft = wminext;
encoder->channels[i].state.wmileft = DEFwminext;
set_wm_trigger(&encoder->channels[i].state);
#if defined(RLE) && defined(RLE_STAT)

View File

@ -294,7 +294,7 @@ static void FNAME(compress_row0)(Encoder *encoder, const PIXEL *cur_row,
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
encoder->rgb_state.wmileft = DEFwminext;
}
if (width) {
@ -307,7 +307,7 @@ static void FNAME(compress_row0)(Encoder *encoder, const PIXEL *cur_row,
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
#define COMPRESS_ONE_0(channel) \
@ -440,7 +440,7 @@ static void FNAME(compress_row)(Encoder *encoder,
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
encoder->rgb_state.wmileft = DEFwminext;
}
if (width) {
@ -453,7 +453,7 @@ static void FNAME(compress_row)(Encoder *encoder,
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
#endif
@ -556,7 +556,7 @@ static void FNAME(uncompress_row0)(Encoder *encoder,
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
encoder->rgb_state.wmileft = DEFwminext;
}
if (width) {
@ -569,7 +569,7 @@ static void FNAME(uncompress_row0)(Encoder *encoder,
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
#define UNCOMPRESS_ONE_0(channel) \
@ -710,7 +710,7 @@ static void FNAME(uncompress_row)(Encoder *encoder,
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
encoder->rgb_state.wmileft = DEFwminext;
}
if (width) {
@ -723,7 +723,7 @@ static void FNAME(uncompress_row)(Encoder *encoder,
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
#undef PIXEL

View File

@ -222,7 +222,7 @@ static void FNAME(compress_row0)(Encoder *encoder, Channel *channel, const PIXEL
channel->state.wmidx++;
set_wm_trigger(&channel->state);
channel->state.wmileft = wminext;
channel->state.wmileft = DEFwminext;
}
if (width) {
@ -235,7 +235,7 @@ static void FNAME(compress_row0)(Encoder *encoder, Channel *channel, const PIXEL
spice_assert((int)channel->state.wmidx <= wmimax);
spice_assert(channel->state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
@ -364,7 +364,7 @@ static void FNAME(compress_row)(Encoder *encoder, Channel *channel,
channel->state.wmidx++;
set_wm_trigger(&channel->state);
channel->state.wmileft = wminext;
channel->state.wmileft = DEFwminext;
}
if (width) {
@ -377,7 +377,7 @@ static void FNAME(compress_row)(Encoder *encoder, Channel *channel,
spice_assert((int)channel->state.wmidx <= wmimax);
spice_assert(channel->state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i,
@ -464,7 +464,7 @@ static void FNAME(uncompress_row0)(Encoder *encoder, Channel *channel,
channel->state.wmidx++;
set_wm_trigger(&channel->state);
channel->state.wmileft = wminext;
channel->state.wmileft = DEFwminext;
}
if (width) {
@ -477,7 +477,7 @@ static void FNAME(uncompress_row0)(Encoder *encoder, Channel *channel,
spice_assert((int)channel->state.wmidx <= wmimax);
spice_assert(channel->state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
@ -602,7 +602,7 @@ static void FNAME(uncompress_row)(Encoder *encoder, Channel *channel,
channel->state.wmidx++;
set_wm_trigger(&channel->state);
channel->state.wmileft = wminext;
channel->state.wmileft = DEFwminext;
}
if (width) {
@ -615,7 +615,7 @@ static void FNAME(uncompress_row)(Encoder *encoder, Channel *channel,
spice_assert((int)channel->state.wmidx <= wmimax);
spice_assert(channel->state.wmidx <= 32);
spice_assert(wminext > 0);
spice_assert(DEFwminext > 0);
}
#undef PIXEL