The algorithm is described in the following reference.
% "Cubic Convolution Interpolation for Digital Image % Processing", Robert G. Keys, IEEE Trans. on Acoustics, Speech, and % Signal Processing, Vol. 29, No. 6, Dec. 1981, pp. 1153-1160.
Its convolution based interpolation. The specific cubic convolution kernel is described in terms of a piecewise equation in MATLAB code before. This will make more sense if you have access to the paper.
y = zeros(1,length(x));
x(x < 0.0) = -x(x < 0.0);
q = (x <= 1);
y(q) = ((1.5 * x(q) - 2.5) .* x(q)) .* x(q) + 1.0;
q = (1 < x & x <= 2);
y(q) = ((-0.5 * x(q) + 2.5) .* x(q) - 4.0) .* x(q) + 2.0;