|
|
|
@ -285,7 +285,7 @@ public final class QrCode {
|
|
|
|
|
|
|
|
|
|
// Calculate parameter numbers
|
|
|
|
|
int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[errorCorrectionLevel.ordinal()][version];
|
|
|
|
|
int blockEccLen = ECC_CODEWORDS_PER_BLOCK[errorCorrectionLevel.ordinal()][version];
|
|
|
|
|
int blockEccLen = ECC_CODEWORDS_PER_BLOCK [errorCorrectionLevel.ordinal()][version];
|
|
|
|
|
int rawCodewords = QrTemplate.getNumRawDataModules(version) / 8;
|
|
|
|
|
int numShortBlocks = numBlocks - rawCodewords % numBlocks;
|
|
|
|
|
int shortBlockDataLen = rawCodewords / numBlocks - blockEccLen;
|
|
|
|
@ -448,7 +448,7 @@ public final class QrCode {
|
|
|
|
|
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
|
|
|
|
|
static int getNumDataCodewords(int ver, Ecc ecl) {
|
|
|
|
|
return QrTemplate.getNumRawDataModules(ver) / 8
|
|
|
|
|
- ECC_CODEWORDS_PER_BLOCK[ecl.ordinal()][ver]
|
|
|
|
|
- ECC_CODEWORDS_PER_BLOCK [ecl.ordinal()][ver]
|
|
|
|
|
* NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal()][ver];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -456,8 +456,8 @@ public final class QrCode {
|
|
|
|
|
/*---- Private tables of constants ----*/
|
|
|
|
|
|
|
|
|
|
// For use in getPenaltyScore(), when evaluating which mask is best.
|
|
|
|
|
private static final int PENALTY_N1 = 3;
|
|
|
|
|
private static final int PENALTY_N2 = 3;
|
|
|
|
|
private static final int PENALTY_N1 = 3;
|
|
|
|
|
private static final int PENALTY_N2 = 3;
|
|
|
|
|
private static final int PENALTY_N3 = 40;
|
|
|
|
|
private static final int PENALTY_N4 = 10;
|
|
|
|
|
|
|
|
|
|