Image data encoding/decoding method and apparatus
A method of decoding an image, includes obtaining at least one offset for a picture, deriving a variable for scaling for the picture based on the at least one offset, and performing inter prediction based on the variable for scaling for the picture. The at least one offset is defined with a direction of scaling.
1 . A method for decoding a 360-degree image, the method comprising:
receiving a bitstream in which the 360-degree image is encoded, the bitstream including data of an extended 2-dimensional image, the extended 2-dimensional image including a 2-dimensional image and a predetermined extension region, and the 2-dimensional image being projected from an image with a 3-dimensional projection structure and including at least one face; and
reconstructing the extended 2-dimensional image by decoding the data of an extended 2-dimensional image,
wherein, based on a projection format for the 3-dimensional projection structure is a first projection format, a size of the extension region is determined based on first width information for specifying a width of the extension region on a left side of the face and second width information for specifying a width of the extension region on a right side of the face, both the first width information and the second width information being obtained from the bitstream,
wherein, based on a projection format for the 3-dimensional projection structure is a second projection format, a size of the extension region is determined based on first width information for specifying a width of the extension region on a left side of the face, second width information for specifying a width of the extension region on a right side of the face, third height information for specifying a height of the extension region on a top side of the face and fourth height information for specifying a height of the extension region on a bottom side of the face, all of the first width information, the second width information, the third height information and the fourth height information being obtained from the bitstream,
wherein the first projection format and the second projection format are selected from a plurality of projection formats including an ERP format in which the 360-degree image is projected in a two-dimensional plane and a CMP format in which the 360-degree image is projected in a cube,
wherein sample values of the extension region are determined differently according to a padding method selected from a plurality of padding methods,
wherein, in case of the second projection format, the padding method for the left side of the face, the padding method for the right side of the face, the padding method for the top side of the face and the padding method for the bottom side of the face are selected independently from each other,
wherein the reconstructing the extended 2-dimensional image comprises generating a prediction image and a residual image, and
wherein the residual image is generated by performing inverse-quantization on information on the residual image.
2 . The method of claim 1 , wherein the padding method is selected from the plurality of padding methods based on selection information obtained from the bitstream.
3 . A method for encoding a 360-degree image, the method comprising:
obtaining a 2-dimensional image projected from an image with a 3-dimensional projection structure and including at least one face;
obtaining an extended 2-dimensional image including the 2-dimensional image and a predetermined extension region; and
encoding data of the extended 2-dimensional image into a bitstream in which the 360-degree image is encoded,
wherein, based on a projection format for the 3-dimensional projection structure is a first projection format, a size of the extension region is encoded based on first width information for specifying a width of the extension region on a left side of the face and second width information for specifying a width of the extension region on a right side of the face, both the first width information and the second width information being encoded into the bitstream,
wherein, based on a projection format for the 3-dimensional projection structure is a second projection format, a size of the extension region is encoded based on first width information for specifying a width of the extension region on a left side of the face, second width information for specifying a width of the extension region on a right side of the face, third height information for specifying a height of the extension region on a top side of the face and fourth height information for specifying a height of the extension region on a bottom side of the face, all of the first width information, the second width information, the third height information and the fourth height information being encoded into the bitstream,
wherein the first projection format and the second projection format are selected from a plurality of projection formats including an ERP format in which the 360-degree image is projected in a two-dimensional plane and a CMP format in which the 360-degree image is projected in a cube,
wherein sample values of the extension region are determined differently according to a padding method selected from a plurality of padding methods,
wherein, in case of the second projection format, the padding method for the left side of the face, the padding method for the right side of the face, the padding method for the top side of the face and the padding method for the bottom side of the face are selected independently from each other,
wherein the encoding data of the extended 2-dimensional image comprises generating a prediction image and a residual image, and
wherein the residual image is encoded by performing quantization on information on the residual image.
4 . A method for transmitting a bitstream comprising:
obtaining a 2-dimensional image projected from an image with a 3-dimensional projection structure and including at least one face;
obtaining an extended 2-dimensional image including the 2-dimensional image and a predetermined extension region;
encoding data of the extended 2-dimensional image into the bitstream in which a 360-degree image is encoded; and
transmitting the bitstream,
wherein, based on a projection format for the 3-dimensional projection structure is a first projection format, a size of the extension region is encoded based on first width information for specifying a width of the extension region on a left side of the face and second width information for specifying a width of the extension region on a right side of the face, both the first width information and the second width information being encoded into the bitstream,
wherein, based on a projection format for the 3-dimensional projection structure is a second projection format, a size of the extension region is encoded based on first width information for specifying a width of the extension region on a left side of the face, second width information for specifying a width of the extension region on a right side of the face, third height information for specifying a height of the extension region on a top side of the face and fourth height information for specifying a height of the extension region on a bottom side of the face, all of the first width information, the second width information, the third height information and the fourth height information being encoded into the bitstream,
wherein the first projection format and the second projection format are selected from a plurality of projection formats including an ERP format in which the 360-degree image is projected in a two-dimensional plane and a CMP format in which the 360-degree image is projected in a cube,
wherein sample values of the extension region are determined differently according to a padding method selected from a plurality of padding methods,
wherein, in case of the second projection format, the padding method for the left side of the face, the padding method for the right side of the face, the padding method for the top side of the face and the padding method for the bottom side of the face are selected independently from each other,
wherein the encoding data of the extended 2-dimensional image comprises generating a prediction image and a residual image, and
wherein the residual image is encoded by performing quantization on information on the residual image.