Loop filtering, video encoding, and video decoding methods and apparatus, storage medium, and electronic device
View Patent ↗A loop filtering method, a video coding and decoding method and apparatus, a medium, and an electronic device that can obtain block classification information of a luma component in a video image frame in a case that adaptive loop filtering is performed (S 710 ), use the block the block classification information to determine block classification information of a chroma component in the video image frame in a case that cross-component adaptive loop filtering is performed (S 720 ); and select a corresponding filter coefficient to perform cross-component adaptive loop filtering on the chroma component according to the block classification information of the chroma component.
1 . A method performed by a video encoding device or a video decoding device, the method comprising:
obtaining block classification information of a luma component in a video image frame, the block classification information of the luma component including a subblock level classification result that indicates that two or more subblocks belong to a different classification categories and a merging result that indicates that different classification categories share first filter coefficients for adaptive loop filtering (ALF) performed on the luma component;
determining, based on the block classification information of the luma component, block classification information of a chroma component in the video image frame;
determining, based on the merging result of the luma component, a merging result of the chroma component; and
selecting, based on the block classification information of the chroma component and the merging result of the chroma component, second filter coefficients to perform cross-component adaptive loop filtering (CC-ALF) processing on the chroma component.
2 . The method according to claim 1 , wherein the obtaining the block classification information of the luma component is performed when ALF is performed on the luma component, and wherein the determining the block classification information of the chroma component is performed when CC-ALF is performed on the chroma component.
3 . The method according to claim 2 , wherein the determining comprises:
using a classification result of a subblock when ALF is performed on the luma component as a classification result of a block of a same size when CC-ALF is performed on the chroma component.
4 . The method according to claim 2 , wherein the determining comprises:
using a classification result and a corresponding geometric transform type of a subblock when ALF is performed on the luma component as a classification result and a geometric transform type of a block of a same size when CC-ALF is performed on the chroma component.
5 . The method according to claim 1 , wherein the second filter coefficients correspond to a diamond-shaped filter.
6 . The method according to claim 2 , further comprising:
determining, based on a rate distortion cost of performing filter merging when an ALF process is performed on the luma component and a rate distortion cost of performing filter merging when a CC-ALF process is performed on the chroma component, one or more merging results when ALF is performed on the luma component and when CC-ALF is performed on the chroma component.
7 . The method according to claim 2 , further comprising:
determining, based on a quantity of filters determined when ALF is performed on the luma component, a quantity of available filters when CC-ALF is performed on the chroma component.
8 . The method according to claim 1 , further comprising:
performing decoding processing on a video bitstream according to an ALF processing result of the luma component and a CC-ALF processing result of the chroma component.
9 . The method according to claim 8 , the method further comprising:
decoding the video bitstream to obtain a first flag bit corresponding to a current slice, a value of the first flag bit being used for indicating whether a chroma component of a target block in the current slice uses the cross-component adaptive loop filtering processing.
10 . The method according to claim 9 , wherein:
a first value of the first flag bit indicates that chroma components of some target blocks in the current slice use the cross-component adaptive loop filtering processing, or indicates that chroma components of all target blocks in the current slice use the cross-component adaptive loop filtering processing; or
a second value of the first flag bit indicates that chroma components of all target blocks in the current slice do not use the cross-component adaptive loop filtering processing.
11 . The method according to claim 9 , further comprising: when the value of the first flag bit indicates that chroma components of some target blocks in the current slice use the cross-component adaptive loop filtering processing, determining a second flag bit corresponding to each target block comprised in the current slice, the value of the second flag bit being used for indicating whether a chroma component of a corresponding target block uses the cross-component adaptive loop filtering processing.
12 . The method according to claim 1 , further comprising:
performing encoding processing on the video image frame according to an ALF processing result of the luma component and a CC-ALF processing result of the chroma component, to obtain a video bitstream.
13 . The method according to claim 12 , further comprising:
encoding, in the video bitstream, a first flag bit corresponding to a current slice of the video image frame, wherein a value of the first flag bit is used for indicating whether a chroma component of a target block in the current slice uses the CC-ALF processing.
14 . An apparatus comprising:
at least one memory configured to store computer program code; and
at least one processor configured to access the at least one memory and execute the computer program code, the computer program code including:
obtaining code configured to cause the at least one processor to obtain block classification information of a luma component in a video image frame, the block classification information of the luma component including a subblock level classification result that indicates that two or more subblocks belong to different classification categories, and a merging result that indicates that different classification categories share first filter coefficients for adaptive loop filtering (ALF) performed on the luma component;
first determining code configured to cause the at least one processor to determine, based on the block classification information of the luma component, block classification information of a chroma component in the video image frame;
second determining code configured to cause the at least one processor to determine, based on the merging result of the luma component, a merging result of the chroma component; and
selecting code configured to cause the at least one processor to select, based on the block classification information of the chroma component and the merging result of the chroma component, a filter coefficient to perform cross-component adaptive loop filtering (CC-ALF) processing on the chroma component.
15 . The apparatus according to claim 14 , wherein:
the obtaining code is configured to cause the at least one processor to obtain the block classification information of the luma component when adaptive loop filtering (ALF) is performed on the luma component; and
the first determining code is configured to cause the at least one processor to determine the block classification information of the chroma component when CC-ALF is performed on the chroma component.
16 . The apparatus according to claim 14 , wherein the first determining code is configured to cause the at least one processor to determine the block classification information of the chroma component by using a classification result of a subblock when ALF is performed on the luma component as a classification result of a block of a same size when CC-ALF is performed on the chroma component.
17 . The apparatus according to claim 14 , wherein the first determining code is configured to cause the at least one processor to determine the block classification information of the chroma component by using a classification result and a corresponding geometric transform type of a subblock when ALF is performed on the luma component as a classification result and a geometric transform type of a block of a same size when CC-ALF is performed on the chroma component.
18 . The apparatus according to claim 14 , wherein the second filter coefficients correspond to a diamond-shaped filter.
19 . The apparatus according to claim 14 , wherein the second determining code is configured to cause the at least one processor determine, based on a rate distortion cost of performing filter merging when an ALF process is performed on the luma component and a rate distortion cost of performing filter merging when a CC-ALF process is performed on the chroma component, one or more merging results when ALF is performed on the luma component and when CC-ALF is performed on the chroma component.
20 . A non-transitory computer readable medium storing computer program code, the program code configured to cause at least one processor to:
obtain block classification information of a luma component in a video image frame, the block classification information of the luma component including a subblock level classification result that indicates that two or more subblocks belong to a different classification category, and a merging result that indicates that different classification categories share first filter coefficients for adaptive loop filtering (ALF) performed on the luma component;
determine, based on the block classification information of the luma component, block classification information of a chroma component in the video image frame;
determine, based on the merging result of the luma component, a merging result of the chroma component; and
select, based on the block classification information of the chroma component, a filter coefficient to perform cross-component adaptive loop filtering (CC-ALF) processing on the chroma component.