Browse files

One more fix for

When generating the guess masks the input signal is partitioned
into bytes. That partitioning is now done with a faster method.
But it had a bug. The upper limit must have the bitwidth added
before casting to int to prevent a rounding error.

With this change the whole process should now produce the same
results as before, if it is given te same input parameters.
  • Loading branch information...
1 parent 4aa01be commit 828bfe1b23a8489e5cc6a8d1938c1afa5761d261 @ali1234 committed Feb 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2
@@ -83,8 +83,8 @@ def set_offset(self, offset):
def get_bit_pos(self, bit):
bit += 32
- low = max(0, int(self._interp_x[bit] + self._offset - (self._bitwidth*0.5)))
- return (low, 1+int(low+(self._bitwidth)))
+ low = max(0, self._interp_x[bit] + self._offset - (self._bitwidth*0.5))
+ return (int(low)+1, int(low+self._bitwidth)+1)
def set_update_range(self, which, n):
which *= 8

0 comments on commit 828bfe1

Please sign in to comment.