cbComp[i] = (byte)(n / 65536); if ((n < 0) && (n % 65536 != 0)) cbComp[i]--;
cbComp[i] = (byte)(n >> 16); if ((n < 0) && ((n & 0xFFFF) != 0)) cbComp[i]--;
void convert4BitRGBToYCbCr(ImageData image) {	RGB[] rgbs = image.getRGBs();	int paletteSize = rgbs.length;	byte[] yComp = new byte[paletteSize];	byte[] cbComp = new byte[paletteSize];	byte[] crComp = new byte[paletteSize];	int srcWidth = image.width;	int srcHeight = image.height;	for (int i = 0; i < paletteSize; i++) {		RGB color = rgbs[i];		int r = color.red;		int g = color.green;		int b = color.blue;		int n = RYTable[r] + GYTable[g] + BYTable[b];		yComp[i] = (byte)(n / 65536);		if ((n < 0) && (n % 65536 != 0)) yComp[i]--;		n = RCbTable[r] + GCbTable[g] + BCbTable[b];		cbComp[i] = (byte)(n / 65536);		if ((n < 0) && (n % 65536 != 0)) cbComp[i]--;		n = RCrTable[r] + GCrTable[g] + BCrTable[b];		crComp[i] = (byte)(n / 65536);		if ((n < 0) && (n % 65536 != 0)) crComp[i]--;	}	int bSize = srcWidth * srcHeight;	byte[] dataYComp = new byte[bSize];	byte[] dataCbComp = new byte[bSize];	byte[] dataCrComp = new byte[bSize];	byte[] origData = image.data;	int bytesPerLine = image.bytesPerLine;	int maxScanlineByte = srcWidth / 2;	for (int yPos = 0; yPos < srcHeight; yPos++) {		for (int xPos = 0; xPos < maxScanlineByte; xPos++) {			int srcIndex = yPos * bytesPerLine + xPos;			int dstIndex = yPos * srcWidth + (xPos * 2);			int value2 = origData[srcIndex] & 0xFF;			int value1 = value2 / 16;			value2 = value2 % 16;			dataYComp[dstIndex] = yComp[value1];			dataCbComp[dstIndex] = cbComp[value1];			dataCrComp[dstIndex] = crComp[value1];			dataYComp[dstIndex + 1] = yComp[value2];			dataCbComp[dstIndex + 1] = cbComp[value2];			dataCrComp[dstIndex + 1] = crComp[value2];		}	}	compress(image, dataYComp, dataCbComp, dataCrComp);}