Image encoding/decoding method and device
An image prediction method according to the present invention may comprise: identifying a reference pixel region designated for obtaining correlation information; determining a reference pixel processing configuration on the basis of determination of the availability of the reference pixel region; and performing intra prediction according to the determined reference pixel processing. As described above, performing intra prediction on the basis of the availability of a reference pixel according to the present invention can improve encoding performance.
1 . A method of decoding an image, comprising:
determining whether a color copy mode is supported for a current chroma block of a first color space in the image, wherein the color copy mode is a mode of predicting the current chroma block of the first color space by using a luma block of a second color space reconstructed before the current chroma block;
determining whether the color copy mode is applied for the current chroma block in the image;
down-sampling the luma block corresponding to the current chroma block in response to the determination that the color copy mode is supported for the current chroma block and the color copy mode is applied for the current chroma block;
deriving correlation information for the color copy mode based on a pre-determined reference region, wherein the correlation information represents a correlation between the current chroma block and the luma block, and the correlation information is expressed by a weight parameter and an offset parameter to be applied to the down-sampled luma block;
predicting the current chroma block by applying the correlation information to the down-sampled luma block to generate a prediction block; and
reconstructing the current chroma block based on the prediction block and a residual block for the current chroma block,
wherein the reference region includes at least one of a neighboring region of the current chroma block or a neighboring region of the luma block,
wherein a number of reference pixel lines belonging to the reference region used for deriving the correlation information is adaptively determined based on a determination of whether the current chroma block is located on a boundary of a maximum coding block,
wherein the down-sampling of the luma block is performed using a first pixel of the luma block corresponding to a current pixel of the current chroma block and a plurality of neighboring pixels adjacent to the first pixel, a position of the first pixel corresponding to the current pixel being determined based on a chroma format of the image and position of the plurality of neighboring pixels being determined based on a chroma format of the image, and
wherein the neighboring pixels include at least one of a right neighboring pixel, a bottom neighboring pixel or a bottom-right neighboring pixel.
2 . The method of claim 1 , the method further comprising:
obtaining, from a bitstream, first information indicating whether the color copy mode is supported,
wherein whether the color copy mode is supported for the current chroma block is determined based on the first information.
3 . The method of claim 1 , wherein the correlation information is derived using only some of pixels in the reference region.
4 . The method of claim 1 , wherein a number of the correlation information to be applied to the down-sampled luma block is greater than or equal to 3.
5 . A method of encoding an image, comprising:
determining whether a color copy mode is supported for a current chroma block of a first color space in the image, wherein the color copy mode is a mode of predicting the current chroma block of the first color space by using a luma block of a second color space reconstructed before the current chroma block;
determining whether the color copy mode is applied for the current chroma block in the image;
down-sampling the luma block corresponding to the current chroma block in response to the determination that the color copy mode is supported for the current chroma block and the color copy mode is applied for the current chroma block;
determining correlation information for the color copy mode based on a pre-determined reference region, wherein the correlation information represents a correlation between the current chroma block and the luma block, and the correlation information is expressed by a weight parameter and an offset parameter to be applied to the down-sampled luma block;
predicting the current chroma block by applying the correlation information to the down-sampled luma block to generate a prediction block; and
encoding a residual block for the current chroma block, the residual block being obtained based on the current chroma block and the prediction block,
wherein the reference region includes at least one of a neighboring region of the current chroma block or a neighboring region of the luma block,
wherein a number of reference pixel lines belonging to the reference region used for deriving the correlation information is adaptively determined based on a determination of whether the current chroma block is located on a boundary of a maximum coding block,
wherein the down-sampling of the luma block is performed using a first pixel of the luma block corresponding to a current pixel of the current chroma block and a plurality of neighboring pixels adjacent to the first pixel, a position of the first pixel corresponding to the current pixel being determined based on a chroma format of the image and position of the plurality of neighboring pixels being determined based on a chroma format of the image, and
wherein the neighboring pixels include at least one of a right neighboring pixel, a bottom neighboring pixel or a bottom-right neighboring pixel.
6 . A non-transitory computer readable medium having stored thereon instructions that when executed by a processor perform a method, comprising:
determining whether a color copy mode is supported for a current chroma block of a first color space in an image, wherein the color copy mode is a mode of predicting the current chroma block of the first color space by using a luma block of a second color space reconstructed before the current chroma block;
determining whether the color copy mode is applied for the current chroma block in the image;
down-sampling the luma block corresponding to the current chroma block in response to the determination that the color copy mode is supported for the current chroma block and the color copy mode is applied for the current chroma block;
deriving correlation information for the color copy mode based on a pre-determined reference region, wherein the correlation information represents a correlation between the current chroma block and the luma block, and the correlation information is expressed by a weight parameter and an offset parameter to be applied to the down-sampled luma block;
predicting the current chroma block by applying the correlation information to the down-sampled luma block to generate a prediction block; and
encoding a residual block for the current chroma block, the residual block being obtained based on the current chroma block and the prediction block,
wherein the reference region includes at least one of a neighboring region of the current chroma block or a neighboring region of the luma block,
wherein a number of reference pixel lines belonging to the reference region used for deriving the correlation information is adaptively determined based on a determination of whether the current chroma block is located on a boundary of a maximum coding block,
wherein the down-sampling of the luma block is performed using a first pixel of the luma block corresponding to a current pixel of the current chroma block and a plurality of neighboring pixels adjacent to the first pixel, a position of the first pixel corresponding to the current pixel being determined based on a chroma format of the image and position of the plurality of neighboring pixels being determined based on a chroma format of the image, and
wherein the neighboring pixels include at least one of a right neighboring pixel, a bottom neighboring pixel or a bottom-right neighboring pixel.
7 . A non-transitory computer readable recording medium storing a bitstream that is generated by a method of encoding an image, the method comprising:
determining whether a color copy mode is supported for a current chroma block of a first color space in the image, wherein the color copy mode is a mode of predicting the current chroma block of the first color space by using a luma block of a second color space reconstructed before the current chroma block;
determining whether the color copy mode is applied for the current chroma block in the image;
down-sampling the luma block corresponding to the current chroma block in response to the determination that the color copy mode is supported for the current chroma block and the color copy mode is applied for the current chroma block;
determining correlation information for the color copy mode based on a pre-determined reference region, wherein the correlation information represents a correlation between the current chroma block and the luma block, and the correlation information is expressed by a weight parameter and an offset parameter to be applied to the down-sampled luma block;
predicting the current chroma block by applying the correlation information to the down-sampled luma block to generate a prediction block; and
encoding a residual block for the current chroma block, the residual block being obtained based on the current chroma block and the prediction block,
wherein the reference region includes at least one of a neighboring region of the current chroma block or a neighboring region of the luma block,
wherein a number of reference pixel lines belonging to the reference region used for deriving the correlation information is adaptively determined based on a determination of whether the current chroma block is located on a boundary of a maximum coding block,
wherein the down-sampling of the luma block is performed using a first pixel of the luma block corresponding to a current pixel of the current chroma block and a plurality of neighboring pixels adjacent to the first pixel, a position of the first pixel corresponding to the current pixel being determined based on a chroma format of the image and position of the plurality of neighboring pixels being determined based on a chroma format of the image, and
wherein the neighboring pixels include at least one of a right neighboring pixel, a bottom neighboring pixel or a bottom-right neighboring pixel.
8 . A method of transmitting a bitstream generated by an image encoding method, the image encoding method comprising:
determining whether a color copy mode is supported for a current chroma block of a first color space in the image, wherein the color copy mode is a mode of predicting the current chroma block of the first color space by using a luma block of a second color space reconstructed before the current chroma block;
determining whether the color copy mode is applied for the current chroma block in the image;
down-sampling the luma block corresponding to the current chroma block in response to the determination that the color copy mode is supported for the current chroma block and the color copy mode is applied for the current chroma block;
determining correlation information for the color copy mode based on a pre-determined reference region, wherein the correlation information represents a correlation between the current chroma block and the luma block, and the correlation information is expressed by a weight parameter and an offset parameter to be applied to the down-sampled luma block;
predicting the current chroma block by applying the correlation information to the down-sampled luma block to generate a prediction block; and
encoding a residual block for the current chroma block, the residual block being obtained based on the current chroma block and the prediction block,
wherein the reference region includes at least one of a neighboring region of the current chroma block or a neighboring region of the luma block,
wherein a number of reference pixel lines belonging to the reference region used for deriving the correlation information is adaptively determined based on a determination of whether the current chroma block is located on a boundary of a maximum coding block,
wherein the down-sampling of the luma block is performed using a first pixel of the luma block corresponding to a current pixel of the current chroma block and a plurality of neighboring pixels adjacent to the first pixel, a position of the first pixel corresponding to the current pixel being determined based on a chroma format of the image and position of the plurality of neighboring pixels being determined based on a chroma format of the image, and
wherein the neighboring pixels include at least one of a right neighboring pixel, a bottom neighboring pixel or a bottom-right neighboring pixel.