Add most of the vpos decoding logic.