< prev index next >

src/java.desktop/share/native/liblcms/cmsplugin.c

Print this page
@@ -391,16 +391,11 @@
  }
  
  // from Fixed point 8.8 to double
  cmsFloat64Number CMSEXPORT _cms8Fixed8toDouble(cmsUInt16Number fixed8)
  {
-        cmsUInt8Number  msb, lsb;
- 
-        lsb = (cmsUInt8Number) (fixed8 & 0xff);
-        msb = (cmsUInt8Number) (((cmsUInt16Number) fixed8 >> 8) & 0xff);
- 
-        return (cmsFloat64Number) ((cmsFloat64Number) msb + ((cmsFloat64Number) lsb / 256.0));
+     return fixed8 / 256.0;
  }
  
  cmsUInt16Number CMSEXPORT _cmsDoubleTo8Fixed8(cmsFloat64Number val)
  {
      cmsS15Fixed16Number GammaFixed32 = _cmsDoubleTo15Fixed16(val);

@@ -408,23 +403,11 @@
  }
  
  // from Fixed point 15.16 to double
  cmsFloat64Number CMSEXPORT _cms15Fixed16toDouble(cmsS15Fixed16Number fix32)
  {
-     cmsFloat64Number floater, sign, mid;
-     int Whole, FracPart;
- 
-     sign  = (fix32 < 0 ? -1 : 1);
-     fix32 = abs(fix32);
- 
-     Whole     = (cmsUInt16Number)(fix32 >> 16) & 0xffff;
-     FracPart  = (cmsUInt16Number)(fix32 & 0xffff);
- 
-     mid     = (cmsFloat64Number) FracPart / 65536.0;
-     floater = (cmsFloat64Number) Whole + mid;
- 
-     return sign * floater;
+     return fix32 / 65536.0;
  }
  
  // from double to Fixed point 15.16
  cmsS15Fixed16Number CMSEXPORT _cmsDoubleTo15Fixed16(cmsFloat64Number v)
  {
< prev index next >