vp3: Move table allocation code into a new function