From: srowen Date: Wed, 26 Mar 2008 14:13:14 +0000 (+0000) Subject: Undo optimization that seems to not be correct in all cases -- will have to evaluate... X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=8df6cb44661749c80de496a1f2e36e9c9225ae22;hp=461750bd6c00f01b4f054c0c80b3d83ae7337af5;p=zxing.git Undo optimization that seems to not be correct in all cases -- will have to evaluate again later git-svn-id: http://zxing.googlecode.com/svn/trunk@312 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- diff --git a/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java b/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java index 9188c790..e50891b6 100644 --- a/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java +++ b/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java @@ -138,9 +138,9 @@ public final class ReedSolomonDecoder { private int[] findErrorLocations(GF256Poly errorLocator) throws ReedSolomonException { // This is a direct application of Chien's search int numErrors = errorLocator.getDegree(); - if (numErrors == 1) { // shortcut - return new int[] { errorLocator.getCoefficient(1) }; - } + //if (numErrors == 1) { // shortcut + // return new int[] { errorLocator.getCoefficient(1) }; + //} int[] result = new int[numErrors]; int e = 0; for (int i = 1; i < 256 && e < numErrors; i++) { @@ -158,9 +158,9 @@ public final class ReedSolomonDecoder { private int[] findErrorMagnitudes(GF256Poly errorEvaluator, int[] errorLocations) { // This is directly applying Forney's Formula int s = errorLocations.length; - if (s == 1) { // shortcut - return new int[] { errorEvaluator.getCoefficient(0) }; - } + //if (s == 1) { // shortcut + // return new int[] { errorEvaluator.getCoefficient(0) }; + //} int[] result = new int[s]; for (int i = 0; i < s; i++) { int xiInverse = field.inverse(errorLocations[i]);