Take patch from Microsoft which simplifies the JPEG XR encoder and decoder.