jpeg2000dec: merge simplification of jpeg2000_decode_packets() from j2k