]> git.sesse.net Git - narabu/blobdiff - narabu.cpp
Prepare for more flexible slices.
[narabu] / narabu.cpp
index 1419ff0bc42a57c64600983002dab6136dcec466..2eb29dcd46877d788de0ee43a03e443352b1308b 100644 (file)
@@ -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;
                        }
                }