Use faster shift when possible

Optimization for the case where input and output sampling intervals are
equal.