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 of decoding a current image with a decoding apparatus, comprising:
receiving a bitstream including the current image;
dividing, based on coding information from the bitstream, a coding block in the current image to obtain one or more sub-blocks,
wherein the coding information includes a first flag indicating whether to divide the coding block to obtain one or more sub-blocks, a second flag indicating whether to divide the coding block asymmetrically, and a third flag indicating whether a division direction for the coding block is a horizontal direction or a vertical direction, the first flag, the second flag and the third flag being different from each other,
wherein the coding information further includes information on a division position of each of the one or more sub-blocks within the coding block, and
wherein, in case the coding block is divided asymmetrically, a first sub-block having a ¼ size of the coding block is obtained, the first sub-block belonging to the one or more sub-blocks;
obtaining inverse-quantized coefficients of the first sub-block by performing inverse-quantization on the first sub-block;
reconstructing a residual signal of the first sub-block by performing inverse-transform on the inverse-quantized coefficients; and
reconstructing the coding block based on the residual signal and a prediction signal corresponding to the residual signal,
wherein the prediction signal is generated by obtaining prediction information for the coding block from the bitstream and determining a prediction method for the coding block based on the prediction information, and performing prediction for the coding block based on the determined prediction information,
wherein the prediction method is determined as one among a plurality of prediction methods including an inter prediction method, and
wherein obtaining the inverse-quantized coefficients of the first sub-block comprises:
selecting one of a plurality of weight set candidates pre-defined in the decoding apparatus; and
performing the inverse-quantization on the first sub-block based on the selected weight set candidate.
2 . The method of claim 1 , wherein each of the weight set candidates includes a plurality of weight components, and
wherein at least one of the weight components belonging to the one of the weight set candidates is different from the weight components belonging to the other of the weight set candidates.
3 . The method of claim 1 , wherein a transform type for the inverse-transform of the inverse-quantized coefficients is determined by considering whether or not a size of the first sub-block is greater than a threshold size pre-defined in the decoding apparatus.
4 . The method of claim 3 , wherein a number of transform types available for the first sub-block when the size of the first sub-block is greater than the threshold size is different from the number of the transform types available for the first sub-block when the size of the first sub-block is less than or equal to the threshold size.
5 . The method of claim 4 , wherein a transform type for the inverse-transform of the quantized coefficients is determined by further considering at least one of the first flag, the second flag, or the third flag.
6 . A method of encoding a current image with an encoding apparatus, comprising:
dividing a coding block in the current image to obtain one or more sub-blocks;
obtaining transform coefficients of a first sub-block by performing transform on a residual signal of the first sub-block, the first sub-block belonging to the one or more sub-blocks;
obtaining quantized transform coefficients of the first sub-block by performing quantization on the transform coefficients of the first sub-block; and
generating a bitstream by encoding the quantized transform coefficients of the first sub-block,
wherein the residual signal is obtained based on a prediction signal corresponding to the residual signal,
wherein the prediction signal is generated by determining a prediction method for the coding block and performing prediction for coding block based on the determined prediction method,
wherein the determined prediction method is encoded into the bitstream using prediction information,
wherein the prediction method is determined as one among a plurality of prediction methods including an inter prediction method,
wherein coding information for dividing the coding block is encoded into the bitstream,
wherein the coding information includes a first flag indicating whether to divide the coding block to obtain the one or more sub-blocks, a second flag indicating whether to divide the coding block asymmetrically, and a third flag indicating whether a division direction for the coding block is a horizontal direction or a vertical direction, the first flag, the second flag and the third flag being different from each other,
wherein the coding information further includes information on a division position of each of the one or more sub-blocks within the coding block,
wherein, in case the coding block is divided asymmetrically, the first sub-block having a ¼ size of the coding block is obtained, and
wherein obtaining the quantized transform coefficients of the first sub-block comprises:
selecting one of a plurality of weight set candidates pre-defined in the encoding apparatus; and
performing the quantization on the transform coefficients of the first sub-block based on the selected weight set candidate.
7 . A non-transitory computer-readable medium for storing data associated with an image signal, comprising:
a data stream encoded by an encoding method,
wherein the encoding method comprises:
dividing a coding block in the current image to obtain one or more sub-blocks;
obtaining transform coefficients of a first sub-block by performing transform on a residual signal of the first sub-block, the first sub-block belonging to the one or more sub-blocks;
obtaining quantized transform coefficients of the first sub-block by performing quantization on the transform coefficients of the first sub-block; and
generating a bitstream by encoding the quantized transform coefficients of the first sub-block,
wherein the residual signal is obtained based on a prediction signal corresponding to the residual signal,
wherein the prediction signal is generated by determining a prediction method for the coding block and performing prediction for coding block based on the determined prediction method,
wherein the determined prediction method is encoded into the bitstream using prediction information,
wherein the prediction method is determined as one among a plurality of prediction methods including an inter prediction method,
wherein coding information for dividing the coding block is encoded into the bitstream,
wherein the coding information includes a first flag indicating whether to divide the coding block to obtain the one or more sub-blocks, a second flag indicating whether to divide the coding block asymmetrically, and a third flag indicating whether a division direction for the coding block is a horizontal direction or a vertical direction, the first flag, the second flag and the third flag being different from each other,
wherein the coding information further includes information on a division position of each of the one or more sub-blocks within the coding block,
wherein, in case the coding block is divided asymmetrically, the first sub-block having a ¼ size of the coding block is obtained, and
wherein obtaining the quantized transform coefficients of the first sub-block comprises:
selecting one of a plurality of weight set candidates pre-defined in the encoding apparatus; and
performing the quantization on the transform coefficients of the first sub-block based on the selected weight set candidate.
8 . A method for transmitting data associated with an image signal, the method comprising:
obtaining a data stream encoded by an encoding method; and
transmitting the data stream,
wherein the encoding method comprises:
dividing a coding block in the current image to obtain one or more sub-blocks;
obtaining transform coefficients of a first sub-block by performing transform on a residual signal of the first sub-block, the first sub-block belonging to the one or more sub-blocks;
obtaining quantized transform coefficients of the first sub-block by performing quantization on the transform coefficients of the first sub-block; and
generating a bitstream by encoding the quantized transform coefficients of the first sub-block,
wherein the residual signal is obtained based on a prediction signal corresponding to the residual signal,
wherein the prediction signal is generated by determining a prediction method for the coding block and performing prediction for coding block based on the determined prediction method,
wherein the determined prediction method is encoded into the bitstream using prediction information,
wherein the prediction method is determined as one among a plurality of prediction methods including an inter prediction method,
wherein coding information for dividing the coding block is encoded into the bitstream,
wherein the coding information includes a first flag indicating whether to divide the coding block to obtain the one or more sub-blocks, a second flag indicating whether to divide the coding block asymmetrically, and a third flag indicating whether a division direction for the coding block is a horizontal direction or a vertical direction, the first flag, the second flag and the third flag being different from each other,
wherein the coding information further includes information on a division position of each of the one or more sub-blocks within the coding block,
wherein, in case the coding block is divided asymmetrically, the first sub-block having a ¼ size of the coding block is obtained, and
wherein obtaining the quantized transform coefficients of the first sub-block comprises:
selecting one of a plurality of weight set candidates pre-defined in the encoding apparatus; and
performing the quantization on the transform coefficients of the first sub-block based on the selected weight set candidate.