decode and resample in one step