} else {
arithDecoder->decodeInt(&t, iadtStats);
}
- t *= -strips;
+ t *= -(int)strips;
inst = 0;
sFirst = 0;
}
// read the bitmap
- atx[0] = -patternW; aty[0] = 0;
- atx[1] = -3; aty[1] = -1;
- atx[2] = 2; aty[2] = -2;
- atx[3] = -2; aty[3] = -2;
+ atx[0] = -(int)patternW; aty[0] = 0;
+ atx[1] = -3; aty[1] = -1;
+ atx[2] = 2; aty[2] = -2;
+ atx[3] = -2; aty[3] = -2;
bitmap = readGenericBitmap(mmr, (grayMax + 1) * patternW, patternH,
templ, gFalse, gFalse, NULL,
atx, aty, length - 7);
code2 += code3 = mmrDecoder->getBlackCode();
} while (code3 >= 64);
}
- a0 = codingLine[codingI++] = a0 + code1;
- a0 = codingLine[codingI++] = a0 + code2;
- while (refLine[refI] <= a0 && refLine[refI] < w) {
- refI += 2;
+ if (code1 > 0 || code2 > 0) {
+ a0 = codingLine[codingI++] = a0 + code1;
+ a0 = codingLine[codingI++] = a0 + code2;
+ while (refLine[refI] <= a0 && refLine[refI] < w) {
+ refI += 2;
+ }
}
break;
case twoDimVert0:
}
// update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x07;
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x0f;
cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
- cx2 = ((cx2 << 1) | pix) & 0x0f;
+ cx2 = ((cx2 << 1) | pix) & 0x07;
}
break;
for (x = 0; x < w; ++x) {
// build the context
- cx = (cx0 << 9) | (cx1 << 4) | (cx2 << 1) |
+ cx = (cx0 << 7) | (cx1 << 3) | (cx2 << 1) |
bitmap->nextPixel(&atPtr0);
// check for a skipped pixel
}
// update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x0f;
- cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
- cx2 = ((cx2 << 1) | pix) & 0x07;
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x07;
+ cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x0f;
+ cx2 = ((cx2 << 1) | pix) & 0x03;
}
break;
for (x = 0; x < w; ++x) {
// build the context
- cx = (cx0 << 9) | (cx1 << 4) | (cx2 << 1) |
+ cx = (cx1 << 5) | (cx2 << 1) |
bitmap->nextPixel(&atPtr0);
// check for a skipped pixel
for (i = 0; i < segments->getLength(); ++i) {
seg = (JBIG2Segment *)segments->get(i);
if (seg->getSegNum() == segNum) {
- globalSegments->del(i);
+ segments->del(i);
return;
}
}