quic: Get rid of RLE #define

It's always set, no need to have conditional compilation based on it.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Christophe Fergeau 2017-08-03 16:24:31 +02:00 committed by Frediano Ziglio
parent fce119be44
commit d240af18a4
3 changed files with 0 additions and 33 deletions

View File

@ -29,8 +29,6 @@
#include "spice_common.h"
#include "bitops.h"
#define RLE
/* ASCII "QUIC" */
#define QUIC_MAGIC 0x43495551
#define QUIC_VERSION_MAJOR 0U
@ -488,8 +486,6 @@ static inline void decode_eat32bits(Encoder *encoder)
decode_eatbits(encoder, 16);
}
#ifdef RLE
static inline void encode_ones(Encoder *encoder, unsigned int n)
{
unsigned int count;
@ -658,7 +654,6 @@ static int decode_channel_run(Encoder *encoder, Channel *channel)
return runlen;
}
#endif
static inline void init_decode_io(Encoder *encoder)
{
@ -979,9 +974,7 @@ static int encoder_reset(Encoder *encoder, uint32_t *io_ptr, uint32_t *io_ptr_en
encoder->rgb_state.wmileft = DEFwminext;
set_wm_trigger(&encoder->rgb_state);
#if defined(RLE)
encoder_init_rle(&encoder->rgb_state);
#endif
encoder->io_words_count = io_ptr_end - io_ptr;
encoder->io_now = io_ptr;
@ -1041,9 +1034,7 @@ static int encoder_reset_channels(Encoder *encoder, int channels, int width, int
encoder->channels[i].state.wmileft = DEFwminext;
set_wm_trigger(&encoder->channels[i].state);
#if defined(RLE)
encoder_init_rle(&encoder->channels[i].state);
#endif
}
return TRUE;
}

View File

@ -153,16 +153,12 @@
correlate_row_b[index]);
#ifdef RLE
#define RLE_PRED_IMP \
if (SAME_PIXEL(&prev_row[i - 1], &prev_row[i])) { \
if (run_index != i && i > 2 && SAME_PIXEL(&cur_row[i - 1], &cur_row[i - 2])) { \
goto do_run; \
} \
}
#else
#define RLE_PRED_IMP
#endif
#ifdef COMPRESS_IMP
@ -289,10 +285,8 @@ static void FNAME(compress_row_seg)(Encoder *encoder, int i,
BYTE * const correlate_row_g = channel_g->correlate_row;
BYTE * const correlate_row_b = channel_b->correlate_row;
int stopidx;
#ifdef RLE
int run_index = 0;
int run_size;
#endif
spice_assert(end - i > 0);
@ -338,7 +332,6 @@ static void FNAME(compress_row_seg)(Encoder *encoder, int i,
return;
#ifdef RLE
do_run:
run_index = i;
encoder->rgb_state.waitcnt = stopidx - i;
@ -353,7 +346,6 @@ do_run:
}
encode_run(encoder, run_size);
stopidx = i + encoder->rgb_state.waitcnt;
#endif
}
}
@ -545,10 +537,8 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder,
BYTE * const correlate_row_b = channel_b->correlate_row;
const unsigned int waitmask = bppmask[encoder->rgb_state.wmidx];
int stopidx;
#ifdef RLE
int run_index = 0;
int run_end;
#endif
spice_assert(end - i > 0);
@ -599,7 +589,6 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder,
return;
#ifdef RLE
do_run:
encoder->rgb_state.waitcnt = stopidx - i;
run_index = i;
@ -617,7 +606,6 @@ do_run:
}
stopidx = i + encoder->rgb_state.waitcnt;
#endif
}
}

View File

@ -43,16 +43,12 @@
#define _PIXEL_A ((unsigned int)curr[-1].a)
#define _PIXEL_B ((unsigned int)prev[0].a)
#ifdef RLE
#define RLE_PRED_IMP \
if (prev_row[i - 1].a == prev_row[i].a) { \
if (run_index != i && i > 2 && cur_row[i - 1].a == cur_row[i - 2].a) { \
goto do_run; \
} \
}
#else
#define RLE_PRED_IMP
#endif
/* a */
static inline BYTE FNAME(decorrelate_0)(const PIXEL * const curr, const unsigned int bpc_mask)
@ -182,10 +178,8 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
{
BYTE * const decorrelate_drow = channel->correlate_row;
int stopidx;
#ifdef RLE
int run_index = 0;
int run_size;
#endif
spice_assert(end - i > 0);
@ -242,7 +236,6 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
return;
#ifdef RLE
do_run:
run_index = i;
channel->state.waitcnt = stopidx - i;
@ -257,7 +250,6 @@ do_run:
}
encode_channel_run(encoder, channel, run_size);
stopidx = i + channel->state.waitcnt;
#endif
}
}
@ -409,10 +401,8 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
{
const unsigned int waitmask = bppmask[channel->state.wmidx];
int stopidx;
#ifdef RLE
int run_index = 0;
int run_end;
#endif
spice_assert(end - i > 0);
@ -468,7 +458,6 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
return;
#ifdef RLE
do_run:
channel->state.waitcnt = stopidx - i;
run_index = i;
@ -483,7 +472,6 @@ do_run:
}
stopidx = i + channel->state.waitcnt;
#endif
}
}