summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-08 21:03:25 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2013-09-12 13:49:25 +0200
commit8db88d28543b2f147a9e5b4bf6b0e5b5eba1c1c9 (patch)
tree3b1c3772af78c99483f532bdb67c7b0d8f0d28ca
parenta7b93bd43d113af16220f86cbf3cd451ab859d7e (diff)
quic: compile with constant bpp
This simplifies a little bit function calling, and allows for compiler to potentially specialize and optimize a bit better each version.
-rw-r--r--common/quic_family_tmpl.c4
-rw-r--r--common/quic_rgb_tmpl.c6
-rw-r--r--common/quic_tmpl.c16
3 files changed, 13 insertions, 13 deletions
diff --git a/common/quic_family_tmpl.c b/common/quic_family_tmpl.c
index cca2c05..287ff6d 100644
--- a/common/quic_family_tmpl.c
+++ b/common/quic_family_tmpl.c
@@ -74,13 +74,13 @@ static unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned
/* update the bucket using just encoded curval */
static void FNAME(update_model)(CommonState *state, s_bucket * const bucket,
- const BYTE curval, unsigned int bpp)
+ const BYTE curval)
{
+ const unsigned int bpp = BPC;
COUNTER * const pcounters = bucket->pcounters;
unsigned int i;
unsigned int bestcode;
unsigned int bestcodelen;
- //unsigned int bpp = encoder->bpp;
/* update counters, find minimum */
diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c
index 37c908c..19cc348 100644
--- a/common/quic_rgb_tmpl.c
+++ b/common/quic_rgb_tmpl.c
@@ -178,11 +178,11 @@
#define UPDATE_MODEL(index) \
update_model(&encoder->rgb_state, find_bucket(channel_r, correlate_row_r[index - 1]), \
- correlate_row_r[index], bpc); \
+ correlate_row_r[index]); \
update_model(&encoder->rgb_state, find_bucket(channel_g, correlate_row_g[index - 1]), \
- correlate_row_g[index], bpc); \
+ correlate_row_g[index]); \
update_model(&encoder->rgb_state, find_bucket(channel_b, correlate_row_b[index - 1]), \
- correlate_row_b[index], bpc);
+ correlate_row_b[index]);
#ifdef RLE_PRED_1
diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c
index b625daf..75f2ff0 100644
--- a/common/quic_tmpl.c
+++ b/common/quic_tmpl.c
@@ -173,7 +173,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
} else {
channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
update_model(&channel->state, find_bucket(channel, decorelate_drow[-1]),
- decorelate_drow[i], bpc);
+ decorelate_drow[i]);
}
stopidx = ++i + channel->state.waitcnt;
} else {
@@ -191,7 +191,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
}
update_model(&channel->state, find_bucket(channel, decorelate_drow[stopidx - 1]),
- decorelate_drow[stopidx], bpc);
+ decorelate_drow[stopidx]);
stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
}
@@ -272,7 +272,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
} else {
channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
update_model(&channel->state, find_bucket(channel, decorelate_drow[-1]),
- decorelate_drow[0], bpc);
+ decorelate_drow[0]);
}
stopidx = ++i + channel->state.waitcnt;
} else {
@@ -295,7 +295,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
}
update_model(&channel->state, find_bucket(channel, decorelate_drow[stopidx - 1]),
- decorelate_drow[stopidx], bpc);
+ decorelate_drow[stopidx]);
stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
}
@@ -406,7 +406,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
} else {
channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
update_model(&channel->state, find_bucket(channel, correlate_row[-1]),
- correlate_row[0], bpc);
+ correlate_row[0]);
}
stopidx = ++i + channel->state.waitcnt;
} else {
@@ -426,7 +426,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
decode_eatbits(encoder, codewordlen);
}
- update_model(&channel->state, pbucket, correlate_row[stopidx], bpc);
+ update_model(&channel->state, pbucket, correlate_row[stopidx]);
stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
}
@@ -511,7 +511,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
} else {
channel->state.waitcnt = (tabrand(&channel->state.tabrand_seed) & waitmask);
update_model(&channel->state, find_bucket(channel, correlate_row[-1]),
- correlate_row[0], bpc);
+ correlate_row[0]);
}
stopidx = ++i + channel->state.waitcnt;
} else {
@@ -535,7 +535,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
decode_eatbits(encoder, codewordlen);
}
- update_model(&channel->state, pbucket, correlate_row[stopidx], bpc);
+ update_model(&channel->state, pbucket, correlate_row[stopidx]);
stopidx = i + (tabrand(&channel->state.tabrand_seed) & waitmask);
}