My results from DCT seem screwy. For example, the "java" bitmap has a white field. And from some debugging statements I get, white is represented by the byte -2. Here is my process in rough pseudocode, of one byte, with real resultant output.
1. byte bt = in.readByte() = -2 2. double db = (double)bt = -2.0 3. double dct = DCT of bt = on the order of E-17 for many cases 4. byte theByte = theGivenByteProcess = 0; 5. out.writeByte(theByte);
0, from what I can tell, is black. So I have now transformed my white background into a black background. What am I doing wrong? |