Improved interpolation/upsampling code
Performance tweak