X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=narabu.cpp;h=2eb29dcd46877d788de0ee43a03e443352b1308b;hb=df4a4d5d7ee4fa1752d0c17893ebcf0d659f4529;hp=1419ff0bc42a57c64600983002dab6136dcec466;hpb=0d22d7fb73e0c14431a15c7bb0522d0691452a31;p=narabu diff --git a/narabu.cpp b/narabu.cpp index 1419ff0..2eb29dc 100644 --- a/narabu.cpp +++ b/narabu.cpp @@ -122,11 +122,11 @@ int main(int argc, char **argv) exit(1); } - decode_tables[table].dsyms[(sym + 1) & 255].sym_start = cum_freq; - decode_tables[table].dsyms[(sym + 1) & 255].sym_freq = *freq; + decode_tables[table].dsyms[(sym + 1) & (NUM_SYMS - 1)].sym_start = cum_freq; + decode_tables[table].dsyms[(sym + 1) & (NUM_SYMS - 1)].sym_freq = *freq; for (uint32_t i = 0; i < freq; ++i) { if (cum_freq < prob_scale) - decode_tables[table].cum2sym[cum_freq] = (sym + 1) & 255; + decode_tables[table].cum2sym[cum_freq] = (sym + 1) & (NUM_SYMS - 1); ++cum_freq; } }