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 convert8BitRGBToYCbCr(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 dstWidth = image.width;	int dstHeight = srcHeight;	int stride = (srcWidth + 3) / 4 * 4;	int bSize = dstWidth * dstHeight;	byte[] dataYComp = new byte[bSize];	byte[] dataCbComp = new byte[bSize];	byte[] dataCrComp = new byte[bSize];	byte[] origData = image.data;	for (int yPos = 0; yPos < srcHeight; yPos++) {		int srcRowIndex = yPos * stride;		int dstRowIndex = yPos * dstWidth;		for (int xPos = 0; xPos < srcWidth; xPos++) {			int value = origData[srcRowIndex + xPos] & 0xFF;			int dstIndex = dstRowIndex + xPos;			dataYComp[dstIndex] = yComp[value];			dataCbComp[dstIndex] = cbComp[value];			dataCrComp[dstIndex] = crComp[value];		}	}	compress(image, dataYComp, dataCbComp, dataCrComp);}