Method and device for encoding/decoding image, and recording medium storing bit stream
An image encoding/decoding method and apparatus for predicting a second color component block using a first color component block are provided. An image decoding method of the present invention comprises deriving a prediction parameter using the first color component block, and predicting the second color component block using the derived prediction parameter.
1. An image decoding method comprising:
deriving an intra prediction mode of a current chroma block;
selecting one or more reference sample lines for a current luma block from a plurality of reference sample lines adjacent to the current luma block in response to the intra prediction mode of the current chroma block being inter-component intra prediction mode, wherein the current luma block corresponds to the current chroma block;
deriving prediction parameters for inter-component intra prediction using the selected one or more reference sample line; and
generating a prediction block by performing inter-component intra prediction for the current chroma block based on the current luma block and the prediction parameters.
2. The method of claim 1 , wherein,
the one or more reference sample line for the current luma block are selected based on whether an upper boundary of the current luma block corresponds to an upper boundary of a coding tree block.
3. The method of claim 2 , wherein,
in response to an upper boundary of the current luma block corresponding to an upper boundary of a coding tree block, one upper reference sample line and three left reference sample lines are selected from the plurality of reference sample lines.
4. The method of claim 1 , wherein,
the prediction parameters indicate a correlation between luma samples in the current luma block and chroma samples in the current chroma block.
5. The method of claim 1 , wherein,
whether the intra prediction mode of the current chroma block is the inter-component intra prediction mode is determined based on inter-component intra prediction flag information indicating whether to perform the inter-component intra prediction on the current chroma block.
6. The method of claim 1 , wherein,
whether the intra prediction mode of the current chroma block is the inter-component intra prediction mode is determined based on at least one of coding parameters, a block size and a block shape of the current luma or chroma block.
7. The method of claim 6 , wherein,
the coding parameters of the current luma block comprise at least one of block split flag information, binary split flag information, and binary split direction information.
8. The method of claim 1 , wherein,
the selected one or more reference sample line includes upper reference samples and upper right reference samples in response to only upper sides of the current luma block and the current chroma block being determined to be used for inter-component intra prediction,
the selected one or more reference sample line includes left reference samples and lower left reference samples in response to only left sides of the current luma block and the current chroma block being determined to be used for inter-component intra prediction, and
the selected one or more reference sample line includes the upper reference samples and the left reference samples in response to upper sides and left sides of the current luma block and the current chroma block being determined to be used for inter-component intra prediction.
9. The method of claim 1 , wherein,
the prediction parameters are derived by using a predetermined number of reference samples.
10. An image encoding method comprising:
selecting one or more reference sample lines for a current luma block from a plurality of reference sample lines adjacent to the current luma block for inter-component intra prediction of a current chroma block, wherein the current luma block corresponds to the current chroma block;
deriving prediction parameters for inter-component intra prediction using the selected one or more reference sample line; and
generating a prediction block by performing inter-component intra prediction for the current chroma block based on the current luma block and the prediction parameters.
11. The method of claim 10 , wherein,
the one or more reference sample line for the current luma block are selected based on whether an upper boundary of the current luma block corresponds to an upper boundary of a coding tree block.
12. The method of claim 11 , wherein,
in response to an upper boundary of the current luma block corresponding to an upper boundary of a coding tree block, one upper reference sample line and three left reference sample lines are selected from the plurality of reference sample lines.
13. The method of claim 10 , wherein,
the prediction parameters indicate a correlation between luma samples in the current luma block and chroma samples in the current chroma block.
14. The method of claim 10 , wherein,
encoding inter-component intra prediction flag information indicating whether to perform the inter-component intra prediction on the current chroma block.
15. The method of claim 10 , wherein,
whether the intra prediction mode of the current chroma block is the inter-component intra prediction mode is determined based on at least one of coding parameters, a block size and a block shape of the current luma or chroma block.
16. The method of claim 15 , wherein,
the coding parameters of the current luma block comprise at least one of block split flag information, binary split flag information, and binary split direction information.
17. The method of claim 10 , further comprising,
the selected one or more reference sample line includes upper reference samples and upper right reference samples in response to only upper sides of the current luma block and the current chroma block being used for inter-component intra prediction,
the selected one or more reference sample line includes left reference samples and lower left reference samples in response to only left sides of the current luma block and the current chroma block being used for inter-component intra prediction, and
the selected one or more reference sample line includes the upper reference samples and the left reference samples in response to upper sides and left sides of the current luma block and the current chroma block being used for inter-component intra prediction.
18. The method of claim 10 , wherein,
the prediction parameters are derived by using a predetermined number of reference samples.
19. A non-transitory computer-readable recording medium storing a bitstream which is decoded by an image decoding method,
wherein the image decoding method comprises,
deriving an intra prediction mode of a current chroma block;
selecting one or more reference sample lines for a current luma block from a plurality of reference sample lines adjacent to the current luma block in response to the intra prediction mode of the current chroma block being inter-component intra prediction mode, wherein the current luma block corresponds to the current chroma block;
deriving prediction parameters for inter-component intra prediction using the selected one or more reference sample lines; and
generating a prediction block by performing inter-component intra prediction for the current chroma block based on the current luma block and the prediction parameters.