Rewrote interleave/uninterleaveSamples to not be in-place