A motion compensating prediction method, comprising: determining a location of an initial reference pixel of a current pixel in a reference image, wherein the current pixel is located in a first sub-image in the current image; when the initial reference pixel is located outside a second sub-image at a location corresponding to the first sub-image in the reference image, determining a location of a target reference pixel of the current pixel in the reference image based on the location of the initial reference pixel, wherein a line connecting a location of the target reference pixel in a surface of a polyhedron, to which a spherical image has been projected, corresponding to the reference image and a location of the initial reference pixel in a first plane passes through a center point of the polyhedron, the location of the target reference pixel in the surface of the polyhedron is determined based on the location of the initial reference pixel and layout information of the polyhedron corresponding to the reference image, the first plane is a plane in which a face corresponding to the second sub-image in the polyhedron lies, and location precision of the target reference pixel is limited to being less than or equal to preset pixel location precision; and determining a predicted value of a pixel value of the current pixel based on a pixel value of the target reference pixel obtained through target reference pixel location precision limitation or based on a pixel value of a neighboring pixel of the target reference pixel; wherein the layout information comprises at least one of face quantity information of the polyhedron, sub-image arrangement manner information of the reference image, sub-image arrangement order information of the reference image, and sub-image rotation information of the reference image; wherein a preset pixel location precision is 1/2 N and the location of the target reference pixel in the surface of the polyhedron corresponding to the reference image is ( x f, y f) and a target reference pixel location obtained through precision limitation is ( x b, y b), where x b = round x f + 1 2 N + 1 / 1 2 N; and y b = round y f + 1 2 N + 1 / 1 2 N. determining a location of an initial reference pixel of a current pixel in a reference image, wherein the current pixel is located in a first sub-image in the current image; when the initial reference pixel is located outside a second sub-image at a location corresponding to the first sub-image in the reference image, determining a location of a target reference pixel of the current pixel in the reference image based on the location of the initial reference pixel, wherein a line connecting a location of the target reference pixel in a surface of a polyhedron, to which a spherical image has been projected, corresponding to the reference image and a location of the initial reference pixel in a first plane passes through a center point of the polyhedron, the location of the target reference pixel in the surface of the polyhedron is determined based on the location of the initial reference pixel and layout information of the polyhedron corresponding to the reference image, the first plane is a plane in which a face corresponding to the second sub-image in the polyhedron lies, and location precision of the target reference pixel is limited to being less than or equal to preset pixel location precision; and determining a predicted value of a pixel value of the current pixel based on a pixel value of the target reference pixel obtained through target reference pixel location precision limitation or based on a pixel value of a neighboring pixel of the target reference pixel; wherein the layout information comprises at least one of face quantity information of the polyhedron, sub-image arrangement manner information of the reference image, sub-image arrangement order information of the reference image, and sub-image rotation information of the reference image; wherein a preset pixel location precision is 1/2 N and the location of the target reference pixel in the surface of the polyhedron corresponding to the reference image is ( x f, y f) and a target reference pixel location obtained through precision limitation is ( x b, y b), where x b = round x f + 1 2 N + 1 / 1 2 N; and y b = round y f + 1 2 N + 1 / 1 2 N.