"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/main/java/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java" between
zxing-zxing-3.4.1.tar.gz and zxing-zxing-3.5.0.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages. Info: Project is in maintenance mode (no active development).

ReedSolomonDecoder.java  (zxing-zxing-3.4.1):ReedSolomonDecoder.java  (zxing-zxing-3.5.0)
skipping to change at line 103 skipping to change at line 103
a = b; a = b;
b = temp; b = temp;
} }
GenericGFPoly rLast = a; GenericGFPoly rLast = a;
GenericGFPoly r = b; GenericGFPoly r = b;
GenericGFPoly tLast = field.getZero(); GenericGFPoly tLast = field.getZero();
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;
tLast = t; tLast = t;
// Divide rLastLast by rLast, with quotient in q and remainder in r // Divide rLastLast by rLast, with quotient in q and remainder in r
if (rLast.isZero()) { if (rLast.isZero()) {
// Oops, Euclidean algorithm already terminated? // Oops, Euclidean algorithm already terminated?
throw new ReedSolomonException("r_{i-1} was zero"); throw new ReedSolomonException("r_{i-1} was zero");
} }
skipping to change at line 128 skipping to change at line 128
while (r.getDegree() >= rLast.getDegree() && !r.isZero()) { while (r.getDegree() >= rLast.getDegree() && !r.isZero()) {
int degreeDiff = r.getDegree() - rLast.getDegree(); int degreeDiff = r.getDegree() - rLast.getDegree();
int scale = field.multiply(r.getCoefficient(r.getDegree()), dltInverse); int scale = field.multiply(r.getCoefficient(r.getDegree()), dltInverse);
q = q.addOrSubtract(field.buildMonomial(degreeDiff, scale)); q = q.addOrSubtract(field.buildMonomial(degreeDiff, scale));
r = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale)); r = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale));
} }
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 pol throw new IllegalStateException("Division algorithm failed to reduce pol
ynomial?"); ynomial? " +
"r: " + r + ", rLast: " + rLast);
} }
} }
int sigmaTildeAtZero = t.getCoefficient(0); int sigmaTildeAtZero = t.getCoefficient(0);
if (sigmaTildeAtZero == 0) { if (sigmaTildeAtZero == 0) {
throw new ReedSolomonException("sigmaTilde(0) was zero"); throw new ReedSolomonException("sigmaTilde(0) was zero");
} }
int inverse = field.inverse(sigmaTildeAtZero); int inverse = field.inverse(sigmaTildeAtZero);
GenericGFPoly sigma = t.multiply(inverse); GenericGFPoly sigma = t.multiply(inverse);
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)