jpeg2000: Factor out prec init