ErrorCorrection.java (zxing-zxing-3.4.1) | : | ErrorCorrection.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 169 | skipping to change at line 169 | |||
if (e != numErrors) { | if (e != numErrors) { | |||
throw ChecksumException.getChecksumInstance(); | throw ChecksumException.getChecksumInstance(); | |||
} | } | |||
return result; | return result; | |||
} | } | |||
private int[] findErrorMagnitudes(ModulusPoly errorEvaluator, | private int[] findErrorMagnitudes(ModulusPoly errorEvaluator, | |||
ModulusPoly errorLocator, | ModulusPoly errorLocator, | |||
int[] errorLocations) { | int[] errorLocations) { | |||
int errorLocatorDegree = errorLocator.getDegree(); | int errorLocatorDegree = errorLocator.getDegree(); | |||
if (errorLocatorDegree < 1) { | ||||
return new int[0]; | ||||
} | ||||
int[] formalDerivativeCoefficients = new int[errorLocatorDegree]; | int[] formalDerivativeCoefficients = new int[errorLocatorDegree]; | |||
for (int i = 1; i <= errorLocatorDegree; i++) { | for (int i = 1; i <= errorLocatorDegree; i++) { | |||
formalDerivativeCoefficients[errorLocatorDegree - i] = | formalDerivativeCoefficients[errorLocatorDegree - i] = | |||
field.multiply(i, errorLocator.getCoefficient(i)); | field.multiply(i, errorLocator.getCoefficient(i)); | |||
} | } | |||
ModulusPoly formalDerivative = new ModulusPoly(field, formalDerivativeCoeffi cients); | ModulusPoly formalDerivative = new ModulusPoly(field, formalDerivativeCoeffi cients); | |||
// This is directly applying Forney's Formula | // This is directly applying Forney's Formula | |||
int s = errorLocations.length; | int s = errorLocations.length; | |||
int[] result = new int[s]; | int[] result = new int[s]; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added |