[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809

srowen srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:31:46 UTC 2010


The following commit has been merged in the upstream branch:
commit 9463112e4e6c93bad43b696a33aa7d68cf2ec719
Author: srowen <srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date:   Fri May 28 15:39:11 2010 +0000

    Small speedup, per issue 422
    
    git-svn-id: http://zxing.googlecode.com/svn/trunk@1395 59b500cc-1b3d-0410-9834-0bbf25fbcc57

diff --git a/core/src/com/google/zxing/common/reedsolomon/GF256.java b/core/src/com/google/zxing/common/reedsolomon/GF256.java
index ea1f3ec..9c58275 100644
--- a/core/src/com/google/zxing/common/reedsolomon/GF256.java
+++ b/core/src/com/google/zxing/common/reedsolomon/GF256.java
@@ -130,13 +130,10 @@ public final class GF256 {
     if (a == 0 || b == 0) {
       return 0;
     }
-    if (a == 1) {
-      return b;
-    }
-    if (b == 1) {
-      return a;
-    }
-    return expTable[(logTable[a] + logTable[b]) % 255];
+    int logSum = logTable[a] + logTable[b];
+    // index is a sped-up alternative to logSum % 255 since sum
+    // is in [0,510]. Thanks to jmsachs for the idea
+    return expTable[(logSum & 0xFF) + (logSum >>> 8)];
   }
 
 }

-- 
Multi-format 1D/2D barcode image processing library



More information about the Pkg-google-commits mailing list