Subpixel interpolation is relatively simple. Typically, you apply what constitutes a multi-pass filter with a constant phase shift, where the phase shift corresponds to the desired subpixel image shift. Depending on the required image quality, you can use, for example, the 5th item of Lanczos or another sinc window function, and then apply this in one or both axes depending on whether you want an X or Y shift or both.
. 0,5 [ 0.22954, 0.65507, 0.95725, 0.95725, 0.65507 ]. , x - 2 x + 2, .
const float kCoeffs[5] = { 0.22954f, 0.65507f, 0.95725f, 0.95725f, 0.65507f };
for (y = 0; y < height; ++y)
for (x = 2; x < width - 2; ++x)
{
float p = 0.0f;
for (dx = -2; dx <= +2; ++dx)
p += in[y][x + dx] * kCoeffs[dx + 2];
out[y][x] = p;
}