avcodec/jpeg2000dwt: Fill array using 2d instead of 1d accesses