j2k: restructure bitstream decoding