Image encoding/decoding method and device, and recording medium in which bitstream is stored
The present invention relates to an image encoding/decoding method and device. The image decoding method according to the present invention comprises the steps of: decoding a prediction mode index; determining whether the prediction mode index indicates function-based intra prediction; inducing a parameter(s) for generating a function, when the prediction mode index indicates the function-based intra prediction; generating the function on the basis of the induced parameter(s); and performing intra prediction by using the generated function.
1 . A method of decoding an image performed by an image decoding apparatus ( 200 ), the method comprising:
decoding a prediction mode index of a current block;
determining whether or not a function-based intra-prediction is performed for the current block based on the prediction mode index;
performing intra-prediction for the current block for generating a prediction block of the current block;
generating a residual block by decoding a bitstream; and
reconstructing the current block by adding the prediction block to the residual block,
wherein, when the function-based intra-prediction is performed for the current block, the performing intra-prediction comprises
deriving a parameter used as a constant value defining a function using previously reconstructed reference samples neighboring the current block; and
performing intra-prediction by using the function defined by the derived parameter,
wherein the prediction mode index is flag information signaled through the bitstream, having a first value indicating that the function-based intra-prediction is performed or a second value indicating that the function-based intra-prediction is not performed,
wherein the parameter for generating the function is derived using at least one among a maximum sample value and a minimum sample value of previously reconstructed reference samples neighboring the current block, the maximum sample value being a value of a sample having a maximum value among values of the previously reconstructed reference samples, and the minimum sample value being a value of a sample having a minimum value among the values of the previously reconstructed reference samples,
wherein the performing intra-prediction using the function is performed by inputting a reference sample value of a prediction position to the function, and
wherein the function outputs an intra-predicted sample value.
2 . The method of claim 1 ,
wherein the determining whether or not a function-based intra-prediction is performed for the current block is performed based on a color component of the current block.
3 . The method of claim 1 ,
wherein, when an upper boundary of the current block is a boundary of a coding tree block, a reference sample of intra-prediction is configured by using a first reference sample line only among a plurality of reference sample lines adjacent to the current block.
4 . A method of encoding an image performed by an image encoding apparatus ( 100 ), the method comprising:
determining whether or not to perform a function-based intra-prediction for the current block;
performing intra-prediction for the current block for generating a prediction block of the current block;
generating a residual block by subtracting the prediction block from the current block; and
encoding the current block by encoding the residual block into a bitstream,
wherein, when the function-based intra-prediction is performed for the current block, the performing intra-prediction comprises
deriving a parameter used as a constant value defining a function using previously reconstructed reference samples neighboring the current block;
performing intra-prediction by using the function defined by the derived parameter; and
encoding a prediction mode index indicating that the function-based intra-prediction is performed for the current block,
wherein the prediction mode index is flag information signaled through the bitstream, having a first value indicating that the function-based intra-prediction is performed or a second value indicating that the function-based intra-prediction is not performed,
wherein the parameter for generating the function is derived using at least one among a maximum sample value and a minimum sample value of previously reconstructed reference samples neighboring the current block, the maximum sample value being a value of a sample having a maximum value among values of the previously reconstructed reference samples, and the minimum sample value being a value of a sample having a minimum value among the values of the previously reconstructed reference samples,
wherein the performing intra-prediction sing the function is performed by inputting a reference sample value of a prediction position to the function, and
wherein the function outputs an intra-predicted sample value.
5 . The method of claim 4 ,
wherein the determining whether or not to perform a function-based intra-prediction for the current block is performed based on a color component of the current block.
6 . A method of transmitting a bitstream performed by an image encoding apparatus ( 100 ), the method comprising:
determining whether or not to perform a function-based intra-prediction for the current block;
performing intra-prediction for the current block for generating a prediction block of the current block;
generating a residual block by subtracting the prediction block from the current block; and
encoding the current block by encoding the residual block into a bitstream,
wherein, when the function-based intra-prediction is performed for the current block, the performing intra-prediction comprises
deriving a parameter used as a constant value defining a function using previously reconstructed reference samples neighboring the current block;
performing intra-prediction by using the function defined by the derived parameter; and
encoding a prediction mode index indicating that the function-based intra-prediction is performed for the current block into the bitstream; and
transmitting the bitstream to an image decoding apparatus,
wherein the prediction mode index is flag information signaled through the bitstream, having a first value indicating that the function-based intra-prediction is performed or a second value indicating that the function-based intra-prediction is not performed,
wherein the parameter for generating the function is derived using at least one among a maximum sample value and a minimum sample value of previously reconstructed reference samples neighboring the current block, the maximum sample value being a value of a sample having a maximum value among values of the previously reconstructed reference samples, and the minimum sample value being a value of a sample having a minimum value among the values of the previously reconstructed reference samples,
wherein the performing intra-prediction sing the function is performed by inputting a reference sample value of a prediction position to the function, and
wherein the function outputs an intra-predicted sample value.