Video encoding and decoding using luma mapping chroma scaling
The present disclosure intends to provide a video encoding/decoding method of performing intra prediction for a current block by using luma reference samples derived based on a luma mapping function in order to enhance performance of intra prediction for a case where restored samples around the current block to be predicted cannot be used.
1. A video decoding method for performing intra prediction for a current block, which is performed by a video decoding apparatus, the method comprising:
obtaining luma mapping chroma scaling (LMCS) parameters, a first flag indicating whether LMCS is activated, and a second flag indicating whether chroma residual scaling is activated, from a bitstream, wherein the LMCS converts the luma signals between an original area and a mapping area of a luma signal;
generating luma residual signals and scaled chroma residual signals from the bitstream;
generating a luma mapping function of converting a dynamic area of the luma signals by using the LMCS parameters when the first flag is activated, wherein the luma mapping function indicates a first function of converting the luma signals into the mapping area or a second function of inversely converting the mapped luma signals into the original area;
generating luma reference samples for the current block by using the luma mapping function when neighboring restoration samples of the current block are not available;
generating luma predicted samples by performing intra prediction for the current block based on the luma reference samples; and
generating luma restoration samples by adding the luma predicted samples and the luma residual signals.
2. The method of claim 1 , wherein the generating of the luma reference samples comprises calculating a median value based on a maximum value and a minimum value generated by the first function and comprising using the median value as a value of the luma reference samples.
3. The method of claim 1 , wherein the generating the luma reference samples comprises, when a look-up table is used as the first function, generating an index for the look-up table using a bitdepth of the current block, extracting a median value based on the index, and using the median value as a value of the luma reference samples.
4. The method of claim 1 , wherein the generating the luma reference samples comprises, when the luma signals are present in the original area but the luma mapping function is used, calculating a median value based on a maximum value and a minimum value generated by the second function and using the median value as a value of the luma reference samples.
5. The method of claim 1 , further comprising:
generating the luma reference samples for the current block by using the luma mapping function when neighboring restoration samples of a higher data unit including the current block are not available while the second flag is activated;
generating a chroma residual scaling value by using the luma reference samples; and
generating chroma residual signals by multiplying the scaled chroma residual signals by the chroma residual scaling value.
6. The method of claim 5 , wherein the generating the luma reference samples comprises calculating a median value based on a maximum value and a minimum value generated by the first function and comprises using the median value as a value of the luma reference samples.
7. The method of claim 5 , wherein the generating the luma reference samples comprises, when the look-up table is used as the first function, generating the index for the look-up table by using the bitdepth of the current block, extracting a median value based on the index, and using the median value as a value of the luma reference samples.
8. The method of claim 5 , wherein the generating the luma reference samples comprises, when the luma signals are present in the original area but the luma mapping function is used, calculating a median value based on a maximum value and a minimum value generated by the second function and using the median value as a value of the luma reference samples.
9. The method of claim 1 , wherein the LMCS parameters as a part of an adaptation parameter set (APS) are transferred to the video decoding apparatus, and wherein the APS is a separate parameter set applied to parameters applied to one or multiple pictures or one or multiple slices.
10. The method of claim 1 , further comprising:
obtaining a third flag indicating whether a matrix-based intra prediction mode is activated from the bitstream, wherein, the MIP mode is an intra prediction method for the current block using a matrix operation; and
generating a reference sample by changing an offset used for the matrix operation of the MIP mode when the third flag is activated.
11. The method of claim 10 , wherein the generating the reference sample comprises changing the offset by calculating a median value based on a maximum value and a minimum value generated by the first function.
12. The method of claim 10 , wherein the generating the reference sample comprises, when the look-up table is used as the first function, generating the index for the look-up table by using the bitdepth of the current block and extracting a median value based on the index to change the offset.
13. The method of claim 1 , further comprising:
obtaining a fourth flag indicating whether cross component linear model (CCLM) prediction is activated, from the bitstream, wherein the CCLM prediction is an intra prediction method for a chroma block for the current block based on a linear model indicating a similarity between the luma signals and chroma signals; and
applying the second mapping function to a luma block corresponding to the chroma block and neighboring luma signals of the luma block when the fourth flag is activated.
14. A video encoding method for a current block in a current picture, (Original) which is performed by a video encoding apparatus, the method comprising:
obtaining a luma mapping chroma scaling (LMCS) parameters, a first flag indicating whether LMCS is activated, and a second flag indicating whether chroma residual scaling is activated for the current picture, wherein the LMCS converts the luma signals between an original area and a mapping area of luma signals;
obtaining the current block;
generating a luma mapping function of converting a dynamic area of the luma signals by using the LMCS parameters when the first flag is activated, wherein the luma mapping function indicates a first function of converting the luma signals into the mapping area or a second function of inversely converting the mapped luma signals into the original area;
generating luma reference samples for the current block by using the luma mapping function when neighboring restoration samples of the current block are not available;
generating luma predicted samples by performing intra prediction for the current block based on the luma reference samples; and
generating luma residual signals by subtracting the luma prediction samples from the current block.
15. The method of claim 14 , further comprising:
generating the luma reference samples for the current block by using the luma mapping function when neighboring restoration samples of a higher data unit including the current block are not available while the second flag is activated;
generating a chroma residual scaling value by using the luma reference samples; and
generating scaled chroma residual signals by dividing the chroma residual signals of the current block by the chroma residual scaling value.
16. An intra prediction method for a current block, which is performed by a computing device, the method comprising:
obtaining luma mapping chroma scaling (LMCS) parameters and a first flag indicating whether LMCS is activated from a bitstream, wherein the LMCS is a method for converting the luma signals between an original area and a mapping area of luma signals;
generating luma residual signals from the bitstream;
generating a luma mapping function of converting a dynamic area of the luma signals by using the LMCS parameters when the first flag is activated;
generating luma reference samples for the current block by using the luma mapping function when neighboring restoration samples of the current block is not available; and
generating luma prediction samples by performing intra prediction for the current block based on the luma reference samples.