Bug in 'cubic' resampling of gdalwarp
|Reported by:||sprice||Owned by:||warmerdam|
I get artifacting with the attached file and the command: gdalwarp -tr 4 -4 -r cubic dem_p108r036.sm.tif dem_p108r036.sm-lg.tif
The coefficients seem to be wrong in the cubic interpolation. I done fixed them. To keep total multiplication operations down, I did some pre-multiplication of the 'dfDelta' arguments by 0.5.
I also removed the floor() operations because they are unneeded for all pixel indices greater than 0. Edge indices (less than and equal to zero) are already handled by GWKBilinearResample().
For correctness, I also added 0.5 to the interpolated value of shorts when casting.
And, just because, I pre-saved pointers so gratuitous pointer following isn't happening.