Sample padding for cross-component adaptive loop filtering
A method for video processing is described. The method includes determining, for a conversion between a video unit of a video and a bitstream representation of the video, whether to enable a mirrored padding process for padding an unavailable luma sample during an application of a loop filtering tool to the video unit; and performing the conversion based on the determining.
1. A method of processing video data, comprising:
determining, for a conversion between a video unit of a video and a bitstream of the video, that a mirrored padding process for padding an unavailable luma sample which is unavailable due to a virtual boundary is used during an application of a cross-component adaptive loop filtering (CC-ALF) tool to the video unit, in a case that the virtual boundary is applied to the video unit; and
performing the conversion based on the determining,
wherein the mirrored padding process includes padding a corresponding sample of the unavailable luma sample and considering the corresponding sample as unavailable even when the corresponding sample is available for the virtual boundary, whereby the corresponding sample is located in a filter support region in the CC-ALF tool, and
wherein the unavailable luma sample is denoted as located at row M in the video unit and the corresponding sample to be padded is denoted as located at row N in the video unit, and wherein d (C,M)=d (N,C), whereby d (x,y) denotes a distance between row x and row y, wherein C represents a row where a representative luma sample is located in the video unit, where C, M and N are integers and M is not equal to N, and wherein the representative luma sample is a collocated luma sample of a chroma sample to be filtered in the video unit.
2. The method of claim 1 , wherein a position of the collocated luma sample of the chroma sample depends on a color format of the video.
3. The method of claim 2 , wherein the collocated luma sample of the chroma sample located at (x,y) is defined as one located at ( 2 x , 2 y ) if the color format is 4:2:0, or one located at ( 2 x,y ) if the color format is 4:2:2, or one located at (x,y) if the color format is 4:4:4.
4. The method of claim 1 , wherein the CC-ALF tool has a K×L filter shape, whereby K=4 and L=3; yM 1 , yL, yP 1 , yP 2 are y-coordinates of four sample rows in the K×L filter shape, whereby yM 1 =−1, yL=0, yP 1 =1, yP 2 =2, the representative luma sample is in the row yL=0; and the virtual boundary is located at a row CtbSizeY−4 in the video unit, whereby CtbSizeY represents a size of the video unit which is a coding tree unit (CTU).
5. The method of claim 4 , wherein the unavailable luma sample is padded using a nearest available row below the virtual boundary in a case that the virtual boundary is above the representative luma sample and wherein the corresponding sample is padded using a nearest available row above a row containing the corresponding sample.
6. The method of claim 5 , wherein, in a case that yL is equal to CtbSizeY−3 and a row above yM 1 is unavailable, a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 .
7. The method of claim 5 , wherein, in a case that yL is equal to CtbSizeY−4 and a row above yM 1 and a row at yM 1 are unavailable, a unavailable luma sample (x, yM 1 ) in a row at yM 1 is padded using a sample (x, yL) in a row at yL, a corresponding sample (x, yP 1 ) in a row at yP 1 is padded using a sample (x, yL) in a row at yL, and a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yL) in a row at yL.
8. The method of claim 4 , wherein the unavailable luma sample is padded using a nearest available row above the virtual boundary in a case that the virtual boundary is below the representative luma sample and wherein the corresponding sample is padded using a nearest available row below a row containing the corresponding sample.
9. The method of claim 8 , wherein in a case that yL is equal to CtbSizeY- 6 and a row at yP 2 is unavailable, the unavailable luma sample (x, yP 2 ) in the row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 .
10. The method of claim 8 , wherein, in a case that yL is equal to CtbSizeY- 5 and rows at yP 2 and yP 1 are unavailable, a unavailable luma sample (x, yP 2 ) at a row yP 2 is padded using a sample (x, yL) in a row at yL, a unavailable luma sample (x, yP 1 ) at a row yP 1 is padded using the sample (x, yL) in the row at yL, and a corresponding sample (x, yM 1 ) in a row at yM 1 is padded using the sample (x, yL) in the row at yL.
11. The method of claim 1 , wherein the conversion comprising includes encoding the video into the bitstream.
12. The method of claim 1 , wherein the conversion includes decoding the video from the bitstream.
13. 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 conversion between a video unit of a video and a bitstream of the video, that a mirrored padding process for padding an unavailable luma sample which is unavailable due to a virtual boundary is used during an application of a cross-component adaptive loop filtering (CC-ALF) tool to the video unit, in a case that the virtual boundary is applied to the video unit; and
perform the conversion based on the determination,
wherein the mirrored padding process includes padding a corresponding sample of the unavailable luma sample and considering the corresponding sample as unavailable even when the corresponding sample is available for the virtual boundary, whereby the corresponding sample is located in a filter support region in the CC-ALF tool, and
wherein the unavailable luma sample is denoted as located at row M in the video unit and the corresponding sample to be padded is denoted as located at row N in the video unit, and wherein d (C,M)=d (N,C), whereby d (x,y) denotes a distance between row x and row y, wherein C represents a row where a representative luma sample is located in the video unit, where C, M and N are integers and M is not equal to N, and wherein the representative luma sample is a collocated luma sample of a chroma sample to be filtered in the video unit.
14. The apparatus of claim 13 , wherein a position of the collocated luma sample of the chroma sample depends on a color format of the video;
wherein the collocated luma sample of the chroma sample located at (x,y) is defined as one located at ( 2 x , 2 y ) if the color format is 4:2:0, or one located at ( 2 x,y ) if the color format is 4:2:2, or one located at (x,y) if the color format is 4:4:4.
15. The apparatus of claim 13 , wherein the CC-ALF tool has a K×L filter shape, whereby K=4 and L=3; yM 1 , yL, yP 1 , yP 2 are y-coordinates of four sample rows in the K×L filter shape, whereby yM 1 =−1, yL=0, yP 1 =1, yP 2 =2, the representative luma sample is in the row yL=0; and the virtual boundary is located at a row CtbSizeY−4 in the video unit, whereby CtbSizeY represents a size of the video unit which is a coding tree unit (CTU);
wherein the unavailable luma sample is padded using a nearest available row below the virtual boundary in a case that the virtual boundary is above the representative luma sample and wherein the corresponding sample is padded using a nearest available row above a row containing the corresponding sample, wherein, in a case that yL is equal to CtbSizeY−3 and a row above yM 1 is unavailable, a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 ; or wherein, in a case that yL is equal to CtbSizeY−4 and a row above yM 1 and a row at yM 1 are unavailable, a unavailable luma sample (x, yM 1 ) in a row at yM 1 is padded using a sample (x, yL) in a row at yL, a corresponding sample (x, yP 1 ) in a row at yP 1 is padded using a sample (x, yL) in a row at yL, and a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yL) in a row at yL; or
wherein the unavailable luma sample is padded using a nearest available row above the virtual boundary in a case that the virtual boundary is below the representative luma sample and wherein the corresponding sample is padded using a nearest available row below a row containing the corresponding sample, wherein in a case that yL is equal to CtbSizeY- 6 and a row at yP 2 is unavailable, the unavailable luma sample (x, yP 2 ) in the row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 ; or wherein, in a case that yL is equal to CtbSizeY- 5 and rows at yP 2 and yP 1 are unavailable, a unavailable luma sample (x, yP 2 ) at a row yP 2 is padded using a sample (x, yL) in a row at yL, a unavailable luma sample (x, yP 1 ) at a row yP 1 is padded using the sample (x, yL) in the row at yL, and a corresponding sample (x, yM 1 ) in a row at yM 1 is padded using the sample (x, yL) in the row at yL.
16. A non-transitory computer-readable storage medium storing instructions that cause a processor to:
determine, for a conversion between a video unit of a video and a bitstream of the video, that a mirrored padding process for padding an unavailable luma sample which is unavailable due to a virtual boundary is used during an application of a cross-component adaptive loop filtering (CC-ALF) tool to the video unit, in a case that the virtual boundary is applied to the video unit; and
perform the conversion based on the determination,
wherein the mirrored padding process includes padding a corresponding sample of the unavailable luma sample and considering the corresponding sample as unavailable even when the corresponding sample is available for the virtual boundary, whereby the corresponding sample is located in a filter support region in the CC-ALF tool, and
wherein the unavailable luma sample is denoted as located at row M in the video unit and the corresponding sample to be padded is denoted as located at row N in the video unit, and wherein d (C,M)=d (N,C), whereby d (x,y) denotes a distance between row x and row y, wherein C represents a row where a representative luma sample is located in the video unit, where C, M and N are integers and M is not equal to N, and wherein the representative luma sample is a collocated luma sample of a chroma sample to be filtered in the video unit.
17. The non-transitory computer-readable storage medium of claim 16 , wherein a position of the collocated luma sample of the chroma sample depends on a color format of the video;
wherein the collocated luma sample of the chroma sample located at (x,y) is defined as one located at ( 2 x , 2 y ) if the color format is 4:2:0, or one located at ( 2 x,y ) if the color format is 4:2:2, or one located at (x,y) if the color format is 4:4:4.
18. The non-transitory computer-readable storage medium of claim 16 , wherein the CC-ALF tool has a K×L filter shape, whereby K=4 and L=3; yM 1 , yL, yP 1 , yP 2 are y-coordinates of four sample rows in the K×L filter shape, whereby yM 1 =−1, yL=0, yP 1 =1, yP 2 =2, the representative luma sample is in the row yL=0; and the virtual boundary is located at a row CtbSizeY−4 in the video unit, whereby CtbSizeY represents a size of the video unit which is a coding tree unit (CTU);
wherein the unavailable luma sample is padded using a nearest available row below the virtual boundary in a case that the virtual boundary is above the representative luma sample and wherein the corresponding sample is padded using a nearest available row above a row containing the corresponding sample, wherein, in a case that yL is equal to CtbSizeY−3 and a row above yM 1 is unavailable, a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 ; or wherein, in a case that yL is equal to CtbSizeY−4 and a row above yM 1 and a row at yM 1 are unavailable, a unavailable luma sample (x, yM 1 ) in a row at yM 1 is padded using a sample (x, yL) in a row at yL, a corresponding sample (x, yP 1 ) in a row at yP 1 is padded using a sample (x, yL) in a row at yL, and a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yL) in a row at yL; or
wherein the unavailable luma sample is padded using a nearest available row above the virtual boundary in a case that the virtual boundary is below the representative luma sample and wherein the corresponding sample is padded using a nearest available row below a row containing the corresponding sample, wherein in a case that yL is equal to CtbSizeY−6 and a row at yP 2 is unavailable, the unavailable luma sample (x, yP 2 ) in the row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 ; or wherein, in a case that yL is equal to CtbSizeY−5 and rows at yP 2 and yP 1 are unavailable, a unavailable luma sample (x, yP 2 ) at a row yP 2 is padded using a sample (x, yL) in a row at yL, a unavailable luma sample (x, yP 1 ) at a row yP 1 is padded using the sample (x, yL) in the row at yL, and a corresponding sample (x, yM 1 ) in a row at yM 1 is padded using the sample (x, yL) in the row at yL.
19. A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by a video processing apparatus, wherein the method comprises:
determining that a mirrored padding process for padding an unavailable luma sample which is unavailable due to a virtual boundary is used during an application of a cross-component adaptive loop filtering (CC-ALF) tool to a video unit of a video, in a case that the virtual boundary is applied to the video unit; and
generating the bitstream based on the determining,
wherein the mirrored padding process includes padding a corresponding sample of the unavailable luma sample and considering the corresponding sample as unavailable even when the corresponding sample is available for the virtual boundary, whereby the corresponding sample is located in a filter support region in the CC-ALF tool, and
wherein the unavailable luma sample is denoted as located at row M in the video unit and the corresponding sample to be padded is denoted as located at row N in the video unit, and wherein d (C,M)=d (N,C), whereby d (x,y) denotes a distance between row x and row y, wherein C represents a row where a representative luma sample is located in the video unit, where C, M and N are integers and M is not equal to N, and wherein the representative luma sample is a collocated luma sample of a chroma sample to be filtered in the video unit.
20. The non-transitory computer-readable recording medium of claim 19 , wherein a position of the collocated luma sample of the chroma sample depends on a color format of the video;
wherein the collocated luma sample of the chroma sample located at (x,y) is defined as one located at ( 2 x , 2 y ) if the color format is 4:2:0, or one located at ( 2 x,y ) if the color format is 4:2:2, or one located at (x,y) if the color format is 4:4:4;
wherein the CC-ALF tool has a K×L filter shape, whereby K=4 and L=3; yM 1 , yL, yP 1 , yP 2 are y-coordinates of four sample rows in the K×L filter shape, whereby yM 1 =−1, yL=0, yP 1 =1, yP 2 =2, the representative luma sample is in the row yL=0; and the virtual boundary is located at a row CtbSizeY−4 in the video unit, whereby CtbSizeY represents a size of the video unit which is a coding tree unit (CTU);
wherein the unavailable luma sample is padded using a nearest available row below the virtual boundary in a case that the virtual boundary is above the representative luma sample and wherein the corresponding sample is padded using a nearest available row above a row containing the corresponding sample, wherein, in a case that yL is equal to CtbSizeY−3 and a row above yM 1 is unavailable, a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 ; or wherein, in a case that yL is equal to CtbSizeY−4 and a row above yM 1 and a row at yM 1 are unavailable, a unavailable luma sample (x, yM 1 ) in a row at yM 1 is padded using a sample (x, yL) in a row at yL, a corresponding sample (x, yP 1 ) in a row at yP 1 is padded using a sample (x, yL) in a row at yL, and a corresponding sample (x, yP 2 ) in a row at yP 2 is padded using a sample (x, yL) in a row at yL; or
wherein the unavailable luma sample is padded using a nearest available row above the virtual boundary in a case that the virtual boundary is below the representative luma sample and wherein the corresponding sample is padded using a nearest available row below a row containing the corresponding sample, wherein in a case that yL is equal to CtbSizeY−6 and a row at yP 2 is unavailable, the unavailable luma sample (x, yP 2 ) in the row at yP 2 is padded using a sample (x, yP 1 ) in a row at yP 1 ; or wherein, in a case that yL is equal to CtbSizeY−5 and rows at yP 2 and yP 1 are unavailable, a unavailable luma sample (x, yP 2 ) at a row yP 2 is padded using a sample (x, yL) in a row at yL, a unavailable luma sample (x, yP 1 ) at a row yP 1 is padded using the sample (x, yL) in the row at yL, and a corresponding sample (x, yM 1 ) in a row at yM 1 is padded using the sample (x, yL) in the row at yL.