Commit e3d3ace3 authored by Deb Mukherjee's avatar Deb Mukherjee Committed by Gerrit Code Review
Browse files

Merge "Minor change in forward updates" into experimental

parents 47f10df8 a4d906c1
......@@ -156,13 +156,14 @@ static int merge_index(int v, int n, int modulus) {
}
static int inv_remap_prob(int v, int m) {
const int n = 256;
const int n = 255;
v = merge_index(v, n - 1, MODULUS_PARAM);
m--;
if ((m << 1) <= n) {
return inv_recenter_nonneg(v + 1, m);
return 1 + inv_recenter_nonneg(v + 1, m);
} else {
return n - 1 - inv_recenter_nonneg(v + 1, n - 1 - m);
return n - inv_recenter_nonneg(v + 1, n - 1 - m);
}
}
......
......@@ -265,7 +265,7 @@ int count_term_subexp(int word, int k, int num_syms) {
static void compute_update_table() {
int i;
for (i = 0; i < 255; i++)
for (i = 0; i < 254; i++)
update_bits[i] = count_term_subexp(i, SUBEXP_PARAM, 255);
}
......@@ -277,9 +277,11 @@ static int split_index(int i, int n, int modulus) {
}
static int remap_prob(int v, int m) {
const int n = 256;
const int n = 255;
const int modulus = MODULUS_PARAM;
int i;
v--;
m--;
if ((m << 1) <= n)
i = recenter_nonneg(v, m) - 1;
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment