A motion-compensated prediction method used for two-dimensional panoramic image decoding/encoding, comprising: determining a location οf an initial reference pixel of a current pixel in a reference image based on a motion information obtained from a bitstream, wherein the current pixel is located in a first sub-image in a current image; when the initial reference pixel is located outside a second sub-image that is in the reference image and that is at a location corresponding to the first sub-image, determining, based on the location of the initial reference pixel and a location of a sphere center of a sphere corresponding to the reference image, a spherical reference location that is corresponding to a target reference pixel of the current pixel and that is on a surface of the sphere; determining, based on the spherical reference location, a polyhedral reference location that is corresponding to the target reference pixel and that is on a surface of a polyhedron corresponding to the reference image, wherein the sphere is internally tangent to the polyhedron, and a connection line between the polyhedral reference location and the sphere center passes through the spherical reference location; determining a location of the target reference pixel in the reference image based on the polyhedral reference location; and determining a prediction value of a pixel value of the current pixel based on a pixel value of the target reference pixel and/or a pixel value of a neighboring pixel of the target reference pixel within the reference image, wherein the prediction value of the pixel value of the current pixel is used to obtain a reconstructed value of the pixel value of the current pixel together with a residual value of the current pixel; wherein the determining a location of the target reference pixel in the reference image based on the polyhedral reference location comprises: determining the location of the target reference pixel in the reference image based on the polyhedral reference location and layout information of the polyhedron by mapping the polyhedral reference location to the location of the target reference pixel of the reference image according to a mapping relationship defined by the layout information of the polyhedron, 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. determining a location οf an initial reference pixel of a current pixel in a reference image based on a motion information obtained from a bitstream, wherein the current pixel is located in a first sub-image in a current image; when the initial reference pixel is located outside a second sub-image that is in the reference image and that is at a location corresponding to the first sub-image, determining, based on the location of the initial reference pixel and a location of a sphere center of a sphere corresponding to the reference image, a spherical reference location that is corresponding to a target reference pixel of the current pixel and that is on a surface of the sphere; determining, based on the spherical reference location, a polyhedral reference location that is corresponding to the target reference pixel and that is on a surface of a polyhedron corresponding to the reference image, wherein the sphere is internally tangent to the polyhedron, and a connection line between the polyhedral reference location and the sphere center passes through the spherical reference location; determining a location of the target reference pixel in the reference image based on the polyhedral reference location; and determining a prediction value of a pixel value of the current pixel based on a pixel value of the target reference pixel and/or a pixel value of a neighboring pixel of the target reference pixel within the reference image, wherein the prediction value of the pixel value of the current pixel is used to obtain a reconstructed value of the pixel value of the current pixel together with a residual value of the current pixel; wherein the determining a location of the target reference pixel in the reference image based on the polyhedral reference location comprises: determining the location of the target reference pixel in the reference image based on the polyhedral reference location and layout information of the polyhedron by mapping the polyhedral reference location to the location of the target reference pixel of the reference image according to a mapping relationship defined by the layout information of the polyhedron, 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.