mirror of
https://github.com/zxing/zxing.git
synced 2024-11-13 14:34:08 -08:00
This commit is contained in:
parent
c6a4e0fa97
commit
be2c5bdd88
|
@ -100,7 +100,7 @@ public final class ReedSolomonDecoder {
|
||||||
GenericGFPoly t = field.getOne();
|
GenericGFPoly t = field.getOne();
|
||||||
|
|
||||||
// Run Euclidean algorithm until r's degree is less than R/2
|
// Run Euclidean algorithm until r's degree is less than R/2
|
||||||
while (r.getDegree() >= R / 2) {
|
while (2 * r.getDegree() >= R) {
|
||||||
GenericGFPoly rLastLast = rLast;
|
GenericGFPoly rLastLast = rLast;
|
||||||
GenericGFPoly tLastLast = tLast;
|
GenericGFPoly tLastLast = tLast;
|
||||||
rLast = r;
|
rLast = r;
|
||||||
|
@ -125,7 +125,8 @@ public final class ReedSolomonDecoder {
|
||||||
t = q.multiply(tLast).addOrSubtract(tLastLast);
|
t = q.multiply(tLast).addOrSubtract(tLastLast);
|
||||||
|
|
||||||
if (r.getDegree() >= rLast.getDegree()) {
|
if (r.getDegree() >= rLast.getDegree()) {
|
||||||
throw new IllegalStateException("Division algorithm failed to reduce polynomial?");
|
throw new IllegalStateException("Division algorithm failed to reduce polynomial? " +
|
||||||
|
"r: " + r + ", rLast: " + rLast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue