From: Jonathan Rosser <[EMAIL PROTECTED]>

Signed-off-by: David Flynn <[EMAIL PROTECTED]>
---
 schroedinger/schroarith.h |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/schroedinger/schroarith.h b/schroedinger/schroarith.h
index a250fc0..7d346ea 100644
--- a/schroedinger/schroarith.h
+++ b/schroedinger/schroarith.h
@@ -157,19 +157,6 @@ _schro_arith_decode_bit (SchroArith *arith, unsigned int i)
   unsigned int value;
   unsigned int lut_index;
 
-  range_x_prob = (arith->range[1] * arith->probabilities[i]) >> 16;
-  lut_index = arith->probabilities[i]>>7 & ~1;
-
-  value = (arith->code - arith->range[0] >= range_x_prob);
-  arith->probabilities[i] += arith->lut[lut_index | value];
-
-  if (value) {
-    arith->range[0] += range_x_prob;
-    arith->range[1] -= range_x_prob;
-  } else {
-    arith->range[1] = range_x_prob;
-  }
-
   while (arith->range[1] <= 0x4000) {
     arith->range[0] <<= 1;
     arith->range[1] <<= 1;
@@ -194,6 +181,20 @@ _schro_arith_decode_bit (SchroArith *arith, unsigned int i)
     }
   }
 
+  range_x_prob = (arith->range[1] * arith->probabilities[i]) >> 16;
+  lut_index = arith->probabilities[i]>>7 & ~1;
+
+  value = (arith->code - arith->range[0] >= range_x_prob);
+  arith->probabilities[i] += arith->lut[lut_index | value];
+
+  if (value) {
+    arith->range[0] += range_x_prob;
+    arith->range[1] -= range_x_prob;
+  } else {
+    arith->range[1] = range_x_prob;
+  }
+
+
   return value;
 }
 
-- 
1.5.5




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Schrodinger-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel

Reply via email to