.
for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { if (j % 2 == 0) temp[i][j] = rec[i][j / 2]; else temp[i][j] = 0; } } for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { if (j == 0) rec[i][j] = i_HPF[0] * temp[i][j + 2] + i_HPF[1] * temp[i][j + 1] + i_HPF[2] * temp[i][j] + i_HPF[3] * temp[i][j + 1] + i_HPF[4] * temp[i][j + 2]; else if (j == 1) rec[i][j] = i_HPF[0] * temp[i][j] + i_HPF[1] * temp[i][j - 1] + i_HPF[2] * temp[i][j] + i_HPF[3] * temp[i][j + 1] + i_HPF[4] * temp[i][j + 2]; else if (j > 1 && j < height-2) rec[i][j] = i_HPF[0] * temp[i][j - 2] + i_HPF[1] * temp[i][j - 1] + i_HPF[2] * temp[i][j] + i_HPF[3] * temp[i][j + 1] + i_HPF[4] * temp[i][j + 2]; else if (j == height-2) rec[i][j] = i_HPF[0] * temp[i][j - 2] + i_HPF[1] * temp[i][j - 1] + i_HPF[2] * temp[i][j] + i_HPF[3] * temp[i][j + 1] + i_HPF[4] * temp[i][j]; else if (j == height-1) rec[i][j] = i_HPF[0] * temp[i][j - 2] + i_HPF[1] * temp[i][j - 1] + i_HPF[2] * temp[i][j] + i_HPF[3] * temp[i][j - 1] + i_HPF[4] * temp[i][j - 2]; } } for (i = 0; i .