Derivation of linear parameter in cross-component video coding
A method of video processing includes deriving, for a conversion between a chroma block of a video and a bitstream representation of the video, parameters of a cross-component linear model by using downsampled luma samples that are generated from N above neighboring lines of a collocated luma block of the chroma block using a downsampling filter, where N is a positive integer; and performing the conversion using a predicted chroma block generated using the cross-component linear model.
1. A method of video processing, comprising:
determining, for a first conversion between a chroma block of a video and a bitstream of the video, that a prediction mode is applied to the chroma block, wherein in the prediction mode, prediction samples of the chroma block are derived based on reconstructed luma samples of a collocated luma block of the chroma block;
deriving parameters of the prediction mode based on neighbouring chroma samples of the chroma block and downsampled neighbouring top luma samples of the collocated luma block; and
performing the first conversion based on the parameters,
wherein in case that the chroma block has a color format of 4:2:2, the downsampled neighbouring top luma samples are derived based on a nearest above neighbouring line of the collocated luma block;
wherein in case that a chroma collocated flag is equal to 0, the chroma block is not at a top coding tree unit boundary and the chroma block has a color format of 4:2:0,
(pY[SubWidthC*x−1][−1]+pY[SubWidthC*x−1][−2]+2* pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3 are used to derive at lease one of downsampled neighbouring top luma samples,
wherein pY[SubWidthC*x−1 ][−1], pY[SubWidthC*x−1][−2], pY[SubWidthC*x][−1], pY[SubWidthC*x][−2], pY[SubWidthC*x+1][−1] and pY[SubWidthC*x+1][−2] denote luma samples from neighboring lines of the collocated luma block, and
wherein x is an integer and SubWidthC is equal to 2 in case that the chroma block has a color format of 4:2:0.
2. The method of claim 1 , wherein in response to the chroma block having a color format of 4:2:2, a second above neighbouring line of the collocated luma block is excluded from being used to derive the downsampled neighbouring top luma samples.
3. The method of claim 1 , wherein in response to the chroma block having a color format of 4:2:2, a same downsampling filter is used to derive the downsampled neighbouring top luma samples regardless of whether the chroma block is at the top coding tree unit boundary or not.
4. The method of claim 3 , wherein in response to the chroma block being at the top coding tree unit boundary, the downsampled neighbouring top luma samples are derived based on the nearest above neighbouring line of the collocated luma block.
5. The method of claim 4 , wherein in response to the chroma block being at the top coding tree unit boundary or the chroma block having a color format of 4:2:2, pDsY[x]=(pY[2*x−1][−1]+2*pY[2*x][−1]+pY[2*x+1][−1]+2)>>2,
wherein pDsY[x] denotes a downsampled neighbouring top luma sample, and
wherein pY[2*x][−1], pY[2*x−1][−1] and pY[2*x+1][−1] denotes luma samples from the nearest above neighboring line of the collocated luma block.
6. The method of claim 1 , wherein the parameters of the prediction mode are further derived based on downsampled neighbouring left luma samples of the collocated luma block;
wherein the downsampled neighbouring top luma samples and the downsampled neighbouring left luma samples are derived using downsampling filters with same filter coefficients in response to the chroma block having a color format of 4:2:2.
7. The method of claim 6 , wherein the same filter coefficients are [1 2 1].
8. The method of claim 1 , wherein a first syntax element specifying a maximum block size used for a transform skip mode is conditionally included in the bitstream based on a value of a transform skip enabled flag included in a sequence parameter set in the bitstream.
9. The method of claim 1 , wherein the conversion includes decoding the video from the bitstream.
10. The method of claim 1 , wherein the conversion includes encoding the video into the bitstream.
11. An apparatus for processing video data comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to:
determine, for a first conversion between a chroma block of a video and a bitstream of the video, that a prediction mode is applied to the chroma block, wherein in the prediction mode, prediction samples of the chroma block are derived based on reconstructed luma samples of a collocated luma block of the chroma block;
derive parameters of the prediction mode based on neighbouring chroma samples of the chroma block and downsampled neighbouring top luma samples of the collocated luma block; and
perform the first conversion based on the parameters,
wherein in case that the chroma block having has a color format of 4:2:2, the downsampled neighbouring top luma samples are derived based on a nearest above neighbouring line of the collocated luma block;
wherein in case that a chroma collocated flag is equal to 0, the chroma block is not at a top coding tree unit boundary and the chroma block has a color format of 4:2:0,
(pY[SubWidthC*x−1][−1]+pY[SubWidthC*x−1][−2]+2* pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3 are used to derive at lease one of downsampled neighbouring top luma samples,
wherein pY[SubWidthC*x−1 ][−1], pY[SubWidthC*x−1][−2], pY[SubWidthC*x][−1], pY[SubWidthC*x][−2], pY[SubWidthC*x+1][−1] and pY[SubWidthC*x+1][−2] denote luma samples from neighboring lines of the collocated luma block, and
wherein x is an integer and SubWidthC is equal to 2 in case that the chroma block has a color format of 4:2:0.
12. The apparatus of claim 11 , wherein in response to the chroma block having a color format of 4:2:2, a second above neighbouring line of the collocated luma block is excluded from being used to derive the downsampled neighbouring top luma samples.
13. The apparatus of claim 11 , wherein in response to the chroma block having a color format of 4:2:2, a same downsampling filter is used to derive the downsampled neighbouring top luma samples regardless of whether the chroma block is at the top coding tree unit boundary or not.
14. The apparatus of claim 13 , wherein in response to the chroma block being at the top coding tree unit boundary, the downsampled neighbouring top luma samples are derived based on the nearest above neighbouring line of the collocated luma block.
15. The apparatus of claim 14 , wherein in response to the chroma block being at the top coding tree unit boundary or the chroma block having a color format of 4:2:2, pDsY[x]=(pY[2*x−1][−1]+2*pY[2*x][−1]+pY[2*x+1][−1]+2)>>2,
wherein pDsY[x] denotes a downsampled neighbouring top luma sample, and
wherein pY[2*x][−1], pY[2*x−1][−1] and pY[2*x+1][−1] denotes luma samples from the nearest above neighboring line of the collocated luma block.
16. The apparatus of claim 11 , wherein the parameters of the prediction mode are further derived based on downsampled neighbouring left luma samples of the collocated luma block;
wherein the downsampled neighbouring top luma samples and the downsampled neighbouring left luma samples are derived using downsampling filters with same filter coefficients in response to the chroma block having a color format of 4:2:2.
17. The apparatus of claim 16 , wherein the same filter coefficients are [1 2 1].
18. A non-transitory computer-readable storage medium storing instructions that cause a processor to:
determine, for a first conversion between a chroma block of a video and a bitstream of the video, that a prediction mode is applied to the chroma block, wherein in the prediction mode, prediction samples of the chroma block are derived based on reconstructed luma samples of a collocated luma block of the chroma block;
derive parameters of the prediction mode based on neighbouring chroma samples of the chroma block and downsampled neighbouring top luma samples of the collocated luma block; and
perform the first conversion based on the parameters,
wherein in case that the chroma block has a color format of 4:2:2, the downsampled neighbouring top luma samples are derived based on a nearest above neighbouring line of the collocated luma block;
wherein in case that a chroma collocated flag is equal to 0, the chroma block is not at a top coding tree unit boundary and the chroma block has a color format of 4:2:0,
(pY[SubWidthC*x−1][−1]+pY[SubWidthC*x−1][−2]+2* pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3 are used to derive at lease one of downsampled neighbouring top luma samples,
wherein pY[SubWidthC*x−1 ][−1], pY[ SubWidthC*x−1][−2], pY[SubWidthC*x][−1], pY[SubWidthC*x][−2], pY[SubWidthC*x+1][−1] and pY[SubWidthC*x+1][−2] denote luma samples from neighboring lines of the collocated luma block, and
wherein x is an integer and SubWidthC is equal to 2 in case that the chroma block has a color format of 4:2:0.
19. A method of storing a bitstream of a video which is generated by a video processing apparatus to a non-transitory computer readable recording medium, the method comprising:
determining, for a first conversion between a chroma block of the video and a bitstream of the video, that a prediction mode is applied to the chroma block, wherein in the prediction mode, prediction samples of the chroma block are derived based on reconstructed luma samples of a collocated luma block of the chroma block;
deriving parameters of the prediction mode based on neighbouring chroma samples of the chroma block and downsampled neighbouring top luma samples of the collocated luma block; and
storing the bits tre am to the non-transitory computer readable recording medium,
wherein in case that the chroma block has a color format of 4:2:2, the downsampled neighbouring top luma samples are derived based on a nearest above neighbouring line of the collocated luma block;
wherein in case that a chroma collocated flag is equal to 0, the chroma block is not at a top coding tree unit boundary and the chroma block has a color format of 4:2:0,
(pY[SubWidthC*x−1][−1]+pY[SubWidthC*x−1][−2]+2* pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3 are used to derive at lease one of downsampled neighbouring top luma samples,
wherein pY[SubWidthC*x−1 ][−1], pY[SubWidthC*x−1][−2], pY[SubWidthC*x][−1], pY[SubWidthC*x][−2], pY[SubWidthC*x+1][−1] and pY[SubWidthC*x+1][−2] denote luma samples from neighboring lines of the collocated luma block, and
wherein x is an integer and SubWidthC is equal to 2 in case that the chroma block has a color format of 4:2:0.
20. The apparatus of claim 11 , wherein a first syntax element specifying a maximum block size used for a transform skip mode is conditionally included in the bitstream based on a value of a transform skip enabled flag included in a sequence parameter set in the bitstream.