Image/video encoding/decoding method and device
A video decoding method performed by a video decoding device according to the present document may comprise: parsing, from a bitstream, number information relating to explicitly signaled height for slices in a tile of a current picture; based on the number information, parsing, from the bitstream, height information relating to explicitly signaled height for the slices, deriving heights of 0-th to (n−1)-th slices in the tile based on the height information; deriving the height of the n-th slice in the tile based on the height of the (n−1)-th slice; deriving a height of a last slice in the tile based on a remaining height.
1 . A video decoding apparatus, comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
parse number information related to a number of slices of which heights are explicitly signaled within a tile of a current picture from a bitstream;
parse height information related to heights of the slices of which heights are explicitly signaled from the bitstream based on the number information;
based on the number of slices of which heights are explicitly signaled being equal to n, derive heights of a 0-th slice to an (n−1)-th slice within the tile based on the height information;
derive a total number of slices within the tile; and
decode the current picture based on the slices of the current picture,
wherein the total number of slices within the tile is derived by performing
obtaining a remaining height of the tile that is calculated by subtracting the heights of the slices starting from the 0-th slice to the (n−1)-th slice from a total height of the tile;
obtaining intermediate number that is equal to n;
comparing the remaining height of the tile with a uniform height of a slice within the tile;
increasing the intermediate number by 1 based on the remaining height of the tile being smaller than the uniform height and being larger than 0; and
deriving the total number of slices within the tile as the increased intermediate number.
2 . A video encoding apparatus, comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
derive slices within a tile of a current picture;
generate number information related to a number of slices of which heights are explicitly signaled within the tile and height information related to heights of the slices of which heights are explicitly signaled; and
encode image information including the number information and the height information,
wherein, based on the number of slices of which heights are explicitly signaled being equal to n, the height information indicates heights of a 0-th slice to an (n−1)-th slice within the tile, and
wherein a total number of slices within the tile is derived by performing:
obtaining a remaining height of the tile that is calculated by subtracting the heights of the slices starting from the 0-th slice to the (n−1)-th slice from a total height of the tile;
obtaining intermediate number that is equal to n;
comparing the remaining height of the tile with a uniform height of a slice within the tile;
increasing the intermediate number by 1 based on the remaining height of the tile being smaller than the uniform height and being larger than 0; and
deriving the total number of slices within the tile as the increased intermediate number.
3 . An apparatus for transmitting data for a video, the apparatus comprising:
at least one processor configured to obtain a bitstream generated by an image encoding method; and
a transmitter configured to transmit the data for the video comprising the bitstream;
wherein the image encoding method comprising:
deriving slices within a tile of a current picture;
generating number information related to a number of slices of which heights are explicitly signaled within the tile and height information related to heights of the slices of which heights are explicitly signaled;
encoding image information including the number information and the height information into a bitstream; and
transmitting the data comprising the bitstream,
wherein, based on the number of slices of which heights are explicitly signaled being equal to n, the height information indicates heights of a 0-th slice to an (n−1)-th slice within the tile, and
wherein a total number of slices within the tile is derived by performing:
obtaining a remaining height of the tile that is calculated by subtracting the heights of the slices starting from the 0-th slice to the (n−1)-th slice from a total height of the tile;
obtaining intermediate number that is equal to n;
comparing the remaining height of the tile with a uniform height of a slice within the tile;
increasing the intermediate number by 1 based on the remaining height of the tile being smaller than the uniform height and being larger than 0; and
deriving the total number of slices within the tile as the increased intermediate number.