Decoding method and apparatus, encoding method and apparatus, and device, storage medium and program product

By sharing the same set of filter coefficients to perform in-loop filtering on the reconstructed blocks of the chrominance components, the problem of high bit overhead in encoding the chrominance component filtering parameters is solved, thus improving coding performance.

WO2026081207A1PCT designated stage Publication Date: 2026-04-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2024-10-18
Publication Date
2026-04-23

Smart Images

  • Figure CN2024125881_23042026_PF_FP_ABST
    Figure CN2024125881_23042026_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of encoding and decoding. Disclosed are a decoding method and apparatus, an encoding method and apparatus, and a device, a storage medium and a program product, which can solve the problems of the waste of encoding bits and the adverse impact on the encoding performance. The decoding method in the embodiments of the present application comprises: parsing a bit stream, so as to obtain a first filter coefficient set; and on the basis of the first filter coefficient set, performing in-loop filtering on a reconstructed block of a first chroma component, and on the basis of the first filter coefficient set, performing in-loop filtering on a reconstructed block of a second chroma component. The embodiments of the present application are applied to video encoding and decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Decoding methods, encoding methods, devices, equipment, storage media and program products Technical Field

[0001] This application belongs to the field of encoding and decoding technology, specifically relating to a decoding method, encoding method, apparatus, device, storage medium, and program product. Background Technology

[0002] In video coding standards, the reconstructed image can be filtered using a Cross-Component Adaptive Loop Filter (CCALF). CCALF filters the chroma component of the reconstructed image by utilizing the luminance component, thereby minimizing the error between the chroma reconstructed image and the original image.

[0003] Typically, when filtering chromaticity components using CCALF, the corresponding filters are used for the chromaticity U component (blue component) and the chromaticity V component (red component), respectively. That is, the filter corresponding to the chromaticity U component is used to filter the chromaticity U component, and the filter corresponding to the chromaticity V component is used to filter the chromaticity V component.

[0004] However, the above-mentioned filtering methods for chroma components result in high encoding bit overhead for the filtering parameters of the chroma components, which leads to a waste of encoding bits and is not conducive to improving encoding performance.

[0005] Summary of the Invention

[0006] This application provides a decoding method, encoding method, apparatus, device, storage medium, and program product that can solve the problem of high encoding bit overhead in the filtering parameters of chroma components, resulting in wasted encoding bits.

[0007] In a first aspect, a decoding method is provided, comprising: parsing the bitstream to obtain a first set of filtering coefficients; performing intra-block filtering on the reconstructed block of a first chroma component based on the first set of filtering coefficients; and performing intra-block filtering on the reconstructed block of a second chroma component based on the first set of filtering coefficients.

[0008] In conjunction with the first aspect, in some implementations, the above-mentioned parsing of the bitstream to obtain the first filtering coefficients includes: parsing the first syntax element in the bitstream to obtain an Adaptive Parameter Set (APS) index, which is used to indicate the first APS in the bitstream, the first APS including at least one set of filtering coefficients, the set of filtering coefficients including N sets of filtering coefficients, the first set of filtering coefficients being one of the at least one set of filtering coefficients, where N is a positive integer.

[0009] In conjunction with the first aspect, in some implementations, the method further includes: obtaining N sets of filter coefficients in the first filter coefficient set based on parsing the second syntax element in the first APS; wherein, the filter coefficient set for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients in the N sets of filter coefficients in the first filter coefficient set.

[0010] In conjunction with the first aspect, in some implementations, the above decoding method further includes: parsing the second syntax element in the first APS to obtain the absolute value of the power exponent and the power exponent sign; and obtaining N sets of filter coefficients in the first filter coefficient set based on the absolute value of the power exponent and the power exponent sign.

[0011] In conjunction with the first aspect, in some implementations, the above decoding method further includes: parsing the third syntax element in the bitstream to obtain first identification information, which is used to indicate a first index, which is used to indicate the filter coefficient group for filtering the first chroma component in the loop of the coding tree unit (CTU).

[0012] In conjunction with the first aspect, in some implementations, the above decoding method further includes: parsing the fourth syntax element in the bitstream to obtain second identification information, which is used to indicate a second index, which is used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

[0013] In conjunction with the first aspect, in some implementations, the above decoding method further includes: parsing the fifth syntax element in the bitstream to obtain first indication information, which is used to indicate whether the same set of filtering coefficients is used for in-loop filtering of the first chromaticity component and the second chromaticity component of the CTU.

[0014] In conjunction with the first aspect, in some implementations, the above decoding method further includes: parsing the sixth syntax element in the bitstream to obtain third identification information, which is used to indicate a third index, which is used to indicate the filter coefficient group for the first and second chromaticity components of the CTU in-loop filtering.

[0015] In conjunction with the first aspect, in some implementations, the above decoding method further includes: parsing the seventh syntax element in the bitstream to obtain second indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chroma component and the second chroma component within the loop.

[0016] In conjunction with the first aspect, in some implementations, the above-mentioned in-loop filtering of the reconstruction block of the first chromaticity component based on the first set of filter coefficients, and the in-loop filtering of the reconstruction block of the second chromaticity component based on the first set of filter coefficients, includes: in-loop filtering of the reconstruction block of the first chromaticity component based on the first set of filter coefficients and the first filtering information of the first chromaticity component, and in-loop filtering of the reconstruction block of the second chromaticity component based on the second set of filter coefficients and the second filtering information of the second chromaticity component; wherein, the first set of filter coefficients and the second set of filter coefficients are the same set of filter coefficients in the first set of filter coefficients; or, the first set of filter coefficients and the second set of filter coefficients are different sets of filter coefficients in the first set of filter coefficients; and the first filtering information and the second filtering information are both information output from the preceding stage of in-loop filtering.

[0017] In conjunction with the first aspect, in some implementations, the above-mentioned filtering of the reconstruction block within the first chromaticity component based on the first set of filtering coefficients, and filtering of the reconstruction block within the second chromaticity component based on the first set of filtering coefficients, includes: filtering the reconstruction block within the first chromaticity component based on the first set of filtering coefficients and third filtering information, and filtering the reconstruction block within the second chromaticity component based on the first set of filtering coefficients and third filtering information; wherein the third filtering information includes any one of the following: the reconstruction block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstruction block of the adjacent chromaticity components of the chromaticity component of the current block.

[0018] In conjunction with the first aspect, in some implementations, the first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

[0019] In the decoding method of this application embodiment, the bitstream can be parsed to obtain a first set of filtering coefficients. Then, based on the first set of filtering coefficients, in-loop filtering is performed on the reconstructed block of the first chroma component, and in-loop filtering is also performed on the reconstructed block of the second chroma component based on the first set of filtering coefficients. This scheme allows in-loop filtering to be performed on both the reconstructed blocks of the first and second chroma components using the first set of filtering coefficients. That is, the reconstructed blocks of the first and second chroma components can share the same set of filtering coefficients to achieve in-loop filtering, thus reducing the bit overhead of the chroma component filtering parameters and saving coding bits, thereby improving overall coding performance.

[0020] Secondly, an encoding method is provided, the method comprising: determining a first set of filtering coefficients; filtering the reconstructed block loop of a first chroma component based on the first set of filtering coefficients, and filtering the reconstructed block loop of a second chroma component based on the first set of filtering coefficients; and writing the first set of filtering coefficients into the bitstream.

[0021] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a first syntax element into the bitstream, the first syntax element being used to characterize an APS index, the APS index being used to indicate a first APS in the bitstream, the first APS including at least one set of filter coefficients, the set of filter coefficients including N sets of filter coefficients, the first set of filter coefficients being one of the at least one set of filter coefficients, where N is a positive integer.

[0022] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a second syntax element into the first APS, the second syntax element being used to characterize N sets of filter coefficients in the first filter coefficient set; wherein, the filter coefficient set for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients among the N sets of filter coefficients in the first filter coefficient set.

[0023] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a second syntax element into the first APS, the second syntax element being used to characterize the absolute value of the power exponent and the sign of the power exponent, the absolute value of the power exponent and the sign of the power exponent being used to determine N sets of filter coefficients in the first set of filter coefficients.

[0024] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a third syntax element into the bitstream, the third syntax element being used to characterize first identification information, the first identification information being used to indicate a first index, and the first index being used to indicate a set of filter coefficients for in-loop filtering of the first chromaticity component of the CTU.

[0025] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a fourth syntax element into the bitstream, the fourth syntax element being used to characterize the second identification information, the second identification information being used to indicate the second index, and the second index being used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

[0026] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a fifth syntax element into the bitstream, the fifth syntax element being used to characterize first indication information, the first indication information being used to indicate whether the same set of filtering coefficients is used for in-loop filtering of the first and second chromaticity components of the CTU.

[0027] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a sixth syntax element into the bitstream, the sixth syntax element being used to characterize third identification information, the third identification information being used to indicate a third index, and the third index being used to indicate a set of filter coefficients for in-loop filtering of the first and second chromaticity components of the CTU.

[0028] In conjunction with the second aspect, in some implementations, the above encoding method further includes: writing a seventh syntax element into the bitstream, the seventh syntax element being used to characterize second indication information, the second indication information being used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component within the loop.

[0029] In conjunction with the second aspect, in some implementations, the above-mentioned in-loop filtering of the reconstruction block of the first chromaticity component based on the first set of filter coefficients, and the in-loop filtering of the reconstruction block of the second chromaticity component based on the first set of filter coefficients, includes: in-loop filtering of the reconstruction block of the first chromaticity component based on the first set of filter coefficients and the first filtering information of the first chromaticity component, and in-loop filtering of the reconstruction block of the second chromaticity component based on the second set of filter coefficients and the second filtering information of the second chromaticity component; wherein, the first set of filter coefficients and the second set of filter coefficients are the same set of filter coefficients in the first set of filter coefficients; or, the first set of filter coefficients and the second set of filter coefficients are different sets of filter coefficients in the first set of filter coefficients; the first filtering information and the second filtering information are both information output from the preceding stage of in-loop filtering.

[0030] In conjunction with the second aspect, in some implementations, the above-mentioned filtering of the reconstruction block within the first chromaticity component based on the first set of filter coefficients, and filtering of the reconstruction block within the second chromaticity component based on the first set of filter coefficients, includes: filtering the reconstruction block within the first chromaticity component based on the first set of filter coefficients and third filter information, and filtering the reconstruction block within the second chromaticity component based on the first set of filter coefficients and third filter information; wherein the third filter information includes any one of the following: the reconstruction block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstruction block of the adjacent chromaticity components of the chromaticity component of the current block.

[0031] In conjunction with the second aspect, in some implementations, the aforementioned determination of the first set of filter coefficients includes:

[0032] The first covariance matrix is ​​determined based on the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component.

[0033] The first error vector is determined based on the error vector of the first chromaticity component and the error vector of the second chromaticity component.

[0034] The first set of filter coefficients is determined based on the first covariance matrix and the first error vector.

[0035] In conjunction with the second aspect, in some implementations, determining the first set of filter coefficients based on the first covariance matrix and the first error vector includes: determining the second set of filter coefficients based on the first covariance matrix and the first error vector; calculating the first total distortion cost, the second total distortion cost, and the third total distortion cost; wherein the first total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the third set of filter coefficients, and the third set of filter coefficients is the set of filter coefficients for the first chromaticity component; the second total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the fourth set of filter coefficients, and the fourth set of filter coefficients is the set of filter coefficients for the second chromaticity component; the third total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the second set of filter coefficients; and determining the first set of filter coefficients based on the first total distortion cost, the second total distortion cost, and the third total distortion cost.

[0036] In conjunction with the second aspect, in some implementations, the above encoding method further includes: calculating a first rate-distortion cost, a second rate-distortion cost, and a third rate-distortion cost, wherein the first rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial filter coefficient set of the first chromaticity component, the second rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial filter coefficient set of the second chromaticity component, and the third rate-distortion cost is the rate-distortion cost of the first chromaticity component under the second filter coefficient set; and determining a third filter coefficient set based on the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost.

[0037] In conjunction with the second aspect, in some implementations, the above method further includes: calculating a fourth rate-distortion cost, a fifth rate-distortion cost, and a sixth rate-distortion cost, wherein the fourth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the initial filter coefficient set of the first chromaticity component, the fifth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the initial filter coefficient set of the second chromaticity component, and the sixth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the second filter coefficient set; and determining a fourth filter coefficient set based on the fourth rate-distortion cost, the fifth rate-distortion cost, and the sixth rate-distortion cost.

[0038] In conjunction with the second aspect, in some implementations, the above encoding method further includes: determining to use the same set of filter coefficients to filter the first chromaticity component and the second chromaticity component within the loop when the seventh rate-distortion cost is less than the sum of the eighth rate-distortion cost and the ninth rate-distortion cost; wherein the seventh rate-distortion cost is the minimum of the first total rate-distortion cost, the second total rate-distortion cost, and the third total rate-distortion cost; the eighth rate-distortion cost is the minimum of the rate-distortion cost when the first chromaticity component is not filtered and the tenth rate-distortion cost, the tenth rate-distortion cost being the minimum of the rate-distortion cost of the first chromaticity component under the filter coefficient set of the reconstructed block and the rate-distortion cost of the first chromaticity component under the third filter coefficient set; the ninth rate-distortion cost is the minimum of the rate-distortion cost when the second chromaticity component is not filtered and the eleventh rate-distortion cost, the eleventh rate-distortion cost being the minimum of the rate-distortion cost of the second chromaticity component under the filter coefficient set of the reconstructed block and the rate-distortion cost of the second chromaticity component under the fourth filter coefficient set.

[0039] In conjunction with the second aspect, in some implementations, the first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

[0040] In the encoding method of this application embodiment, a first set of filtering coefficients can be determined. Then, based on the first set of filtering coefficients, in-loop filtering is performed on the reconstructed block of the first chroma component, and in-loop filtering is also performed on the reconstructed block of the second chroma component based on the first set of filtering coefficients. Finally, the first set of filtering coefficients is written into the bitstream. This scheme allows in-loop filtering to be performed on both the reconstructed blocks of the first and second chroma components using the first set of filtering coefficients. That is, the reconstructed blocks of the first and second chroma components can share the same set of filtering coefficients to achieve in-loop filtering, thus reducing the bit overhead of the chroma component filtering parameters and saving encoding bits. Furthermore, by sending the first set of filtering coefficients to the decoding end through the bitstream, the decoding end can easily use the same set of filtering coefficients to perform in-loop filtering on both the reconstructed blocks of the first and second chroma components. This improves the overall encoding performance.

[0041] Thirdly, a decoding apparatus is provided, comprising: a parsing module and a filtering module. The parsing module is used to parse the bitstream to obtain a first set of filtering coefficients. The filtering module is used to perform in-loop filtering on the reconstructed block of a first chroma component based on the first set of filtering coefficients obtained by the parsing module, and to perform in-loop filtering on the reconstructed block of a second chroma component based on the first set of filtering coefficients obtained by the parsing module.

[0042] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is specifically used to: parse the first syntax element in the bitstream to obtain the APS index, which is used to indicate the first APS in the bitstream, the first APS including at least one set of filter coefficients, the set of filter coefficients including N sets of filter coefficients, the aforementioned first set of filter coefficients being one of the at least one set of filter coefficients, where N is a positive integer.

[0043] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is also used to obtain N sets of filter coefficients in the first filter coefficient set based on parsing the second syntax element in the first APS; wherein, the filter coefficient set for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients in the N sets of filter coefficients in the first filter coefficient set.

[0044] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is also used to: parse the second syntax element in the first APS to obtain the absolute value and sign of the power exponent; and based on the absolute value and sign of the power exponent, obtain N sets of filter coefficients in the first set of filter coefficients.

[0045] In conjunction with the second aspect, in some implementations, the aforementioned parsing module is also used to parse the third syntax element in the bitstream to obtain first identification information. This first identification information is used to indicate a first index, which in turn indicates the filter coefficient group for filtering the first chromaticity component within the loop of the CTU.

[0046] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is also used to parse the fourth syntax element in the bitstream to obtain second identification information. This second identification information is used to indicate a second index, which in turn indicates the filter coefficient group for filtering the second chromaticity component within the loop of the CTU.

[0047] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is also used to parse the fifth syntax element in the bitstream to obtain first indication information, which is used to indicate whether the same set of filtering coefficients is used for in-loop filtering of the first and second chromaticity components of the CTU.

[0048] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is also used to parse the sixth syntax element in the bitstream to obtain third identification information. This third identification information is used to indicate a third index, which in turn indicates the filter coefficient group for the loop filtering of the first and second chromaticity components of the CTU.

[0049] In conjunction with the third aspect, in some implementations, the aforementioned parsing module is also used to parse the seventh syntax element in the bitstream to obtain second indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chroma component and the second chroma component within the loop.

[0050] In conjunction with the third aspect, in some implementations, the aforementioned filtering module is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component; wherein the aforementioned first filtering coefficient group and second filtering coefficient group are the same set of filtering coefficients in the first set of filtering coefficients; or, the aforementioned first filtering coefficient group and second filtering coefficient group are different sets of filtering coefficients in the first set of filtering coefficients; the aforementioned first filtering information and second filtering information are both information output from the preceding stage of in-loop filtering.

[0051] In conjunction with the third aspect, in some implementations, the aforementioned filtering module is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information; wherein, the aforementioned third filtering information includes any one of the following: the reconstruction block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstruction blocks of adjacent chromaticity components of the chromaticity component of the current block.

[0052] In conjunction with the third aspect, in some implementations, the first chromaticity component mentioned above is the Cb component, and the second chromaticity component mentioned above is the Cr component.

[0053] Fourthly, an encoding apparatus is provided, comprising: a filtering module and an encoding module. The filtering module is configured to determine a first set of filtering coefficients; and, based on the first set of filtering coefficients, perform in-loop filtering on the reconstructed block of a first chroma component, and, based on the first set of filtering coefficients, perform in-loop filtering on the reconstructed block of a second chroma component. The encoding module is configured to write the first set of filtering coefficients obtained by the filtering module into the bitstream.

[0054] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is further used to write a first syntax element into the bitstream. The first syntax element is used to characterize the APS index, which is used to indicate the first APS in the bitstream. The first APS includes at least one set of filter coefficients, which includes N sets of filter coefficients. The first set of filter coefficients is one of the filter coefficient sets in the at least one set of filter coefficients, where N is a positive integer.

[0055] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write the second syntax element into the first APS, the second syntax element being used to characterize the N sets of filter coefficients in the first set of filter coefficients; wherein, the filter coefficient set for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients among the N sets of filter coefficients in the first set of filter coefficients.

[0056] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write the second syntax element into the first APS. The second syntax element is used to characterize the absolute value of the power exponent and the sign of the power exponent, which are used to determine the N sets of filter coefficients in the first set of filter coefficients.

[0057] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write a third syntax element into the bitstream. This third syntax element is used to characterize the first identification information, which is used to indicate the first index. The first index is used to indicate the filter coefficient group for the first chromaticity component loop filtering of the CTU.

[0058] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write the fourth syntax element into the bitstream. This fourth syntax element is used to characterize the second identification information, which is used to indicate the second index. The second index is used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

[0059] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write a fifth syntax element into the bitstream. This fifth syntax element is used to characterize the first indication information, which indicates whether the same set of filtering coefficients is used for in-loop filtering of the first and second chromaticity components of the CTU.

[0060] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write a sixth syntax element into the bitstream. This sixth syntax element is used to characterize the third identification information, which is used to indicate the third index. This third index is used to indicate the filter coefficient group for the in-loop filtering of the first and second chromaticity components of the CTU.

[0061] In conjunction with the fourth aspect, in some implementations, the aforementioned encoding module is also used to write a seventh syntax element into the bitstream. This seventh syntax element is used to characterize second indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component within the loop.

[0062] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component; wherein, the aforementioned first filtering coefficient group and second filtering coefficient group are the same set of filtering coefficients in the first filtering coefficient set; or, the aforementioned first filtering coefficient group and second filtering coefficient group are different sets of filtering coefficients in the first filtering coefficient set; the aforementioned first filtering information and second filtering information are both information output from the preceding stage of in-loop filtering.

[0063] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information; wherein, the aforementioned third filtering information includes any one of the following: the reconstruction block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstruction block of the adjacent chromaticity components of the chromaticity component of the current block.

[0064] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is specifically used to: determine the first covariance matrix based on the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component; determine the first error vector based on the error vector of the first chromaticity component and the error vector of the second chromaticity component; and determine the first set of filtering coefficients based on the first covariance matrix and the first error vector.

[0065] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is specifically used for: determining a second set of filtering coefficients based on a first covariance matrix and a first error vector; calculating a first total distortion cost, a second total distortion cost, and a third total distortion cost; wherein, the first total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the third set of filtering coefficients, which is the set of filtering coefficients for the first chromaticity component; the second total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a fourth set of filtering coefficients, which is the set of filtering coefficients for the second chromaticity component; the third total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the second set of filtering coefficients; and determining the first set of filtering coefficients based on the first total distortion cost, the second total distortion cost, and the third total distortion cost.

[0066] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is further configured to: calculate a first rate-distortion cost, a second rate-distortion cost, and a third rate-distortion cost, wherein the first rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filtering coefficients for the first chromaticity component, the second rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filtering coefficients for the second chromaticity component, and the third rate-distortion cost is the rate-distortion cost of the first chromaticity component under the second set of filtering coefficients; and determine a third set of filtering coefficients based on the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost.

[0067] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is further configured to: calculate the fourth rate-distortion cost, the fifth rate-distortion cost, and the sixth rate-distortion cost, wherein the fourth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the initial filter coefficient set of the first chromaticity component, the fifth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the initial filter coefficient set of the second chromaticity component, and the sixth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the second filter coefficient set; and determine the fourth filter coefficient set based on the fourth rate-distortion cost, the fifth rate-distortion cost, and the sixth rate-distortion cost.

[0068] In conjunction with the fourth aspect, in some implementations, the aforementioned filtering module is further configured to determine whether to use the same set of filtering coefficients to filter the first chromaticity component and the second chromaticity component within the loop, provided that the seventh rate distortion cost is less than the sum of the eighth and ninth rate distortion costs. Specifically, the seventh rate distortion cost is the minimum of the first total rate distortion cost, the second total rate distortion cost, and the third total rate distortion cost; the eighth rate distortion cost is the minimum of the rate distortion cost when the first chromaticity component is not filtered and the tenth rate distortion cost, where the tenth rate distortion cost is the minimum of the rate distortion cost of the first chromaticity component under the set of filtering coefficients in the reconstructed block and the rate distortion cost of the first chromaticity component under the third set of filtering coefficients; and the ninth rate distortion cost is the minimum of the rate distortion cost when the second chromaticity component is not filtered and the eleventh rate distortion cost, where the eleventh rate distortion cost is the minimum of the rate distortion cost of the second chromaticity component under the set of filtering coefficients in the reconstructed block and the rate distortion cost of the second chromaticity component under the fourth set of filtering coefficients.

[0069] In conjunction with the fourth aspect, in some implementations, the first chromaticity component mentioned above is the Cb component, and the second chromaticity component mentioned above is the Cr component.

[0070] Fifthly, a decoder is provided, comprising: a memory and a processor, wherein the memory is used to store executable data instructions, and the processor is used to implement the decoding method as described in the first aspect or its various implementations above when executing the executable instructions stored in the memory.

[0071] In a sixth aspect, an encoder is provided, comprising: a memory and a processor, the memory for storing executable data instructions, and the processor for implementing the encoding method as described in the second aspect or its various implementations above when executing the executable instructions stored in the memory.

[0072] In a seventh aspect, a computer storage medium is provided for storing a bitstream generated by the encoding method described in the second aspect or its various implementations above.

[0073] Eighthly, an encoding / decoding system is provided, including an encoder and a decoder. The decoder is used to execute the decoding method described in the first aspect or its various implementations, and the encoder is used to execute the encoding method described in the second aspect or its various implementations.

[0074] In a ninth aspect, a chip is provided, the chip including a processor and a communication interface coupled to the processor, the processor being configured to run programs or instructions to implement the decoding method as described in the first aspect or its various implementations above, or to implement the encoding method as described in the second aspect or its various implementations above.

[0075] In a tenth aspect, a computer-readable storage medium is provided that stores a computer program, which, when executed by at least one processor, implements the decoding method as described in the first aspect or its various implementations above, or implements the encoding method as described in the second aspect or its various implementations above.

[0076] Eleventhly, a computer program product is provided, including computer program instructions that, when executed, implement the decoding method as described in the first aspect or its various implementations, or implement the encoding method as described in the second aspect or its various implementations.

[0077] In a twelfth aspect, a computer program is provided that, when run on a computer, causes the computer to perform the decoding method as described in the first aspect or its various implementations, or to perform the encoding method as described in the second aspect or its various implementations. Attached Figure Description

[0078] Figure 1 is a schematic diagram of an example of the shape of the CCALF filter provided in an embodiment of this application;

[0079] Figure 2 is a schematic diagram of a simplified video encoding and decoding process provided in an embodiment of this application.

[0080] Figure 3 is a schematic diagram of the architecture of the encoding and decoding system provided in an embodiment of this application;

[0081] Figure 4A is a schematic diagram of the encoder provided in an embodiment of this application;

[0082] Figure 4B is a schematic diagram of the decoder provided in an embodiment of this application;

[0083] Figure 5 is a flowchart illustrating the encoding method provided in an embodiment of this application;

[0084] Figure 6 is a flowchart illustrating the encoding method provided in an embodiment of this application;

[0085] Figure 7 is a flowchart illustrating the decoding method provided in an embodiment of this application;

[0086] Figure 8 is a flowchart illustrating the decoding method provided in an embodiment of this application;

[0087] Figure 9 is a schematic diagram of the structure of the encoding device provided in an embodiment of this application;

[0088] Figure 10 is a schematic diagram of the structure of the encoding device provided in an embodiment of this application;

[0089] Figure 11 is a schematic diagram of the decoding device provided in an embodiment of this application;

[0090] Figure 12 is a schematic diagram of the structure of the decoding device provided in the embodiment of this application. Detailed Implementation

[0091] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0092] In the description of the embodiments of this application, terms such as "first" and "second" are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, without limiting the number of objects; for example, the first object can be one or more. Furthermore, "or" in this application indicates at least one of the connected objects. For example, "A or B" covers three scenarios: Scenario 1: including A but not B; Scenario 2: including B but not A; Scenario 3: including both A and B. The character " / " generally indicates that the preceding and following objects have an "or" relationship.

[0093] In the description of the embodiments of this application, "instruction" can be either a direct instruction (or explicit instruction) or an indirect instruction (or implicit instruction). A direct instruction can be understood as the sender explicitly informing the receiver of specific information, the operation to be performed, or the requested result in the instruction sent. An indirect instruction can be understood as the receiver determining the corresponding information based on the instruction sent by the sender, or making a judgment and determining the operation to be performed or the requested result based on the judgment result.

[0094] In the description of the embodiments of this application, "at least one (item)," "at least one of," etc., refer to any one, any two, or a combination of two or more of the included objects. For example, at least one (item) of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)."

[0095] In the description of the embodiments of this application, "multiple" means two or more. For example, multiple image blocks refer to two or more image blocks. "At least two" has a similar meaning to "multiple," and in some embodiments, the two can be used interchangeably.

[0096] In the description of embodiments of this application, the terms "including," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0097] The following explains some concepts and / or terms involved in the decoding method, encoding method, apparatus, device, storage medium, and program product provided in the embodiments of this application.

[0098] 1. Digital video compression technology

[0099] Digital video compression technology primarily compresses massive amounts of digital video data to facilitate transmission and storage. With the surge in internet video and increasing demands for video clarity, while existing digital video compression standards can save considerable video data, there is still a need to pursue better digital video compression technologies to reduce the bandwidth and traffic burden of digital video transmission.

[0100] In digital video encoding, the encoder reads unequal pixels from the original video sequence in different color formats, including luminance and chrominance components; that is, the encoder reads a black-and-white or color image. This image is then divided into blocks, and the block data is encoded by the encoder. Modern encoders typically use a hybrid frame coding mode, generally including intra-frame and inter-frame prediction, transform and quantization, inverse transform and inverse quantization, loop filtering, and entropy coding. Intra-frame prediction only references information from the same frame to predict pixel information within the current block, eliminating spatial redundancy. Inter-frame prediction can reference information from different frames, using motion estimation to search for the motion vector information that best matches the current block, eliminating temporal redundancy. Transform converts the predicted image blocks to the frequency domain, redistributing energy; combined with quantization, it removes information that the human eye is insensitive to, eliminating visual redundancy. Loop filtering uses statistical information to filter the image, improving both subjective and objective image quality. Entropy coding can eliminate character redundancy based on the current context model and the probability information of the binary bitstream.

[0101] 2. Video encoding technology

[0102] Video sequences contain a series of redundant information, including spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. To remove as much redundant information as possible from video sequences and reduce the amount of data representing the video, video coding techniques have been proposed to reduce storage space and save transmission bandwidth. Video coding techniques are also known as video compression techniques.

[0103] As a new generation of video coding standard, VVC not only helps users store more high-definition video on their devices, thereby reducing data traffic on the network, but also supports high resolution, high dynamic range, screen content encoding and other functions in the main10 profile, improving compression performance and enabling users to reduce data size by 50% while maintaining the same subjective video quality.

[0104] It should be noted that in encoding algorithms based on a hybrid encoding architecture, the above compression encoding methods can be used in combination.

[0105] 3. Video decoding technology

[0106] Video decoding technology is a component of video encoding and decoding technology. Corresponding to video encoding technology, video decoding involves the process of restoring compressed video data into the original, playable video signal. Specifically, video encoding technology uses specific compression algorithms to compress the original video data into smaller files for easier storage and transmission; video decoding technology is the reverse operation, decompressing the compressed video data back into the original video signal for playback on display devices. This technology is of great significance to various industries such as IPTV, digital cinemas, distance education, and video conferencing, as it can significantly reduce the bandwidth and storage space required for storage and transmission while maintaining video quality.

[0107] Video decoding technologies can be classified according to different standards, mainly including the following:

[0108] Compression methods can be categorized into lossless decoding and lossy decoding.

[0109] Lossless decoding: Lossless decoding can completely recover the original video data without any information loss. This decoding method is suitable for situations with extremely high video quality requirements, such as disk file compression.

[0110] Lossy decoding: Lossy decoding loses some of the original data during decompression, but this loss usually does not significantly affect the viewing experience. Lossy decoding is widely used in video conferencing, video broadcasting, video surveillance, and other fields because it can significantly reduce bitrate and storage requirements while maintaining video quality.

[0111] 4. In-loop filter

[0112] Loop filters mainly include bilateral filters, luminance mapping and chrominance scaling, deblocking filters, sample offset compensation, adaptive loop filters (ALF), and CCALF. Among them, CCALF is a filter designed to minimize the mean square error between the chrominance reconstructed image and the original image by utilizing luminance information.

[0113] CCALF can process the chroma U and chroma V components separately, with each component having its own filter. Each component can use up to 16 filters, corresponding to 16 categories. CCALF classifies each CTU, with all pixels in the CTU belonging to the same category. The covariance matrix and error vector of pixels in the same category are accumulated separately, and then the Wiener-Hopp equation is constructed. The filter coefficients for that category are calculated by solving the equation. Each CTU selects the filter corresponding to its category for filtering, and the filtered result is written into the reconstructed image. In addition, the filter coefficients need to be written into the APS, and the corresponding syntax elements are written into the bitstream through entropy coding.

[0114] Figure 1 shows the shape of the CCALF filter. In the left 9x9, 'x' represents the position of the luminance pixel corresponding to the chrominance pixel to be filtered, and the numbers represent adjacent luminance pixels. The middle 3x3 also contains the position information of adjacent luminance pixels, but the difference is that the left 9x9 inputs the reconstructed information of the luminance pixels, while the middle 3x3 inputs the residual information of the luminance pixels. In the right 3x3, 'x' represents the position of the chrominance pixel to be filtered, and the numbers represent adjacent chrominance pixels. It can be seen that the filter requires 31 input values, corresponding to 31 filter coefficients based on their positions in the filter. 0, 1, 2, ..., 29, 30 represent the filter coefficient indices. It should be noted that the coefficient at position 'x' is generally not calculated and defaults to 0.

[0115] CCALF can classify CTUs using a Rate Distortion Optimization (RDO) function. Each pixel in a CTU belongs to the same category. Specifically, when the cost calculated by using a filter of a certain category for a CTU is minimized, then the CTU's category is the category of that filter. Conversely, if the cost of not filtering is less than the cost of using a filter, then the CTU is not filtered. In this case, the CTU has no category. Whether a CTU is filtered and its corresponding category information are written into the bitstream and transmitted to the decoder.

[0116] After determining the category of each CTU, the covariance matrix and error vector of all pixels in the same category are summed. Specifically, for each pixel, its covariance matrix A is a 31x31 square matrix. Let each element of matrix A be a. i,j Where i,j∈[0,1,2,…,29,30], for a i,j Its value is: a i,j =R(i)*R(j)

[0117] The value of R(i) is:

[0118] Where recY(*) represents the reconstructed value of the luminance pixel output by the previous module, and resiY(*) is the residual value of the corresponding luminance pixel. saoC(i) represents the reconstructed value of the chrominance pixel output by Sample Adaptive Offset (SAO), where x corresponds to the position x in the filter shape, and i is the pixel at a position other than x.

[0119] The error vector B is a 31x1 vector. Let each element of vector B be b. i Where i∈[0,1,2,…,29,30], for b i Its value is: b i =R(i)*E

[0120] For the possible values ​​of R(i), please refer to the description above.

[0121] For E, we have: E = orgC - recC

[0122] Where recC is the reconstructed pixel value of the pixel to be filtered, and orgC represents the original pixel value of the pixel to be filtered.

[0123] After obtaining the covariance matrix A and error vector B for each pixel, the covariance matrix and error vector of pixels of the same class in a frame of image are summed separately. The Wiener-Hope equation Ac = B is constructed, where A is the sum of the covariance matrices of pixels of the same class, and B is the sum of the error vectors of pixels of the same class. The coefficient c for this class needs to be solved, where c is a 31x1 vector.

[0124] It should be noted that the filter coefficients obtained from the equations are all floating-point numbers. Since the range of floating-point numbers is almost unlimited, a lot of bits are needed to encode the coefficients. To solve this problem, the encoder converts the filter coefficients to integers. First, the filter coefficients are scaled: c′ i =scale*c i

[0125] Among them, c i c′ represents the filter coefficients for solving the Wiener-Hoppt equation, where scale is an adaptive scaling factor that can be adaptively selected from {7, 8, 9, 10}. i This is the scaled value. After obtaining c′... i Then, for c′ i By performing a table lookup and comparison, select the value matching c′ from {-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64}. i The closest number is used as the coefficient c″ after integerization. i .

[0126] After obtaining the integerized filter coefficients c″, the next step is to filter the pixels. The filtering process is as follows:

[0127] Where recC′ represents the filtered coefficients. i The meanings of values ​​such as recY(i), recY(x), resiY(i), and scale have been explained in the text and will not be repeated here. After filtering the pixels that need filtering, they are written into the reconstructed image. For pixels that do not need filtering, they are directly written into the reconstructed image.

[0128] In addition, relevant syntax elements need to be written into the bitstream. For example, the CCALF switch for the current frame image, whether each CTU is filtered, and its corresponding category information. If a new filter is needed, the number of filters and the coefficients of each filter need to be written into the APS. Finally, the APS ID used for that frame image is written into the slice header or picture header information.

[0129] Upon receiving the bitstream, the decoder determines the CCALF switch for the current frame, whether each CTU is filtered, and its corresponding category information. Furthermore, it parses the APS ID and selects the appropriate APS to determine the filter coefficients. Pixels requiring filtering are then filtered and written into the reconstructed image. Pixels not requiring filtering are directly written into the reconstructed image.

[0130] The system architecture used in the embodiments of this application is described below.

[0131] Typically, in the video data encoding process, taking a single video frame (i.e., a video image frame) as an example, the video encoding device uses a Coding Unit (CU) (corresponding to a coding block) as the encoding unit. Following certain encoding rules, it encodes all the CUs included in a Coding Unit (CTU) (including prediction, transform, quantization, and entropy coding, etc.), thus completing the encoding of multiple CTUs within an image and obtaining the corresponding encoded information. Correspondingly, in the video data decoding process, the decoding device, following the decoding rules corresponding to the encoding process, reconstructs the multiple CUs within a CTU (including prediction, inverse quantization, inverse transform, etc.), thus completing the reconstruction of multiple CTUs within an image and obtaining the reconstructed image.

[0132] Both CTU and CU are nodes on the coding tree. CTU is the root node. After partitioning, CTU is divided into a certain number of nodes. Further, some or all of the nodes obtained from the initial partitioning of CTU can be further divided into smaller nodes, and so on, until all nodes no longer need partitioning. The nodes that no longer need partitioning are called leaf nodes, i.e., leaf nodes are the nodes at the end of the coding tree that do not need further partitioning. In VVC, one leaf node corresponds to one CU.

[0133] It should be noted that, in the process of encoding or decoding the CU, it is also possible to consider dividing the CU into multiple regions, and performing transformation or inverse transformation on each region respectively, so as to obtain the transformation result or inverse transformation result of the CU based on the transformation result or inverse transformation result of multiple regions.

[0134] In the field of video data encoding and decoding, methods for partitioning a single CU (Computer-Aided Array) into multiple regions include quadtree partitioning, binary tree partitioning, and ternary tree partitioning. When partitioning a CU, any one or more of these methods can be selected. For example, in one implementation, a cascaded quadtree and binary tree partitioning method can be used. First, a CU is partitioned using a quadtree to obtain four regions. If one or more of these four regions can be further subdivided, a binary tree partitioning method is used to divide the regions requiring further subdivision into smaller regions. The specific partitioning method can be determined according to actual usage requirements, and this application does not impose specific limitations.

[0135] Figure 2 illustrates the simplified process of video data encoding and decoding, using an image block (which can be a CU) from a video frame as an example. During encoding, this image block is referred to as the block to be encoded; during decoding, it is referred to as the block to be decoded. The encoding process for this block includes prediction, transform, quantization, and entropy coding. After obtaining the prediction block of the current encoding block, the video encoding device obtains a residual block (the difference between the original block and the prediction block) based on the prediction block. Then, the encoding device transforms the residual block according to the transform pair (which includes a horizontal transform kernel and a vertical transform kernel), quantizes the transformed residual block, and finally completes entropy coding (i.e., encoding parameters such as syntax elements) to form a bitstream, thus completing the encoding of the block to be encoded. In the aforementioned encoding process, the transform kernel can be various types of transform kernels based on Discrete Cosine Transform (DCT) (e.g., DCT-II, DCT-VIII), or various types of transform kernels based on Discrete Sine Transform (DST) (e.g., DST-VII). Furthermore, the video encoding process also includes encoding syntax elements (e.g., partitioning flags, partitioning patterns). These encoded syntax elements and the encoded image blocks constitute the encoded information (i.e., the bitstream). In other words, the encoded information of the video data includes both the encoded image data and the encoded syntax elements. The video decoding device's decoding process for the block to be decoded includes entropy decoding, prediction, inverse transform, and inverse quantization. The video decoding process can be understood as the inverse of the video encoding process. The video decoding device reconstructs the image block (i.e., the block to be decoded) based on the syntax elements extracted from the encoded information. That is, the video decoding device obtains the reconstructed image block based on the syntax elements associated with the image block and the encoded image block, thus completing the decoding of the block to be decoded.

[0136] Figure 3 shows a schematic diagram of the architecture of the encoding / decoding system 10 used in the embodiments of this application. As shown in Figure 3, the encoding / decoding system 10 may include a source device 11 and a destination device 12. The source device 11 is used to encode images; therefore, the source device 11 may be referred to as an image encoding apparatus (device) or a video encoding apparatus (device). The destination device 12 is used to decode the encoded image data generated by the source device 11; therefore, the destination device 12 may be referred to as an image decoding apparatus (device) or a video decoding apparatus (device).

[0137] The source device 11 and the destination device 12 can take various forms, and this application embodiment does not specifically limit them. For example, the source device 11 and the destination device 12 can be a desktop computer, a mobile computing device, a laptop (e.g., a laptop computer), a tablet computer, a set-top box, a handset such as a so-called "smartphone", a television, a camera, a display device, a digital media player, a video game console, a vehicle computer, or other similar devices.

[0138] Optionally, the source device 11 and the destination device 12 shown in FIG3 can be two separate devices. Alternatively, the source device 11 and the destination device 12 can also be a single device, that is, the source device 11 or its corresponding functions and the destination device 12 or its corresponding functions can be integrated into the same device.

[0139] Optionally, the source device 11 and the destination device 12 can communicate with each other. For example, the destination device 12 can receive encoded image data from the source device 11. In one example, the source device 11 and the destination device 12 may include one or more communication devices that can be used to transmit the encoded image data from the source device 11 to the destination device 12. The one or more communication devices may include routers, switches, base stations, or any other possible devices that facilitate communication from the source device 11 to the destination device 12, which can be determined according to actual usage requirements, and this application embodiment does not limit this.

[0140] As shown in Figure 3, the source device 11 may include an encoder 112. Optionally, the source device 11 may also include an image preprocessor 111 and a communication interface 113. The image preprocessor 111 can be used to perform preprocessing on the received image to be encoded. For example, the preprocessing performed by the image preprocessor 111 may include any possible processing such as trimming, color format conversion (e.g., from RGB to YUV format), color adjustment, or noise reduction. The encoder 112 can be used to receive the image preprocessed by the image preprocessor 111, process the preprocessed image using a correlation prediction mode, and output encoded image data. In some embodiments, the encoder 112 can be used to perform the encoding process described in the various embodiments below. The communication interface 113 can be used to transmit the encoded image data output by the encoder 112 to the destination device 12 or any other device (such as a storage device) for storage or direct reconstruction. Other devices can be any devices used for decoding or storage. Of course, in actual implementation, the communication interface 113 can also encapsulate the encoded image data output by the encoder 112 into a suitable format before transmission.

[0141] Optionally, the image preprocessor 111, encoder 112, and communication interface 113 may be hardware components in the source device 11, software programs in the source device 11, or a combination of hardware components and software programs in the source device 11. The specific details can be determined according to actual usage requirements, and this application embodiment does not limit this.

[0142] The destination device 12 may include a decoder 122. Optionally, the destination device 12 may also include a communication interface 121 and an image post-processor 123. The communication interface 121 may be used to receive encoded image data from the source device 11 or any other source device, such as a storage device. The communication interface 121 may also decapsulate the data transmitted by the communication interface 113 to obtain encoded image data. The decoder 122 is used to receive the encoded image data and output decoded image data (also called reconstructed image data or reconstructed image data). In some embodiments, the decoder 122 may be used to perform the decoding process described in the various embodiments below. The image post-processor 123 may be used to perform post-processing on the decoded image data to obtain post-processed image data. The post-processing performed by the image post-processor 123 may include color format conversion (e.g., from YUV format to RGB format), color correction, retouching, or resampling, and any possible processing. The image post-processor 123 may also be used to transmit the post-processed image data to a display device for display.

[0143] Optionally, the aforementioned communication interface 121, decoder 122, and image post-processor 123 may be hardware components in the target device 12, software programs in the target device 12, or a combination of hardware components and software programs in the target device 12. The specific details can be determined according to actual usage requirements, and this application embodiment does not limit this.

[0144] To gain a clearer understanding of the encoder 112 and decoder 122 described above, the structure of the encoder 112 and decoder 122 will be briefly introduced below.

[0145] Figure 4A shows a possible structural schematic block diagram of the encoder 112 used in an embodiment of this application.

[0146] As shown in Figure 4A, the encoder 112 may include an intra-frame prediction unit 301, a residual calculation unit 302, a transform / quantization unit 303, an entropy coding unit 304, an inverse quantization / inverse transform unit 305, a reconstruction unit 306, a loop filtering unit 307, a decoded image buffer 308, and a motion estimation / compensation unit 309.

[0147] The intra-frame prediction unit 301 predicts the current block to generate a prediction block. The residual calculation unit 202 calculates the difference between the original image block and the prediction block generated by the intra-frame prediction unit to obtain a residual block. The transform / quantization unit 303 performs transform coding on the residual block and quantizes the transform coefficients, mapping continuous transform coefficients to a finite number of discrete values. The entropy coding unit 304 further encodes the quantized data, such as using entropy coding (e.g., Huffman coding, arithmetic coding, or CABAC) to reduce redundant information in the data. The encoded data (bitstream) is then sent to the decoder or storage medium. The inverse quantization / inverse transform unit 305 inversely quantizes the quantized data to recover the transform coefficients and performs an inverse transform on these transform coefficients to recover the residual block. The reconstruction unit 306 adds the prediction block generated by the intra-frame prediction unit to the residual block recovered by the inverse residual transform unit to reconstruct the original image block. The loop filtering unit 307 is used to filter the reconstructed image blocks to improve image quality and reduce visual artifacts such as block artifacts. The decoding image buffer 308 is used to buffer the filtered image blocks output by the loop filtering unit 307. The motion estimation / compensation unit 309 is used to acquire the filtered image blocks and use them as reference blocks for subsequent motion estimation or motion compensation.

[0148] In one example, the input to encoder 112 is an image block (i.e., a block or encoding unit) of the image to be encoded. In another example, the input to encoder 112 is the image to be encoded, and encoder 112 may include a segmentation unit (not shown in FIG. 4A) that can be used to segment the image to be encoded into multiple image blocks. For example, the segmentation unit can divide the image to be encoded into one or more square CTUs of the same size. The segmentation unit can divide the image to be encoded into tiles, and optionally, the segmentation unit can further divide a tile into one or more bricks, wherein a tile or brick may contain one or more complete and / or partial CTUs. In addition, the segmentation unit can form one or more slices, one of which may contain one or more tiles arranged in raster order in the image, or contain one or more tiles covering a rectangular area in the image. The segmentation unit can also form one or more sub-images, one of which contains one or more slices, tiles, or bricks. Encoder 112 can complete the encoding of the image to be encoded by encoding multiple image blocks one by one. For example, encoder 112 can perform the encoding process for each image block separately, thereby completing the encoding of the image to be encoded.

[0149] Regarding the encoder architecture shown in Figure 4A, the loop filtering unit 307 may include a bilateral filter, luminance mapping and chrominance scaling, deblocking filter, sample offset compensation, adaptive loop filter (ALF), and CCALF, etc.

[0150] In this embodiment, the loop filter unit 307 described above can be used to implement the encoding method described in the following embodiments. This embodiment uses CCALF as an example for illustration.

[0151] The encoding method of this application embodiment will now be described in conjunction with the various units in encoder 112.

[0152] In one example, the encoding method of this application embodiment may include the following steps:

[0153] Step 11: The loop filtering unit 307 calculates the covariance matrix of the chromaticity U component (Cb component) and chromaticity V component (Cr component) of each pixel in the current block, as well as the error vector of the chromaticity U component and chromaticity V component.

[0154] Optionally, in the embodiments of this application, the aforementioned current block can be a CTU, a tile, a brick, a CU, an image frame, or other possible forms of coded blocks, etc., and the embodiments of this application are not limited thereto. The following uses a CTU as an example for illustration.

[0155] Step 12: The loop filtering unit 307 accumulates the covariance matrix of pixels of the same category and accumulates the error vector of pixels of the same category.

[0156] In this embodiment of the application, step 12 can be specifically implemented through the following steps 12a to 12c:

[0157] Step 12a: The loop filter unit 307 can calculate the sum of the covariance matrices of the chromaticity U components of the same type of CTU in the current block, and calculate the sum of the error vectors of the chromaticity U components of the same type of CTU in the current block.

[0158] Step 12b: The loop filter unit 307 can calculate the sum of the covariance matrices of the chromaticity V components of CTUs of the same category in the current block, and calculate the sum of the error vectors of the chromaticity V components of CTUs of the same category in the current block.

[0159] Step 12c: The loop filter unit 307 can calculate the sum of the covariance matrices of the chromaticity U component and the chromaticity V component of the same type of CTU in the current block, and calculate the sum of the error vectors of the chromaticity U component and the chromaticity V component of the same type of CTU in the current block.

[0160] Step 13: The loop filtering unit 307 constructs the Wiener-Hopp equation based on the sum of the covariance matrices of pixels of the same category and the sum of the error vectors of pixels of the same category, and calculates the set of filtering coefficients for the chromaticity U component and chromaticity V component of pixels of the same category.

[0161] It should be noted that the chromaticity components (chromaticity U component or chromaticity V component) of pixels of the same category correspond to the same category of filters, that is, the chromaticity components of pixels of the same category correspond to the same set of filter coefficients. For ease of description and understanding, the embodiments of this application use any category of pixels in the current block (e.g., a category of CTUs) as an example to illustrate the calculation process of the filter coefficient set. The calculation process of the filter coefficient set for other categories of CTUs is similar and will not be described in detail in the embodiments of this application.

[0162] In this embodiment of the application, step 13 can be specifically implemented through the following steps 13a to 13c:

[0163] Step 13a: The loop filter unit 307 constructs the Wiener-Hoppe equation based on the sum of the covariance matrices of the chromaticity U components and the sum of the error vectors of the chromaticity U components, and calculates the set of filter coefficients C of the chromaticity U components. u .

[0164] In this embodiment, the Wiener-Hopp equation Ac=B described in the above embodiments can be used to obtain that the Wiener-Hopp equation constructed in step 13a can be expressed as A. u C u =B u A u B is the sum of the covariance matrices of the chromaticity U components of a class of CTUs. u The sum of the error vectors of the chromaticity U components of a CTU of a certain class can be used to solve for the set of filter coefficients C of that class. u C u It can be a 31x1 vector.

[0165] Step 13b: The loop filter unit 307 constructs the Wiener-Hoppe equation based on the sum of the covariance matrices of the chromaticity V components and the sum of the error vectors of the chromaticity V components, and calculates the set of filter coefficients C of the chromaticity V components. v .

[0166] In this embodiment, the Wiener-Hopp equation Ac=B described in the above embodiments can be used to obtain that the Wiener-Hopp equation constructed in step 13b can be expressed as A. v C v =B v A v B is the sum of the covariance matrices of the chromaticity V components of a class of CTUs. vThe sum of the error vectors of the chromaticity V components of a CTU of a certain class can be used to solve for the set of filter coefficients C of that class. v C v It can be a 31x1 vector.

[0167] Step 13c: The loop filter unit 307 constructs the Wiener-Hopp equation based on the sum of the covariance matrices of the chromaticity U component and the chromaticity V component, and the sum of the error vectors of the chromaticity U component and the chromaticity V component, and calculates the set of filter coefficients C for the chromaticity U component and the chromaticity V component. uv .

[0168] In this embodiment, the Wiener-Hopp equation Ac=B described in the above embodiments can be used to obtain that the Wiener-Hopp equation constructed in step 13c can be expressed as A. uv C uv =B uv A uv B is the sum of the covariance matrices of the chromaticity U and V components of a class of CTUs. uv Given the sum of the error vectors of the chromaticity U and V components of a CTU of a certain class, the set of filter coefficients C for that class can be solved. uv C uv It can be a 31x1 vector.

[0169] Step 14: Loop filter unit 307 is based on the filter coefficient set C u Filter coefficient set C v Filter coefficient set C uv Determine the first set of filter coefficients.

[0170] In this embodiment of the application, the first set of filtering coefficients is the set of filtering coefficients for the chroma U component and the chroma V component of the current block, that is, a set of filtering coefficients shared by the chroma U component and the chroma V component.

[0171] It should be noted that, regarding the above-mentioned filter coefficient set C... u Filter coefficient set C v Filter coefficient set C uv The specific method for determining the first set of filter coefficients can be found in the description of the following embodiments, and will not be repeated here.

[0172] Step 15: The loop filtering unit 307 performs in-loop filtering on the reconstruction block of the chromaticity U component based on the first set of filtering coefficients, and performs in-loop filtering on the reconstruction block of the chromaticity V component based on the first set of filtering coefficients.

[0173] Step 16: The entropy coding unit 304 writes the first set of filter coefficients into the bit stream.

[0174] It should be noted that the specific method for writing the first set of filter coefficients into the bitstream can be found in the description in the following embodiments, and will not be repeated here.

[0175] Figure 4B shows a possible schematic block diagram of the decoder 122 used in an embodiment of this application. The decoder 122 can be used to receive, for example, image data encoded by the encoder 112 (i.e., an encoded bitstream, for example, an encoded bitstream including image blocks and associated syntax elements) to obtain decoded image blocks.

[0176] As shown in Figure 4B, the decoder 122 may include a bitstream parsing unit 401, an inverse quantization unit 402, a residual inverse transform unit 404, a prediction processing unit 404, a reconstruction unit 405, and a filter unit 406. In some instances, the decoder 122 may perform a decoding process that is substantially the inverse of the encoding process described in the encoder 112 above. Optionally, the decoder 122 may also include a buffer and a filtered image buffer. The buffer can be used to buffer the reconstructed image blocks output by the reconstruction unit 405, and the filtered image buffer can be used to buffer the filtered image blocks output by the filter unit 406.

[0177] The bitstream parsing unit 401 can be used to decode the encoded bitstream to obtain quantized residual coefficients (or quantized residual values) and / or decoding parameters (e.g., decoding parameters may include any one or more of inter-frame prediction parameters, intra-frame prediction parameters, filter parameters, and / or other syntax elements performed on the encoding side). The bitstream parsing unit 401 can also be used to forward the above-mentioned decoding parameters to the prediction processing unit 304, so that the prediction processing unit 304 can perform a prediction process based on the decoding parameters.

[0178] The function of the dequantization unit 402 is the same as that of the dequantization unit 206 of the encoder 112, used to dequantize (i.e., reverse quantization) the quantized residual coefficients output by the code stream parsing unit 401.

[0179] The function of the residual inverse transform unit 403 is the same as that of the residual inverse transform unit 207 of the encoder 112, which is used to perform an inverse transform on the above-mentioned inverse quantized residual coefficients (e.g., inverse DCT, inverse integer transform, or a conceptually similar inverse transform process) to obtain the reconstructed residual value. The block obtained after the inverse transform is the residual block of the reconstructed block to be decoded in the pixel domain.

[0180] The function of the reconstruction unit 405 (e.g., a summer) can be the same as that of the reconstruction unit 208 of the encoder 112.

[0181] The prediction processing unit 404 is used to receive or acquire encoded image data (e.g., the encoded bitstream of the current image block) and reconstructed image data. The prediction processing unit 404 can also receive or acquire relevant parameters of the prediction mode and / or information about the selected prediction mode (i.e., the decoding parameters mentioned above) from, for example, the bitstream parsing unit 302, and make a prediction of the current image block based on the relevant data and decoding parameters in the reconstructed image data to obtain the prediction block of the current image block.

[0182] The reconstruction unit 405 can be used to add the reconstructed residual block to the prediction block to obtain the reconstructed block of the image to be decoded in the sample domain, for example, by adding the residual value in the reconstructed residual block to the predicted value in the prediction block.

[0183] The filter unit 406 can be used to filter the reconstructed block to obtain a filtered block, which is the decoded image block.

[0184] It is understood that in the encoder 112 and decoder 122 provided in the embodiments of this application, the processing result of a certain stage may be further processed before being output to the next stage. For example, after the prediction, transformation or filtering stages, the processing result of the corresponding stage may be further processed by Clip or shift operations.

[0185] In one example, the decoding method of this application embodiment may include the following steps:

[0186] Step 21: The bitstream parsing unit 401 parses the bitstream to obtain the first set of filter coefficients.

[0187] In this embodiment of the application, the first set of filtering coefficients is the set of filtering coefficients for the chroma U component and the chroma V component of the current block, that is, a set of filtering coefficients shared by the chroma U component and the chroma V component.

[0188] Step 22: Filter unit 406 performs intra-loop filtering on the reconstruction block of the chromaticity U component based on the first set of filtering coefficients, and performs intra-loop filtering on the reconstruction block of the chromaticity V component based on the first set of filtering coefficients.

[0189] It should be noted that the specific method for obtaining the first set of filter coefficients for the above-mentioned parsed bitstream can be found in the description in the following embodiments, and will not be repeated here.

[0190] The encoding / decoding framework and basic process have been described above with reference to the accompanying drawings. This framework or process is for illustrative purposes only and is not intended to limit the scope of this application. For example, as technology advances, some modules or steps of this framework or process may be optimized. In specific implementations, the technical solutions provided in the embodiments of this application can be flexibly applied according to actual needs.

[0191] The encoding and decoding methods provided in the embodiments of this application will be described exemplarily below with reference to the accompanying drawings.

[0192] It should be noted that the encoding end in any embodiment of this application can be the encoder 112 in FIG4A above, or the source device 11 in FIG3 above. The decoding end in any embodiment of this application can be the decoder 122 in FIG4B above, or the destination device 12 in FIG3 above; the embodiments of this application do not limit this.

[0193] Figure 5 shows a flowchart of an encoding method provided in an embodiment of this application. The encoding method may include the following steps 31 to 33:

[0194] Step 31: The encoding end determines the first set of filter coefficients.

[0195] In this embodiment of the application, the aforementioned first set of filter coefficients can be understood as: a set of filter coefficients shared by the first chromaticity component and the second chromaticity component of the current block, that is, a set of filter coefficients that the first chromaticity component and the second chromaticity component can use together.

[0196] As described in the above embodiments, the current block can be a CTU, a tile, a brick, a CU, or an image frame, etc. The chroma components of pixels of the same category (e.g., CTUs of the same category) in the current block use the same category filter; that is, the chroma components of pixels of the same category correspond to the same set of filter coefficients. Therefore, the filters used for the first and second chroma components of the current block can include at least one category filter. Each category filter is the filter used for the first and second chroma components of all pixels of each category (e.g., CTUs of the same category) in the current block.

[0197] In this embodiment of the application, the first chromaticity component can be the chromaticity U component (Cb component), and the second chromaticity component can be the chromaticity V component (Cr component).

[0198] Optionally, in this embodiment, the encoding end can determine the first set of filtering coefficients based on the covariance matrix and error vector of the chrominance components of the current block. The following illustrates the calculation process of the filtering coefficient set using the covariance matrix and error vector of the chrominance components of all pixels of a class in the current block as an example.

[0199] For example, referring to Figure 5 and as shown in Figure 6, step 31 above can be specifically implemented through steps 31a to 31c as follows:

[0200] Step 31a: The encoding end determines the first covariance matrix based on the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component.

[0201] In this embodiment, the covariance matrix of the first chromaticity component refers to the sum of the covariance matrices of the chromaticity U components of all pixels in a category. The covariance matrix of the second chromaticity component refers to the sum of the covariance matrices of the chromaticity V components of all pixels in a category. The encoding end can sum the covariance matrices of the first and second chromaticity components to obtain the first covariance matrix.

[0202] It should be noted that the calculation methods for the covariance matrix of a pixel and the sum of the covariance matrices can be found in the description in the above embodiments, and will not be repeated here.

[0203] Optionally, in the embodiments of this application, the above summation operation can be an addition operation or a weighted summation operation, etc., and the embodiments of this application are not limited thereto.

[0204] Optionally, in the embodiments of this application, the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component can be summed in units of CTU, or the covariance matrices of the first chromaticity component and the second chromaticity component can be adaptively combined for summation. The embodiments of this application do not impose any restrictions.

[0205] Step 31b: The encoding end determines the first error vector based on the error vector of the first chromaticity component and the error vector of the second chromaticity component.

[0206] In this embodiment, the error vector of the first chromaticity component refers to the sum of the error vectors of the chromaticity U components of all pixels in a category. The error vector of the second chromaticity component refers to the sum of the error vectors of the chromaticity V components of all pixels in a category. The encoding end can sum the error vectors of the first chromaticity component and the error vectors of the second chromaticity component to obtain the first error vector.

[0207] It should be noted that the calculation method for the error vector of a pixel and the sum of the error vectors can be found in the description in the above embodiments, and will not be repeated here.

[0208] Optionally, in the embodiments of this application, the error vectors of the first chromaticity component and the second chromaticity component can be summed in units of CTU, or the error vectors of the first chromaticity component and the second chromaticity component can be adaptively combined for summation. The embodiments of this application do not impose any restrictions.

[0209] Step 31c: The encoder determines the first set of filter coefficients based on the first covariance matrix and the first error vector.

[0210] In this embodiment, the encoder can construct the Wiener-Hoppt equation based on the first covariance matrix and the first error vector, and solve for the set of filter coefficients C for the chromaticity U component and the chromaticity V component. uv Then, based on the set of filter coefficients C of the chromaticity U component. u The set of filter coefficients C for the chromaticity V component v And the C uv The decision is made through RDO (i.e., the rate distortion cost is calculated) to determine the first set of filter coefficients mentioned above.

[0211] Optionally, in this embodiment of the application, step 31c can be implemented by the following steps 31c1 to 31c3:

[0212] Step 31c1: The encoder determines the second set of filter coefficients based on the first covariance matrix and the first error vector.

[0213] In this embodiment, the second set of filter coefficients is the set of filter coefficients C described in the above embodiment. uv .

[0214] In this embodiment, the encoder can construct the Wiener-Hoppt equation based on the first covariance matrix and the first error vector, and solve for the set of filter coefficients C. uv The Wiener-Hopp equation here can be the A equation described in the above embodiment. uv C uv =B uv A uv Let B be the first covariance matrix mentioned above. uv Let C be the first error vector mentioned above. uv It can be a 31x1 vector.

[0215] Step 31c2: The encoder calculates the first total rate distortion cost, the second total rate distortion cost, and the third total rate distortion cost.

[0216] In this embodiment of the application, the first total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the third set of filter coefficients, and the third set of filter coefficients is the set of filter coefficients for the first chromaticity component.

[0217] Optionally, in this embodiment of the application, before step 31c2 above, the encoding method provided in this embodiment of the application may further include the following steps 31c4 and 31c5:

[0218] Step 31c4: The encoding end calculates the first rate distortion cost, the second rate distortion cost, and the third rate distortion cost.

[0219] In this embodiment, the first rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients for the first chromaticity component. The second rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients for the second chromaticity component. The third rate-distortion cost is the rate-distortion cost of the first chromaticity component under the second set of filter coefficients.

[0220] In this embodiment, the initial filter coefficient set for the first chromaticity component is the filter coefficient set C described in the above embodiment. u .

[0221] In this embodiment, the encoding end can construct the Wiener-Hopp equation based on the sum of the covariance matrices of the first chromaticity components and the sum of the error vectors of the first chromaticity components, and solve for the set of filter coefficients C. u The Wiener-Hopp equation here can be the A equation described in the above embodiment. u C u =B u A u B is the sum of the covariance matrices of the first chromaticity component. u C is the sum of the error vectors of the first chromaticity component. u It can be a 31x1 vector.

[0222] In this embodiment, the initial filter coefficient set for the second chromaticity component is the filter coefficient set C described in the above embodiment. v .

[0223] In this embodiment, the encoder can construct the Wiener-Hopp equation based on the sum of the covariance matrices of the second chromaticity components and the sum of the error vectors of the second chromaticity components, and solve for the set of filter coefficients C. v The Wiener-Hopp equation here can be the A equation described in the above embodiment. v C v =B v A v B is the sum of the covariance matrices of the second chromaticity components. v C is the sum of the error vectors of the second chromaticity components. v It can be a 31x1 vector.

[0224] It should be noted that the calculation method for rate distortion cost can be found in the description in related technologies, and will not be repeated in the embodiments of this application.

[0225] Step 31c5: The encoder determines the third set of filter coefficients based on the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost.

[0226] In this embodiment of the application, the encoding end can determine the set of filter coefficients corresponding to the minimum value among the first rate distortion cost, the second rate distortion cost, and the third rate distortion cost (this minimum value can be denoted as cost1) as the above-mentioned third set of filter coefficients, that is, the new set of filter coefficients for the first chromaticity component.

[0227] For example, if the first rate distortion cost is the minimum cost1, then the initial set of filter coefficients C corresponding to the first rate distortion cost is... u This serves as the third set of filter coefficients mentioned above. If the second rate-distortion cost is the minimum value cost1, then the initial set of filter coefficients C corresponding to this second rate-distortion cost is... v This serves as the third set of filter coefficients mentioned above. If the third rate-distortion cost is the minimum value cost1, then the second set of filter coefficients C corresponding to this third rate-distortion cost is... uv This serves as the third set of filter coefficients mentioned above.

[0228] In this embodiment of the application, the aforementioned second total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the fourth set of filter coefficients, where the fourth set of filter coefficients is the set of filter coefficients for the second chromaticity component.

[0229] Optionally, in this embodiment of the application, before step 31c2 above, the encoding method provided in this embodiment of the application may further include the following steps 31c6 and 31c7:

[0230] Step 31c6: The encoding end calculates the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost.

[0231] In this embodiment, the fourth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the initial filter coefficient set of the first chromaticity component. The fifth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the initial filter coefficient set of the second chromaticity component. The sixth rate-distortion cost is the rate-distortion cost of the second chromaticity component under the second filter coefficient set.

[0232] Step 31c7: The encoder determines the fourth set of filter coefficients based on the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost.

[0233] In this embodiment of the application, the encoding end can determine the set of filter coefficients corresponding to the minimum value among the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost (this minimum value can be denoted as cost6) as the above-mentioned fourth filter coefficient set, that is, the new filter coefficient set of the second chromaticity component.

[0234] For example, if the fourth rate distortion cost is the minimum cost6, then the initial set of filter coefficients C corresponding to the fourth rate distortion cost is... u This serves as the fourth set of filter coefficients mentioned above. If the fifth rate-distortion cost is the minimum value cost6, then the initial set of filter coefficients C corresponding to this fifth rate-distortion cost is... v This serves as the fourth set of filter coefficients mentioned above. If the sixth rate distortion cost is the minimum value cost6, then the second set of filter coefficients C corresponding to the sixth rate distortion cost is used. uv This serves as the set of the fourth filter coefficients mentioned above.

[0235] In this embodiment of the application, the aforementioned third total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the second set of filter coefficients.

[0236] Step 31c3: The encoder determines the first set of filter coefficients based on the first total rate distortion cost, the second total rate distortion cost, and the third total rate distortion cost.

[0237] In this embodiment of the application, the encoding end can determine the set of filter coefficients corresponding to the minimum value (which can be denoted as cost11) among the first total distortion cost, the second total distortion cost and the third total distortion cost as the first set of filter coefficients.

[0238] For example, if the first total distortion cost is the minimum cost11, then the third set of filter coefficients corresponding to the first total distortion cost is taken as the first set of filter coefficients.

[0239] If the second total distortion cost is the minimum cost11, then the fourth set of filter coefficients corresponding to the second total distortion cost is taken as the first set of filter coefficients.

[0240] If the aforementioned third total distortion cost is the minimum cost11, then the second set of filter coefficients C corresponding to the third total distortion cost is... uv This serves as the first set of filter coefficients mentioned above.

[0241] Optionally, in this embodiment, the encoder can determine whether the first chroma component and the second chroma component share a set of filter coefficients based on the aforementioned rate-distortion cost. For example, after step 31c2, the encoding method provided in this embodiment may further include the following step 31c8:

[0242] Step 31c8: If the cost of the seventh rate distortion is less than the sum of the costs of the eighth and ninth rate distortions, the encoder determines to use the same set of filter coefficients to filter the first and second chroma components within the loop.

[0243] In the embodiment of the present application, the above-mentioned seventh rate-distortion cost is the minimum value among the above-mentioned first total rate-distortion cost, second total rate-distortion cost, and third total rate-distortion cost (i.e., the above-mentioned cost11).

[0244] In the embodiment of the present application, the above-mentioned eighth rate-distortion cost is the minimum value among the rate-distortion cost when the above-mentioned first chrominance component is not filtered and the tenth rate-distortion cost (this minimum value can be denoted as cost5), and the tenth rate-distortion cost is the minimum value among the rate-distortion cost of the above-mentioned first chrominance component under the filter coefficient set of the reconstructed block and the rate-distortion cost of the first chrominance component under the third filter coefficient set (this minimum value can be denoted as cost3).

[0245] Example 1. Assume that the rate-distortion cost when the above-mentioned first chrominance component is not filtered is denoted as cost4, the rate-distortion cost of the above-mentioned first chrominance component under the filter coefficient set of the reconstructed block is denoted as cost2, and the rate-distortion cost of the above-mentioned first chrominance component under the third filter coefficient set is denoted as cost1. Then:

[0246] If cost1 < cost2, the first chrominance component of the current block is filtered using the CCALF new filter coefficient set (i.e., the third filter coefficient set); otherwise, the first chrominance component is filtered using the filter coefficient set of the reconstructed block. Among them, the minimum value of cost1 and cost2 is cost3.

[0247] If cost3 < cost4, the first chrominance component of the current block is filtered using CCALF; otherwise, the first chrominance component is not filtered using CCALF. Among them, the minimum value of cost3 and cost4 is cost5.

[0248] In the embodiment of the present application, the above-mentioned ninth rate-distortion cost is the minimum value among the rate-distortion cost when the above-mentioned second chrominance component is not filtered and the eleventh rate-distortion cost (this minimum value can be denoted as cost10), and the eleventh rate-distortion cost is the minimum value among the rate-distortion cost of the above-mentioned second chrominance component under the filter coefficient set of the reconstructed block and the rate-distortion cost of the second chrominance component under the fourth filter coefficient set (this minimum value can be denoted as cost8).

[0249] Example 2. Assume that the rate-distortion cost when the above-mentioned second chrominance component is not filtered is denoted as cost9, the rate-distortion cost of the above-mentioned second chrominance component under the filter coefficient set of the reconstructed block is denoted as cost7, and the rate-distortion cost of the above-mentioned second chrominance component under the fourth filter coefficient set is denoted as cost6. Then:

[0250] If cost6 < cost7, the second chrominance component of the current block is filtered using the new CCALF filter coefficient set (i.e., the fourth filter coefficient set); otherwise, the second chrominance component is filtered using the filter coefficient set of the reconstructed block. Among them, the minimum value of cost6 and cost7 is cost8.

[0251] If cost8 < cost9, the second chrominance component of the current block is filtered using CCALF; otherwise, the second chrominance component is not filtered using CCALF. Among them, the minimum value of cost8 and cost9 is cost10.

[0252] It should be noted that the filter coefficient set of the above-mentioned reconstructed block can be the filter coefficient set of the first chrominance component of the reconstructed block, or can be the filter coefficient set of the second chrominance component of the reconstructed block, which is not limited in the embodiments of the present application.

[0253] Combining the above Examples 1 and 2, it can be obtained that if cost11 < cost5 + cost10, the first chrominance component and the second chrominance component of the current block are loop-filtered using a shared filter coefficient set (i.e., the same filter coefficient set); otherwise, the first chrominance component and the second chrominance component are not loop-filtered using a shared filter coefficient set (i.e., different filter coefficient sets).

[0254] In this way, by selecting the filter coefficient set with the minimum total rate-distortion cost as the best shared filter coefficient set for the first chrominance component and the second chrominance component, the first chrominance component and the second chrominance component can share the same filter coefficient set, thereby reducing the coding bit overhead of the filter parameters and further improving the coding performance. In addition, since the number of bits spent on the filter parameters is reduced, there is a higher probability of selecting CCALF filtering during rate-distortion optimization, and the performance of the filtering will also be improved.

[0255] Optionally, in the embodiments of the present application, the first chrominance component and the second chrominance component can share a filter coefficient set at the filter level.

[0256] Optionally, in the embodiments of the present application, the first chrominance component and the second chrominance component can share a filter coefficient set at the slice level or the CTU level. Specifically, it is not limited in the embodiments of the present application.

[0257] Step 32: The encoding end performs in-loop filtering on the reconstructed block of the first chrominance component based on the first filter coefficient set, and performs in-loop filtering on the reconstructed block of the second chrominance component based on the first filter coefficient set.

[0258] Optionally, in the embodiments of the present application, the above Step 32 can be specifically implemented by the following Step 32a.

[0259] Step 32a: The encoding end performs intra-loop filtering on the reconstruction block of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and performs intra-loop filtering on the reconstruction block of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component.

[0260] In this embodiment of the application, the first filter coefficient group and the second filter coefficient group are the same set of filter coefficients in the first filter coefficient set. Alternatively, the first filter coefficient group and the second filter coefficient group are different sets of filter coefficients in the first filter coefficient set.

[0261] In this embodiment, the first filtering information and the second filtering information mentioned above are both information output from the pre-stage filter of the in-loop filter.

[0262] In this embodiment, for the first and second chromaticity components, the output of the preceding module of each chromaticity component (e.g., information after SAO filtering, i.e., the reconstructed values ​​of chromaticity pixels output by SAO) can be used as the input of the filter. For example, when the chromaticity U component is filtered within the loop using the new CCALF filter coefficient set (i.e., the first filter coefficient set mentioned above), the output of the preceding module of the chromaticity U component is used as the input; when the chromaticity V component is filtered within the loop using the new CCALF filter coefficient set, the output of the preceding module of the chromaticity V component is used as the input.

[0263] Optionally, in the embodiments of this application, step 32 above can be specifically implemented by step 32b below.

[0264] Step 32b: The encoding end performs intra-block filtering on the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and performs intra-block filtering on the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information.

[0265] In this embodiment of the application, the third filtering information includes any one of the following: the reconstructed block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstructed block of the adjacent chrominance components of the chrominance component of the current block.

[0266] In this embodiment of the application, the first filter coefficient group and the second filter coefficient group in step 32b above are the same group of filter coefficients in the first filter coefficient set. Alternatively, the first filter coefficient group and the second filter coefficient group in step 32b above are different groups of filter coefficients in the first filter coefficient set.

[0267] It is understandable that when the first chroma component (or second chroma component) needs filtering and a new CCALF filter coefficient set is required, the encoder can use the first filter coefficient set to filter the first chroma component (or second chroma component). When the first chroma component (or second chroma component) is filtered using the filter coefficient set of the reconstructed block, the encoder can use the filter coefficient set of the reconstructed block to filter the first chroma component (or second chroma component). Furthermore, after filtering the pixels that need filtering, the encoder can write the filtered pixels into the reconstructed block; for pixels that do not need filtering, they are directly written into the reconstructed block.

[0268] It should be noted that for the specific implementation of the in-loop filtering here, please refer to the description of the filtering process in the above embodiments, which will not be repeated here.

[0269] Step 33: The encoding end writes the first set of filter coefficients into the bit stream.

[0270] In this embodiment, when the chroma component of the current block is filtered using CCALF, the encoder can write information such as whether the current block (e.g., CTU) uses CCALF and the type of filter used by the current block into the bitstream. If a new set of filter coefficients (e.g., the first set of filter coefficients mentioned above) is used, the encoder can write information such as the set of filter coefficients, the number of filter coefficient groups, filter flags, filter order, and filter coefficients into the bitstream and transmit it to the decoder.

[0271] Optionally, the encoding method provided in this application embodiment may further include the following step 34:

[0272] Step 34: The encoding end writes the first syntax element into the bitstream.

[0273] In this embodiment of the application, the first syntax element can be used to characterize the APS index, which is used to indicate the first APS in the bitstream.

[0274] In this embodiment of the application, the first APS includes at least one set of filter coefficients, which includes N sets of filter coefficients. The first set of filter coefficients is one of the at least one set of filter coefficients, where N is a positive integer.

[0275] It is understood that each of the above-mentioned at least one set of filter coefficients may include N sets of filter coefficients. The filter coefficient set used by the encoder to filter the first chroma component and the second chroma component within the loop may be the same set of filter coefficients in the same set of at least one set of filter coefficients, or it may be different sets of filter coefficients in the same set of at least one set of filter coefficients.

[0276] In this embodiment of the application, the above-mentioned at least one set of filtering coefficients may include: a set of filtering coefficients for filtering within the loop of the first chromaticity component and the second chromaticity component (i.e., a set of filtering coefficients shared by the first chromaticity component and the second chromaticity component), a set of filtering coefficients for filtering within the loop of the first chromaticity component, and a set of filtering coefficients for filtering within the loop of the second chromaticity component.

[0277] It can be understood that the aforementioned first set of filter coefficients is the set of filter coefficients shared by the first chromaticity component and the second chromaticity component. The aforementioned set of filter coefficients for filtering within the first chromaticity component loop can be understood as the set of filter coefficients used by the first chromaticity component, i.e., the set of filter coefficients not shared with the second chromaticity component. Similarly, the aforementioned set of filter coefficients for filtering within the second chromaticity component loop can be understood as the set of filter coefficients used by the second chromaticity component, i.e., the set of filter coefficients not shared with the first chromaticity component.

[0278] In this embodiment of the application, the encoding end can write the aforementioned first syntax element into the slice header or picture header information in the bitstream.

[0279] For example, the first syntax element mentioned above can be represented as sh_alf_cc_chroma_aps_id.

[0280] Optionally, the encoding method provided in this application embodiment may further include the following step 35a:

[0281] Step 35a: The encoding end writes the second syntax element into the first APS. The second syntax element is used to characterize the N sets of filter coefficients in the first set of filter coefficients mentioned above.

[0282] In this embodiment of the application, the filter coefficient set for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients among the N sets of filter coefficients in the above-mentioned first filter coefficient set.

[0283] It is understood that the encoding end can write the second syntax element into the first APS. This second syntax element can be used to represent the index [k] of each group of filter coefficients in the first set of filter coefficients (i.e., the filter coefficient group in the set of filter coefficients shared by the first chromaticity component and the second chromaticity component), and the index [j] of the filter coefficient in that group of filter coefficients. Both k and j are integers.

[0284] In this embodiment of the application, the encoding end can write the aforementioned second syntax element into the alf_data in the bitstream.

[0285] For example, the second syntax element mentioned above may include the syntax element alf_cc_chroma_filters_signalled_minus1, indicating that when the first chroma component and the second chroma component use a shared set of filter coefficients, the number of filter coefficient groups in the set is reduced by 1. For example, if the number of filter coefficient groups shared by the first chroma component and the second chroma component is 6, then the value of the syntax element alf_cc_chroma_filters_signalled_minus1 is 5. For example, if k=0, the index of the filter coefficient group shared by the first chroma component and the second chroma component is index 0, and the number of the shared filter coefficient group is 1.

[0286] Optionally, the encoding method provided in this application embodiment may further include the following step 35b:

[0287] Step 35b: The encoding end writes the second syntax element into the first APS. The second syntax element can be used to represent the absolute value of the power exponent and the sign of the power exponent. The absolute value of the power exponent and the sign of the power exponent are used to determine the N sets of filter coefficients in the first set of filter coefficients mentioned above.

[0288] In this embodiment of the application, the encoding end can, based on the above-mentioned index [k] and index [j], write the index of the absolute value of the power exponent corresponding to the filter coefficient indicated by index j in the shared filter coefficient group indicated by index k in the bit stream, and write the power exponent sign corresponding to the filter coefficient indicated by index j in the shared filter coefficient group indicated by index k in the bit stream.

[0289] For example, the second syntax element mentioned above may also include the syntax element alf_cc_chroma_mapped_coeff_abs, where the specific syntax element written based on index [k] and index [j] can be represented as alf_cc_chroma_mapped_coeff_abs[k][j]. This can represent the absolute value of the aforementioned exponent.

[0290] For example, the second syntax element mentioned above may also include the syntax element alf_cc_chroma_coeff_sign, where the syntax element written based on index [k] and index [j] can be represented as alf_cc_chroma_coeff_sign[k][j]. This can represent the aforementioned exponentiation symbol.

[0291] It should be noted that the above symbols refer to the positive or negative sign of the power exponent.

[0292] Optionally, in this embodiment, the encoder may write a syntax element in the bitstream indicating whether a set of filter coefficients is shared. Exemplarily, the encoding method provided in this embodiment may further include the following step 36:

[0293] Step 36: The encoding end writes the seventh syntax element into the bitstream.

[0294] In this embodiment of the application, the seventh syntax element can be used to characterize the second indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component within the loop, that is, whether the first chromaticity component and the second chromaticity component share a set of filtering coefficients.

[0295] In this embodiment of the application, the encoding end can write the aforementioned seventh syntax element into the slice header or picture header information in the bitstream.

[0296] For example, the seventh syntax element mentioned above can be represented as sh_alf_cc_chroma_share_filter, which can be represented by a binary variable to indicate whether the first chroma component and the second chroma component share a set of filter coefficients.

[0297] For example, when the value of sh_alf_cc_chroma_share_filter (i.e., the second indication information mentioned above) is 0, meaning the second indication information indicates that sh_alf_cc_chroma_share_filter == 0, it means that the first chroma component and the second chroma component do not share the filter coefficient set, that is, the first filter coefficient set is not used for in-loop filtering of the first chroma component and the second chroma component. When the value of sh_alf_cc_chroma_share_filter (i.e., the second indication information mentioned above) is 1, meaning the second indication information indicates that sh_alf_cc_chroma_share_filter == 1, it means that the first chroma component and the second chroma component share a filter coefficient set, that is, the first filter coefficient set can be used for in-loop filtering of the first chroma component and the second chroma component.

[0298] In this embodiment of the application, the encoding end can write the aforementioned seventh syntax element into the context information (alf_data) in the bitstream.

[0299] For example, the seventh syntax element mentioned above can be represented as alf_cc_chroma_share_filter, which can be represented by a binary variable to indicate whether the first chroma component and the second chroma component share a set of filter coefficients.

[0300] For example, when the value of alf_cc_chroma_share_filter (i.e., the second indication information mentioned above) is 0, meaning the second indication information indicates alf_cc_chroma_share_filter == 0, it means that the first chroma component and the second chroma component do not share the filter coefficient set, that is, the first filter coefficient set is not used for in-loop filtering of the first chroma component and the second chroma component. When the value of alf_cc_chroma_share_filter (i.e., the second indication information mentioned above) is 1, meaning the second indication information indicates alf_cc_chroma_share_filter == 1, it means that the first chroma component and the second chroma component share a filter coefficient set, that is, the first filter coefficient is used for in-loop filtering of the first chroma component and the second chroma component.

[0301] In one implementation, the above-mentioned syntactic elements are illustrated in Tables 1 and 2 below.

[0302] Table 1(slice header)

[0303] In Table 1 above, the seventh syntax element sh_alf_cc_chroma_share_filter and the first syntax element sh_alf_cc_chroma_aps_id are written in the slice header.

[0304] Table 2 (alf_data)

[0305] In Table 2 above, the seventh syntax element alf_cc_chroma_share_filter, the second syntax elements alf_cc_chroma_filters_signalled_minus1, alf_cc_chroma_mapped_coeff_abs, and alf_cc_chroma_coeff_sign are written into alf_data.

[0306] Thus, the encoding end of this scheme indicates through syntax elements whether the first and second chroma components share a set of filter coefficients, so that the decoding end can determine whether to use the shared set of filter coefficients to filter the first and second chroma components; and, through syntax elements, indicates the APS index corresponding to the shared set of filter coefficients for the first and second chroma components, so that the decoding end can accurately parse the APS and obtain the shared set of filter coefficients; and, through syntax elements, indicates the index of the filter coefficient group in the shared set of filter coefficients for the first and second chroma components, the index of the filter coefficient in the filter coefficient group, and the absolute value and sign of the power exponent corresponding to the filter coefficient, so that the decoding end can accurately select the appropriate filter coefficients to perform in-loop filtering on the first and second chroma components. This reduces the encoding and decoding bit overhead of the filter parameters, thereby improving encoding and decoding performance.

[0307] Optionally, the encoding method provided in this application embodiment may further include the following step 37a:

[0308] Step 37a: The encoding end writes the third syntax element into the bitstream.

[0309] In this embodiment of the application, the aforementioned third syntax element is used to characterize first identification information, which is used to indicate a first index, and the first index is used to indicate a set of filter coefficients for filtering the first chromaticity component within the loop of the CTU.

[0310] In this embodiment, the encoding end can write a third syntax element into the bitstream, so that the decoding end can obtain the filtering coefficient group of the first chroma component of the CTU based on the identification information represented by the third syntax element. Then, the decoding end can determine the index of the filtering coefficient group used by the first chroma component of the CTU based on the identification information, thereby obtaining the filtering coefficients for the loop filtering of the first chroma component of the CTU.

[0311] In this embodiment of the application, the encoding end can write the aforementioned third syntax element into the CTU information in the bitstream.

[0312] For example, the third syntax element mentioned above can be represented as alf_ctb_cc_cb_idc, specifically as alf_ctb_cc_cb_idc[CtbAddrX][CtbAddrY], where CtbAddrX represents the address or index of the CTU in the horizontal direction (X-axis), and CtbAddrY represents the address or index of the CTU in the vertical direction (Y-axis). Through these two addresses, the position of any CTU in the image frame can be accurately located, so as to facilitate filtering of the CTU.

[0313] Optionally, the encoding method provided in this application embodiment may further include the following step 37b:

[0314] Step 37b: The encoding end writes the fourth syntax element into the bitstream.

[0315] In this embodiment of the application, the fourth syntax element is used to characterize the second identification information, which is used to indicate the second index, which is used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

[0316] In this embodiment of the application, the encoding end can write the fourth syntax element into the bitstream, so that the decoding end can obtain the filtering coefficient group of the second chroma component of CTU based on the identification information represented by the fourth syntax element. Then, the decoding end can determine the index of the filtering coefficient group used by the second chroma component of CTU based on the identification information, thereby obtaining the filtering coefficients for the loop filtering of the second chroma component of CTU.

[0317] In this embodiment of the application, the encoding end can write the aforementioned fourth syntax element into the CTU information in the bitstream.

[0318] For example, the fourth syntax element mentioned above can be represented as alf_ctb_cc_cr_idc, specifically as alf_ctb_cc_cr_idc[CtbAddrX][CtbAddrY], where CtbAddrX represents the address or index of the CTU in the horizontal direction (X-axis), and CtbAddrY represents the address or index of the CTU in the vertical direction (Y-axis). Through these two addresses, the position of any CTU in the image frame can be accurately located, so as to facilitate filtering of the CTU.

[0319] In this embodiment of the application, the encoding end can indicate the filter coefficient group used by the CTU in the bit stream. The first chroma component and the second chroma component can be different filter coefficient groups in the same filter coefficient set. The encoding end can indicate the filter coefficient group used by the first chroma component and the second chroma component of the CTU respectively through different signaling (i.e. the third syntax element and the fourth syntax element mentioned above), so as to achieve adaptive selection of the corresponding filter coefficient group for the first chroma component and the second chroma component, thereby improving the encoding performance.

[0320] Optionally, the encoding method provided in this application embodiment may further include the following step 38:

[0321] Step 38: The encoding end writes the fifth syntax element into the bitstream.

[0322] In this embodiment of the application, the fifth syntax element can be used to characterize the first indication information, which indicates whether the same set of filtering coefficients is used for in-loop filtering of the first chromaticity component and the second chromaticity component of the CTU, that is, whether the first chromaticity component and the second chromaticity component of the CTU share a set of filtering coefficients for in-loop filtering.

[0323] In this embodiment of the application, the encoding end can write the aforementioned fifth syntax element into the slice header or picture header information in the bitstream.

[0324] For example, the fifth syntax element mentioned above can be represented as sh_alf_cc_chroma_share_ctu_flag, which can be represented by a binary variable to indicate whether the first chroma component and the second chroma component share the filter coefficient group corresponding to the CTU, that is, whether they share the CTU-level parameters.

[0325] For example, when the value of sh_alf_cc_chroma_share_ctu_flag (i.e., the first indication information mentioned above) is 0, meaning the first indication information is represented as sh_alf_cc_chroma_share_ctu_flag == 0, it indicates that the first and second chroma components of the CTU do not share the filter coefficient set. When the value of sh_alf_cc_chroma_share_ctu_flag (i.e., the first indication information mentioned above) is 1, meaning the first indication information is represented as sh_alf_cc_chroma_share_ctu_flag == 1, it indicates that the first and second chroma components of the CTU share a set of filter coefficients.

[0326] Optionally, the encoding method provided in this application embodiment may further include the following step 37c:

[0327] Step 37c: The encoding end writes the sixth syntax element into the bitstream.

[0328] In this embodiment of the application, the sixth syntax element can be used to characterize third identification information, which is used to indicate a third index, which is used to indicate the filter coefficient group for the first chromaticity component and the second chromaticity component of the CTU in the loop.

[0329] In this embodiment, the encoding end can write the sixth syntax element into the bitstream, so that the decoding end can know the filter coefficient group shared by the first chroma component and the second chroma component of the CTU based on the identification information represented by the sixth syntax element. Then, when the first chroma component and the second chroma component share CTU-level parameters, the decoding end can determine the index of the filter coefficient group used by the CTU based on the identification information, thereby obtaining the filter coefficients for the loop filtering of the first chroma component and the second chroma component of the CTU.

[0330] In this embodiment of the application, the encoding end can write the aforementioned sixth syntax element into the CTU information in the bitstream.

[0331] For example, the sixth syntax element mentioned above can be represented as alf_ctb_cc_chroma_idc, specifically as alf_ctb_cc_chroma_idc[CtbAddrX][CtbAddrY], where CtbAddrX represents the address or index of the CTU in the horizontal direction (X-axis), and CtbAddrY represents the address or index of the CTU in the vertical direction (Y-axis). Through these two addresses, the position of any CTU in the image frame can be accurately located, so as to facilitate filtering of the CTU.

[0332] In this embodiment, the encoder can indicate the filter coefficient group used by the CTU in the bit stream. The first chroma component and the second chroma component can be the same filter coefficient group in the same filter coefficient set. The encoder can indicate the filter coefficient group used by the first chroma component and the second chroma component of the CTU through the same set of signaling (i.e. the sixth syntax element mentioned above), which saves coding bit information and improves coding performance.

[0333] In another implementation, the above-mentioned grammatical elements are illustrated in Table 3 below, Table 2 above, and Table 4 below.

[0334] Table 3(slice header)

[0335] In Table 3 above, the slice header contains the seventh syntax element sh_alf_cc_chroma_share_filter, the first syntax element sh_alf_cc_chroma_aps_id, and the fifth syntax element sh_alf_cc_chroma_share_ctu_flag, etc.

[0336] Table 4 (CTU)

[0337] Table 4 above shows the sixth syntax element alf_ctb_cc_chroma_idc, the third syntax element alf_ctb_cc_cb_idc, and the fourth syntax element alf_ctb_cc_cr_idc, etc., written into the CTU information.

[0338] It should be noted that for the method of indicating the filter coefficient group corresponding to the shared CTU through syntax elements, the syntax elements in alf_data are the same as those in Table 2 above. Please refer to the description in Table 2 above, and it will not be repeated here.

[0339] Thus, in the CCALF filtering process, the identification information sharing between the first and second chromaticity components at the CTU level is introduced, which further saves coding bit information and improves coding performance.

[0340] Optionally, in this embodiment of the application, after step 33 above, the encoding method provided in this embodiment of the application may further include the following step 39:

[0341] Step 39: The encoding end writes the eighth syntax element into the bitstream.

[0342] In this embodiment of the application, the eighth syntax element can be used to represent a first value, which can be used to represent the number of filter coefficient groups in the filter coefficient set that the first chromaticity component does not share with the second chromaticity component.

[0343] It should be noted that the filter coefficient groups in the aforementioned set of filter coefficients not shared by the first chromaticity component and the second chromaticity component can be understood as: the filter coefficient groups of the first chromaticity component that are not shared with the second chromaticity component. For example, if there are a total of 16 filter coefficient groups, and 8 of them are shared by the first and second chromaticity components, then the first chromaticity component has 8 filter coefficient groups that are not shared with the second chromaticity component. In addition to indicating the 8 shared filter coefficient groups through the syntax elements described in the above embodiments, these 8 filter coefficient groups of the first chromaticity component that are not shared with the second chromaticity component can be indicated through the aforementioned eighth syntax element.

[0344] In this embodiment of the application, the encoding end can write the aforementioned eighth syntax element into the alf_data in the bitstream.

[0345] For example, the eighth syntax element mentioned above can be represented as alf_cc_cb_extra_filter, which represents the filter coefficient set that the first chroma component does not share with the second chroma component, in addition to the shared filter coefficient set mentioned above.

[0346] It should be noted that the encoding end can use indices [k] and [j] to indicate the filter coefficient group that is not shared by the first chroma component and the second chroma component, as well as the filter coefficients that are not shared by the first chroma component and the second chroma component. Alternatively, the encoding end can also use indices [k] and [j] to write the absolute value and sign of the power exponent of the filter coefficients in the filter coefficient group that is not shared by the first chroma component and the second chroma component into the bitstream. For details, please refer to the description in the above embodiments; further elaboration is not provided here.

[0347] Optionally, in this embodiment of the application, after step 33 above, the encoding method provided in this embodiment of the application may further include the following step 40:

[0348] Step 40: The encoding end writes the ninth syntax element into the bitstream.

[0349] In this embodiment of the application, the aforementioned ninth syntax element can be used to characterize a second numerical value, which can be used to characterize a set of filter coefficients in the filter coefficient set that the aforementioned second chromaticity component does not share with the first chromaticity component.

[0350] It should be noted that the filter coefficient groups in the aforementioned set of filter coefficients that the second chromaticity component does not share with the first chromaticity component can be understood as: the filter coefficient groups of the second chromaticity component that are not shared with the first chromaticity component. For example, if there are a total of 16 filter coefficient groups, and the first and second chromaticity components share 8 filter coefficient groups, then the second chromaticity component has 8 filter coefficient groups that are not shared with the first chromaticity component. In addition to indicating the 8 shared filter coefficient groups through the syntax elements described in the above embodiments, these 8 filter coefficient groups of the second chromaticity component that are not shared with the first chromaticity component can be indicated through the aforementioned ninth syntax element.

[0351] In this embodiment of the application, the encoding end can write the aforementioned ninth syntax element into alf_data in the bitstream.

[0352] For example, the ninth syntax element mentioned above can be represented as alf_cc_cr_extra_filter, which represents the filter coefficient set that the second chroma component does not share with the first chroma component, in addition to the shared filter coefficient set mentioned above.

[0353] It should be noted that the encoding end can use indices [k] and [j] to indicate the filter coefficient group that the second chroma component does not share with the first chroma component, as well as the filter coefficients that the second chroma component does not share with the first chroma component. Alternatively, the encoding end can also use indices [k] and [j] to write the absolute value and sign of the power exponent of the filter coefficients in the filter coefficient group that the second chroma component does not share with the first chroma component into the bitstream. For details, please refer to the description in the above embodiments; further elaboration is not provided here.

[0354] In another implementation, the above-mentioned grammatical elements are illustrated in Table 1 above and Table 5 below.

[0355] It should be noted that for this method of indicating non-shared filter coefficient groups through syntax elements, the syntax elements in the slice header are the same as those in Table 1 above, as described in Table 1 above, and will not be repeated here.

[0356] Table 5 (alf_data)

[0357] Table 5 above shows the seventh syntax element alf_cc_chroma_share_filter, the second syntax elements alf_cc_chroma_filters_signalled_minus1, alf_cc_chroma_mapped_coeff_abs, alf_cc_chroma_coeff_sign, the eighth syntax element alf_cc_cb_extra_filter, and the ninth syntax element alf_cc_cr_extra_filter, etc., written into alf_data.

[0358] Thus, in addition to indicating the filter coefficient groups shared by the first chroma component and the second chroma component through the above-mentioned syntax elements, the encoding end of this scheme also indicates the filter coefficient groups that are not shared through syntax elements. That is, the filter coefficient groups that the first chroma component does not share with the second chroma component, and the filter coefficient groups that the second chroma component does not share with the first chroma component. This makes it easier for the decoding end to accurately select the corresponding filter coefficients to perform in-loop filtering on the first chroma component and the second chroma component, thereby improving the encoding and decoding performance.

[0359] This application provides an encoding method in which the encoder determines a first set of filtering coefficients, then performs in-loop filtering on the reconstructed block of the first chroma component based on the first set of filtering coefficients, and also performs in-loop filtering on the reconstructed block of the second chroma component based on the first set of filtering coefficients, before writing the first set of filtering coefficients into the bitstream. This scheme allows the encoder to use the first set of filtering coefficients to perform in-loop filtering on both the reconstructed blocks of the first and second chroma components. That is, the reconstructed blocks of the first and second chroma components can share the same set of filtering coefficients to achieve in-loop filtering, thus reducing the bit overhead of the chroma component filtering parameters and saving encoding bits. Furthermore, the encoder sends the first set of filtering coefficients to the decoder through the bitstream, making it convenient for the decoder to use the same set of filtering coefficients to perform in-loop filtering on both the reconstructed blocks of the first and second chroma components. This improves the overall encoding performance.

[0360] Figure 7 shows a flowchart of a decoding method provided in an embodiment of this application. The decoding method may include the following steps 51 and 52:

[0361] Step 51: The decoding end parses the bitstream to obtain the first set of filter coefficients.

[0362] In this embodiment of the application, the first set of filtering coefficients is the set of filtering coefficients for the chroma U component and the chroma V component of the current block, that is, a set of filtering coefficients shared by the chroma U component and the chroma V component.

[0363] Step 52: The decoding end performs intra-block filtering on the reconstruction block of the first chroma component based on the first set of filtering coefficients, and performs intra-block filtering on the reconstruction block of the second chroma component based on the first set of filtering coefficients.

[0364] In this embodiment of the application, the first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

[0365] It should be noted that for the relevant content in this embodiment, please refer to the description in the above encoding method embodiment, which will not be repeated here.

[0366] Optionally, in this embodiment of the application, referring to FIG7 and FIG8, step 51 above can be specifically implemented by step 51a as follows:

[0367] Step 51a: The decoding end parses the first syntax element in the bitstream to obtain the APS index.

[0368] In this embodiment of the application, the above-mentioned APS index can be used to indicate a first APS in the bitstream, the first APS including at least one set of filter coefficients, the set of filter coefficients including N sets of filter coefficients, where N is a positive integer.

[0369] In this embodiment of the application, the first set of filter coefficients is one of the filter coefficient sets in the at least one set of filter coefficients.

[0370] In this embodiment of the application, the first APS can be understood as the APS corresponding to the shared filter coefficient set of the first chromaticity component and the second chromaticity component.

[0371] It is understandable that the decoding end can select a set of filter coefficients from at least one set of filter coefficients in the first APS as the set of filter coefficients used by both the first chromaticity component and the second chromaticity component, that is, the set of filter coefficients used for filtering within the loop of the first chromaticity component and the second chromaticity component.

[0372] Optionally, the encoding method provided in this application embodiment may further include the following step 53a:

[0373] Step 53a: The decoding end obtains N sets of filter coefficients in the first filter coefficient set based on parsing the second syntax element in the first APS.

[0374] In this embodiment of the application, the filter coefficient group for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients from the N sets of filter coefficients in the first filter coefficient set.

[0375] In this embodiment, the decoding end can parse the second syntax element in the first APS to obtain indices [k] and [j]. Index [k] is the index of the filter coefficient group in the first filter coefficient set, and index [j] is the index of the filter coefficient in the filter coefficient group. Both k and j are integers.

[0376] Optionally, the encoding method provided in this application embodiment may further include the following steps 53b and 53c:

[0377] Step 53b: The decoding end parses the second syntax element in the first APS to obtain the absolute value of the exponent and the exponent sign.

[0378] Step 53c: The decoding end obtains N sets of filter coefficients in the first set of filter coefficients based on the absolute value and sign of the power exponent.

[0379] It should be noted that for explanations and clarifications here, please refer to the descriptions in the above-described encoding method embodiments, which will not be repeated here.

[0380] Optionally, in this embodiment, the decoding end can parse the syntax elements representing whether a set of filter coefficients is shared in the bitstream. For example, prior to step 51 above, the encoding method provided in this embodiment may further include step 54:

[0381] Step 54: The decoding end parses the seventh syntax element in the bitstream to obtain the second indication information.

[0382] In this embodiment of the application, the second indication information is used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component within the loop, that is, whether the first chromaticity component and the second chromaticity component share the same set of filtering coefficients.

[0383] It is understandable that when the second instruction information indicates that the same set of filter coefficients is used to filter the first chromaticity component and the second chromaticity component within the loop, the decoding end can obtain N sets of filter coefficients in the first set of filter coefficients based on parsing the second syntax element in the first APS.

[0384] It should be noted that the explanation of the second instruction information here is as described in the above-described encoding method embodiments, and will not be repeated here.

[0385] Thus, the decoding end of this scheme obtains information from the syntax elements as to whether the first chroma component and the second chroma component share a set of filter coefficients, thereby determining whether to use the shared set of filter coefficients for in-loop filtering of the first and second chroma components. Furthermore, it obtains the APS index corresponding to the shared set of filter coefficients of the first and second chroma components from the syntax elements, enabling accurate parsing of the APS to obtain the shared set of filter coefficients. Additionally, it obtains from the syntax elements the index of the filter coefficient group in the shared set of filter coefficients of the first and second chroma components, the index of the filter coefficient in that group, and the absolute value and sign of the power exponent corresponding to the filter coefficient, thereby enabling accurate selection of the appropriate filter coefficients for in-loop filtering of the first and second chroma components. This reduces the encoding and decoding bit overhead of the filter parameters, thereby improving encoding and decoding performance.

[0386] Based on Tables 1 and 2 above, the parsing process A for each of the above grammatical elements is illustrated below.

[0387] 1. Parse slice header information

[0388] The decoder parses the seventh syntax element, `sh_alf_cc_chroma_share_filter`. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 1, meaning the second indication information is `sh_alf_cc_chroma_share_filter == 1`, it indicates that the first and second chroma components use a shared set of filter coefficients for in-loop filtering. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 0, meaning the second indication information is `sh_alf_cc_chroma_share_filter == 0`, it indicates that the first and second chroma components do not use the same set of filter coefficients for in-loop filtering.

[0389] (1) If the value of the seventh syntax element sh_alf_cc_chroma_share_filter is 1, the decoder will parse the first syntax element sh_alf_cc_chroma_aps_id. This first syntax element indicates the APS index corresponding to the shared filter coefficient set used by the first chroma component and the second chroma component.

[0390] (2) If the value of the seventh syntax element sh_alf_cc_chroma_share_filter is 0, then:

[0391] (a) The decoder parses the syntax element `sh_alf_cc_cb_enabled_flag`, which indicates whether the first chroma component is filtered using CCALF. If the value of `sh_alf_cc_cb_enabled_flag` is 1, it means that the first chroma component is filtered using CCALF. In this case, the decoder parses the syntax element `sh_alf_cc_cb_aps_id`, which represents the APS index corresponding to the CCALF coefficients used by the first chroma component of the reconstructed block. If the value of `sh_alf_cc_cb_enabled_flag` is 0, it means that the first chroma component is not filtered using CCALF.

[0392] (b) The decoder parses the syntax element `sh_alf_cc_cr_enabled_flag`, which indicates whether the second chroma component is filtered using CCALF. If the value of `sh_alf_cc_cr_enabled_flag` is 1, it means that the second chroma component is filtered using CCALF. In this case, the decoder parses the syntax element `sh_alf_cc_cr_aps_id`, which represents the APS index corresponding to the CCALF coefficients used by the second chroma component of the reconstructed block. If the value of `sh_alf_cc_cr_enabled_flag` is 0, it means that the second chroma component is not filtered using CCALF.

[0393] 2. Parse APS information

[0394] The decoder parses the seventh syntax element, `alf_cc_chroma_share_filter`. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 1, meaning the second indication information is `alf_cc_chroma_share_filter == 1`, then it indicates that the first and second chroma components use the shared set of filter coefficients (i.e., the first set of filter coefficients) in the parsed APS for in-loop filtering. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 0, meaning the second indication information is `alf_cc_chroma_share_filter == 0`, then it indicates that the first and second chroma components do not use the shared set of filter coefficients in the parsed APS for in-loop filtering.

[0395] (1) If the value of the seventh syntax element alf_cc_chroma_share_filter is 1, the decoder continues to parse the second syntax element alf_cc_chroma_filters_signalled_minus1, which is the number of filter coefficient groups in the shared filter coefficient set minus 1. At this time, each filter coefficient group in the shared filter coefficient set needs to parse 31 filter coefficients.

[0396] (2) If the value of the seventh syntax element alf_cc_chroma_share_filter is 0, then:

[0397] (a) The decoder parses the syntax element `alf_cc_cb_filter_signal_flag`, which indicates whether the parsed APS contains a set of filter coefficients for the first chroma component. If the value of this syntax element is 1, it means that the parsed APS contains a set of filter coefficients for the first chroma component. If the value of this syntax element is 0, it means that the parsed APS does not contain a set of filter coefficients for the first chroma component, and the decoder will not parse any information related to the filter coefficients for the first chroma component.

[0398] (b) If the value of the syntax element alf_cc_cb_filter_signal_flag is 1, the decoder continues to parse the set of filter coefficients for the first chroma component. At this time, each set of filter coefficients in the set of filter coefficients for the first chroma component needs to parse 31 filter coefficients.

[0399] (c) The decoder parses the syntax element `alf_cc_cr_filter_signal_flag`, which indicates whether a set of filter coefficients for the second chroma component exists in the parsed APS. If the value of this syntax element is 1, it means that a set of filter coefficients for the second chroma component exists in the parsed APS. If the value of this syntax element is 0, it means that a set of filter coefficients for the second chroma component does not exist in the parsed APS, and the decoder will not parse any information related to the filter coefficients for the second chroma component.

[0400] (d) If the syntax element alf_cc_cr_filter_signal_flag is set to 1, the decoder continues to parse the set of filter coefficients for the second chroma component. In this case, each set of filter coefficients in the set of filter coefficients for the second chroma component needs to parse 31 filter coefficients.

[0401] Based on the above parsing process A, the decoding process A of this application embodiment is as follows:

[0402] (1) If the value of the seventh syntax element sh_alf_cc_chroma_share_filter is 1, then the first chroma component and the second chroma component will use the shared set of filter coefficients for in-loop filtering.

[0403] The decoding end can select the APS used by the first chroma component and the second chroma component according to the first syntax element sh_alf_cc_chroma_aps_id, and obtain the set of filter coefficients of the chroma component in the APS, that is, the filter coefficient group in the set of filter coefficients shared by the first chroma component and the second chroma component.

[0404] The decoder can determine the index of the filter coefficient group used for the first chromaticity component based on the syntax element alf_ctb_cc_cb_idc, and select the corresponding filter coefficients. The decoder can then perform in-loop filtering on the first chromaticity component of the pixel to be filtered and input the filtered result into the reconstructed image.

[0405] The decoding end can determine the index of the filter coefficient group used for the second chromaticity component based on the syntax element alf_ctb_cc_cr_idc, and select the corresponding filter coefficients. The decoding end can perform intra-loop filtering on the second chromaticity component of the pixel to be filtered, and input the filtering result of the filter output into the reconstructed image.

[0406] (2) If the value of the seventh syntax element sh_alf_cc_chroma_share_filter is 0, then the first chroma component and the second chroma component will not use the shared set of filter coefficients for filtering.

[0407] If the syntax element sh_alf_cc_cb_enabled_flag is set to 1, then the first chroma component will be filtered using CCALF.

[0408] The decoding end can select the APS used for the first chroma component based on the syntax element sh_alf_cc_cb_aps_id, and obtain the filtering coefficients of the first chroma component in the APS.

[0409] The decoding end can determine the index of the filter coefficient group used for the first chromaticity component based on the syntax element alf_ctb_cc_cb_idc, and select the corresponding new filter coefficients. The decoding end can perform in-loop filtering on the first chromaticity component of the pixel to be filtered, and input the filtering result of the filter output into the reconstructed image.

[0410] If the value of the syntax element sh_alf_cc_cb_enabled_flag is 0, then the first chroma component mentioned above will not be filtered using CCALF.

[0411] If the syntax element sh_alf_cc_cr_enabled_flag is set to 1, then the second chroma component will be filtered using CCALF.

[0412] The decoding end can select the APS used for the second chroma component based on the syntax element sh_alf_cc_cr_aps_id, and obtain the filtering coefficients of the second chroma component in that APS.

[0413] The decoding end can determine the index of the filter coefficient group in the set of filter coefficients used for the second chromaticity component based on the syntax element alf_ctb_cc_cr_idc, and select the corresponding new filter coefficient. The decoding end can perform in-loop filtering on the second chromaticity component of the pixel to be filtered, and input the filtering result of the filter output into the reconstructed image.

[0414] If the value of the syntax element sh_alf_cc_cr_enabled_flag is 0, then the second chroma component mentioned above will not be filtered using CCALF.

[0415] Optionally, in this embodiment of the application, after step 51 above, the decoding method provided in this embodiment of the application further includes the following step 55:

[0416] Step 55: The decoding end parses the eighth syntax element in the bitstream to obtain the first value.

[0417] In this embodiment of the application, the first value can be used to characterize the number of filter coefficients in the set of filter coefficients that the first chromaticity component does not share with the second chromaticity component.

[0418] In this embodiment of the application, when the first value is non-zero, the decoding end can parse the filter coefficient group in the filter coefficient set that the first chromaticity component does not share with the second chromaticity component.

[0419] Optionally, in this embodiment of the application, after step 51 above, the decoding method provided in this embodiment of the application further includes the following step 56:

[0420] Step 56: The decoding end parses the ninth syntax element in the bitstream to obtain the second value.

[0421] In this embodiment of the application, the second value can be used to characterize the filter coefficient group in the filter coefficient set that the second chromaticity component does not share with the first chromaticity component.

[0422] In this embodiment of the application, when the second value is non-zero, the decoding end can parse the filter coefficient group in the filter coefficient set that the second chromaticity component does not share with the first chromaticity component.

[0423] Thus, in addition to obtaining the filter coefficient sets shared by the first and second chroma components through the aforementioned syntax elements, the decoding end of this scheme also obtains the filter coefficient sets not shared by the first and second chroma components through the syntax elements. That is, the filter coefficient sets not shared by the first and second chroma components, and the filter coefficient sets not shared by the second and first chroma components, thereby enabling the accurate selection of the corresponding filter coefficients to filter the first and second chroma components, improving encoding and decoding performance.

[0424] Based on Tables 1 and 5 above, the following is a schematic diagram of the parsing process B for each of the above grammatical elements.

[0425] 1. Parse slice header information

[0426] It should be noted that for a detailed explanation of parsing the slice header information here, please refer to the description in the parsing process A of the above embodiment, which will not be repeated here.

[0427] 2. Parse APS information

[0428] The decoder parses the seventh syntax element, `alf_cc_chroma_share_filter`. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 1, meaning the second indication information is `alf_cc_chroma_share_filter == 1`, then it indicates that the first and second chroma components use the filter coefficient set from the shared filter coefficient set in the parsed APS for in-loop filtering. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 0, meaning the second indication information is `alf_cc_chroma_share_filter == 0`, then it indicates that the first and second chroma components do not use the filter coefficient set from the shared filter coefficient set in the parsed APS for in-loop filtering.

[0429] (1) If the value of the seventh syntax element alf_cc_chroma_share_filter is 1, the decoder continues to parse the second syntax element alf_cc_chroma_filters_signalled_minus1, which is the number of filter coefficient groups in the shared filter coefficient set minus 1. At this time, each filter coefficient group in the shared filter coefficient set needs to parse 31 filter coefficients.

[0430] (a) The decoder parses the eighth syntax element, alf_cc_cb_extra_filter. This eighth syntax element represents the number of filter coefficient groups in the set of filter coefficients that the first chroma component does not share with the second chroma component, i.e., the number of filter coefficient groups in the set of non-shared filter coefficients used by the first chroma component. If the value of this eighth syntax element is not 0, then each filter coefficient group in the set of non-shared filter coefficients needs to parse 31 filter coefficients; otherwise, the non-shared filter coefficients are not parsed.

[0431] (b) The decoder parses the ninth syntax element, alf_cc_cr_extra_filter, which represents the number of filter coefficient groups in the set of filter coefficients that the second chroma component does not share with the first chroma component; that is, the number of filter coefficient groups in the set of non-shared filter coefficients used by the second chroma component. If the value of this ninth syntax element is not 0, then each filter coefficient group in the set of non-shared filter coefficients needs to parse 31 filter coefficients; otherwise, no non-shared filter coefficients are parsed.

[0432] (2) If the syntax element alf_cc_chroma_share_filter is 0, then:

[0433] (a) The decoder parses the syntax element `alf_cc_cb_filter_signal_flag`, which indicates whether the parsed APS contains a set of filter coefficients for the first chroma component. If the value of this syntax element is 1, it means that the parsed APS contains a set of filter coefficients for the first chroma component. If the value of this syntax element is 0, it means that the parsed APS does not contain a set of filter coefficients for the first chroma component, and the decoder will not parse any information related to the filter coefficients for the first chroma component.

[0434] (b) If the value of the syntax element alf_cc_cb_filter_signal_flag is 1, the decoder continues to parse the set of filter coefficients for the first chroma component. At this time, each set of filter coefficients in the set of filter coefficients for the first chroma component needs to parse 31 filter coefficients.

[0435] (c) The decoder parses the syntax element `alf_cc_cr_filter_signal_flag`, which indicates whether a set of filter coefficients for the second chroma component exists in the parsed APS. If the value of this syntax element is 1, it means that a set of filter coefficients for the second chroma component exists in the parsed APS. If the value of this syntax element is 0, it means that a set of filter coefficients for the second chroma component does not exist in the parsed APS, and the decoder will not parse any information related to the filter coefficients for the second chroma component.

[0436] (d) If the syntax element alf_cc_cr_filter_signal_flag is set to 1, the decoder continues to parse the set of filter coefficients for the second chroma component. In this case, each set of filter coefficients in the set of filter coefficients for the second chroma component needs to parse 31 filter coefficients.

[0437] It should be noted that, in conjunction with the above-described parsing process B, the decoding process of this application embodiment can be referred to the description of the above-described decoding process A, and will not be repeated here.

[0438] Optionally, the decoding method provided in this application embodiment further includes the following step 57a:

[0439] Step 57a: The decoding end parses the third syntax element in the bitstream to obtain the first identification information.

[0440] In this embodiment of the application, the first identification information is used to indicate a first index, which is used to indicate the filter coefficient group for filtering the first chromaticity component in the loop of the CTU.

[0441] Optionally, the decoding method provided in this application embodiment further includes the following step 57b:

[0442] Step 57b: The decoding end parses the fourth syntax element in the bitstream to obtain the second identification information.

[0443] In this embodiment of the application, the aforementioned second identification information is used to indicate a second index, which is used to indicate a set of filter coefficients for filtering the second chromaticity component within the loop of the CTU.

[0444] Optionally, the decoding method provided in this application embodiment further includes the following step 58:

[0445] Step 58: The decoding end parses the fifth syntax element in the bitstream to obtain the first indication information.

[0446] In this embodiment of the application, the first indication information mentioned above can be used to indicate whether the same set of filter coefficients is used for in-loop filtering of the first chromaticity component and the second chromaticity component of the CTU, that is, whether the first chromaticity component and the second chromaticity component of the CTU share a set of filter coefficients for in-loop filtering.

[0447] Optionally, the decoding method provided in this application embodiment further includes the following step 57c:

[0448] Step 57c: The decoding end parses the sixth syntax element in the bitstream to obtain the third identification information.

[0449] In this embodiment of the application, the aforementioned third identification information can be used to indicate a third index, which is used to indicate the filter coefficient group for the in-loop filtering of the first and second chromaticity components of the CTU.

[0450] Thus, in the CCALF filtering process, the sharing of identification information between the first and second chromaticity components at the CTU level is introduced, further saving encoding and decoding bit information and improving encoding and decoding performance.

[0451] It should be noted that the explanations of the fifth syntax element, each identification information, the sixth syntax element, and the first instruction information are as described in the above-described encoding method embodiments, and will not be repeated here.

[0452] Based on Tables 3, 2, and 4 above, the parsing process C for each of the above grammatical elements is illustrated below.

[0453] 1. Parse slice header information

[0454] The decoder parses the seventh syntax element, `sh_alf_cc_chroma_share_filter`. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 1, meaning the second indication information is `sh_alf_cc_chroma_share_filter == 1`, it indicates that the first and second chroma components use the filter coefficient set from the shared filter coefficient set for in-loop filtering. If the value of this seventh syntax element (i.e., the second indication information mentioned above) is 0, meaning the second indication information is `sh_alf_cc_chroma_share_filter == 0`, it indicates that the first and second chroma components do not use the filter coefficient set from the shared filter coefficient set for in-loop filtering.

[0455] (1) If the value of the seventh syntax element sh_alf_cc_chroma_share_filter is 1, the decoder will parse the first syntax element sh_alf_cc_chroma_aps_id. This first syntax element indicates the APS index corresponding to the shared filter coefficient set used by the first chroma component and the second chroma component.

[0456] (2) If the value of the seventh syntax element sh_alf_cc_chroma_share_filter is 0, then:

[0457] (a) The decoder parses the syntax element `sh_alf_cc_cb_enabled_flag`, which indicates whether the first chroma component is filtered using CCALF. If the value of `sh_alf_cc_cb_enabled_flag` is 1, it means that the first chroma component is filtered using CCALF. In this case, the decoder parses the syntax element `sh_alf_cc_cb_aps_id`, which represents the APS index corresponding to the CCALF coefficients used by the first chroma component of the reconstructed block. If the value of `sh_alf_cc_cb_enabled_flag` is 0, it means that the first chroma component is not filtered using CCALF.

[0458] (b) The decoder parses the syntax element `sh_alf_cc_cr_enabled_flag`, which indicates whether the second chroma component is filtered using CCALF. If the value of `sh_alf_cc_cr_enabled_flag` is 1, it means that the second chroma component is filtered using CCALF. In this case, the decoder parses the syntax element `sh_alf_cc_cr_aps_id`, which represents the APS index corresponding to the CCALF coefficients used by the second chroma component of the reconstructed block. If the value of `sh_alf_cc_cr_enabled_flag` is 0, it means that the second chroma component is not filtered using CCALF.

[0459] (c) The decoder parses the fifth syntax element `sh_alf_cc_chroma_share_ctu_flag`, which indicates whether the first and second chroma components share the filter coefficient set corresponding to the CTU. If the value of this fifth syntax element is 1, it means that the first and second chroma components of the CTU share a set of filter coefficients. If the value of this fifth syntax element is 0, it means that the first and second chroma components of the CTU do not share the filter coefficient set.

[0460] 2. Parse APS information

[0461] It should be noted that for a detailed explanation of parsing APS information here, please refer to the description in the parsing process A of the above embodiment, which will not be repeated here.

[0462] 3. Parse CTU identification information

[0463] (1) If the value of the fifth syntax element sh_alf_cc_chroma_share_ctu_flag is 1, it means that the first chroma component and the second chroma component use the identification information of the shared CTU. At this time, the decoding end parses the sixth syntax element alf_ctb_cc_chroma_idc. The sixth syntax element indicates that the first chroma component and the second chroma component of the CTU share the filter coefficient group, that is, the index of the filter coefficient group used by the first chroma component and the second chroma component of the CTU.

[0464] (2) If the value of the fifth syntax element sh_alf_cc_chroma_share_ctu_flag is 0, it means that the first and second chroma components do not use the shared CTU identification information. In this case:

[0465] (a) If the value of the syntax element sh_alf_cc_cb_enabled_flag is 1, the decoder parses the syntax element alf_ctb_cc_cb_idc, which represents the index of the filter coefficient group used by the first chromaticity component of CTU.

[0466] (b) If the value of the syntax element sh_alf_cc_cr_enabled_flag is 1, the decoder parses the syntax element alf_ctb_cc_cr_idc, which represents the index of the filter coefficient group used by the second chromaticity component of the CTU.

[0467] It should be noted that, in conjunction with the above parsing process C, the decoding process of this application embodiment can be referred to the description of the above decoding process A, and will not be repeated here.

[0468] Optionally, in the embodiments of this application, step 52 above can be specifically implemented by step 52a below.

[0469] Step 52a: The decoding end performs intra-loop filtering on the reconstruction block of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and performs intra-loop filtering on the reconstruction block of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component.

[0470] In this embodiment of the application, the first filter coefficient group and the second filter coefficient group are the same set of filter coefficients in the first filter coefficient set. Alternatively, the first filter coefficient group and the second filter coefficient group are different sets of filter coefficients in the first filter coefficient set.

[0471] In this embodiment, the first filtering information and the second filtering information mentioned above are both information output from the pre-stage filter of the in-loop filter.

[0472] Optionally, in the embodiments of this application, step 52 above can be specifically implemented by step 52b below.

[0473] Step 52b: The decoding end performs intra-block filtering on the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and performs intra-block filtering on the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information.

[0474] In this embodiment of the application, the third filtering information may include any one of the following: a reconstructed block of the luminance component of the current block, a residual block of the luminance component of the current block, or a reconstructed block of the chrominance component adjacent to the chrominance component of the current block.

[0475] This application provides a decoding method in which the decoding end can parse the bitstream to obtain a first set of filtering coefficients. Then, based on the first set of filtering coefficients, it performs in-loop filtering on the reconstructed block of the first chroma component and in-loop filtering on the reconstructed block of the second chroma component. Through this scheme, the decoding end can use the first set of filtering coefficients to perform in-loop filtering on both the reconstructed blocks of the first and second chroma components. That is, the reconstructed blocks of the first and second chroma components can share the same set of filtering coefficients to achieve in-loop filtering, thus reducing the encoding bit overhead of the chroma component filtering parameters, thereby saving encoding bits and improving overall encoding performance.

[0476] Accordingly, this application provides an encoding device, which can be divided into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0477] Figure 9 shows a possible structural diagram of the encoding device involved in the above embodiments, where each functional module is divided according to its corresponding function. As shown in Figure 9, the encoding device 160 includes a filtering module 161 and an encoding module 162.

[0478] The filtering module 161 is used to determine a first set of filtering coefficients; and to perform in-loop filtering on the reconstructed block of the first chroma component based on the first set of filtering coefficients, and to perform in-loop filtering on the reconstructed block of the second chroma component based on the first set of filtering coefficients. The encoding module 162 is used to write the first set of filtering coefficients obtained by the filtering module 161 into the bitstream.

[0479] In some implementations, the encoding module 162 is further configured to write a first syntax element into the bitstream, the first syntax element being used to characterize an APS index, the APS index being used to indicate a first APS in the bitstream, the first APS including at least one set of filter coefficients, the set of filter coefficients including N sets of filter coefficients, the first set of filter coefficients being one of the at least one set of filter coefficients, where N is a positive integer.

[0480] In some implementations, the above-mentioned encoding module 162 is further used to write the second syntax element into the first APS, the second syntax element being used to characterize the N sets of filter coefficients in the first set of filter coefficients; wherein, the filter coefficient set for filtering the first chroma component and the second chroma component within the loop is: the same set of filter coefficients among the N sets of filter coefficients in the first set of filter coefficients.

[0481] In some implementations, the above-mentioned encoding module 162 is further used to write a second syntax element into the first APS, the second syntax element being used to characterize the absolute value of the power exponent and the sign of the power exponent, the absolute value of the power exponent and the sign of the power exponent being used to determine N sets of filter coefficients in the first set of filter coefficients.

[0482] In some implementations, the encoding module 162 is further configured to write a third syntax element into the bitstream, the third syntax element being used to characterize first identification information, the first identification information being used to indicate a first index, and the first index being used to indicate a set of filter coefficients for filtering the first chromaticity component of the CTU within the loop.

[0483] In some implementations, the encoding module 162 is further configured to write a fourth syntax element into the bitstream, the fourth syntax element being used to characterize the second identification information, the second identification information being used to indicate the second index, and the second index being used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

[0484] In some implementations, the encoding module 162 is further configured to write a fifth syntax element into the bitstream, the fifth syntax element being used to characterize first indication information, the first indication information being used to indicate whether the same set of filtering coefficients is used for in-loop filtering of the first and second chromaticity components of the CTU.

[0485] In some implementations, the encoding module 162 is further configured to write a sixth syntax element into the bitstream, the sixth syntax element being used to characterize third identification information, the third identification information being used to indicate a third index, and the third index being used to indicate a set of filter coefficients for in-loop filtering of the first and second chromaticity components of the CTU.

[0486] In some implementations, the encoding module 162 is further configured to write a seventh syntax element into the bitstream, the seventh syntax element being used to characterize second indication information, the second indication information being used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component within the loop.

[0487] In some implementations, the filtering module 161 is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component; wherein the first filtering coefficient group and the second filtering coefficient group are the same set of filtering coefficients in the first set of filtering coefficients; or, the first filtering coefficient group and the second filtering coefficient group are different sets of filtering coefficients in the first set of filtering coefficients; and the first filtering information and the second filtering information are both information output from the pre-stage filtering of the in-loop filtering.

[0488] In some implementations, the filtering module 161 is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information; wherein the third filtering information includes any one of the following: the reconstruction block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstruction block of the adjacent chromaticity components of the chromaticity component of the current block.

[0489] In some implementations, the filtering module 161 is specifically used to: determine a first covariance matrix based on the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component; determine a first error vector based on the error vector of the first chromaticity component and the error vector of the second chromaticity component; and determine a first set of filtering coefficients based on the first covariance matrix and the first error vector.

[0490] In some implementations, the aforementioned filtering module 161 is specifically used for:

[0491] The second set of filter coefficients is determined based on the first covariance matrix and the first error vector;

[0492] Calculate the first total distortion cost, the second total distortion cost, and the third total distortion cost; wherein, the first total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the third set of filter coefficients, which is the set of filter coefficients for the first chromaticity component; the second total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the fourth set of filter coefficients, which is the set of filter coefficients for the second chromaticity component; the third total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under the second set of filter coefficients;

[0493] The first set of filter coefficients is determined based on the first total distortion cost, the second total distortion cost, and the third total distortion cost.

[0494] In some implementations, the filtering module 161 described above is also used for:

[0495] Calculate the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost. The first rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients of the first chromaticity component. The second rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients of the second chromaticity component. The third rate-distortion cost is the rate-distortion cost of the first chromaticity component under the second set of filter coefficients.

[0496] The third set of filter coefficients is determined based on the first rate distortion cost, the second rate distortion cost, and the third rate distortion cost.

[0497] In some implementations, the filtering module 161 described above is also used for:

[0498] Calculate the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost. The fourth rate distortion cost is the rate distortion cost of the second chromaticity component under the initial filter coefficient set of the first chromaticity component. The fifth rate distortion cost is the rate distortion cost of the second chromaticity component under the initial filter coefficient set of the second chromaticity component. The sixth rate distortion cost is the rate distortion cost of the second chromaticity component under the second filter coefficient set.

[0499] The fourth set of filter coefficients is determined based on the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost.

[0500] In some implementations, the filtering module 161 is further configured to determine whether to use the same set of filtering coefficients to filter the first chromaticity component and the second chromaticity component within the loop, provided that the seventh rate distortion cost is less than the sum of the eighth and ninth rate distortion costs. The seventh rate distortion cost is the minimum of the first total rate distortion cost, the second total rate distortion cost, and the third total rate distortion cost. The eighth rate distortion cost is the minimum of the rate distortion cost when the first chromaticity component is not filtered and the tenth rate distortion cost, where the tenth rate distortion cost is the minimum of the rate distortion cost of the first chromaticity component under the set of filtering coefficients in the reconstructed block and the rate distortion cost of the first chromaticity component under the third set of filtering coefficients. The ninth rate distortion cost is the minimum of the rate distortion cost when the second chromaticity component is not filtered and the eleventh rate distortion cost, where the eleventh rate distortion cost is the minimum of the rate distortion cost of the second chromaticity component under the set of filtering coefficients in the reconstructed block and the rate distortion cost of the second chromaticity component under the fourth set of filtering coefficients.

[0501] In some implementations, the first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

[0502] In the encoding apparatus of this application embodiment, since the encoding apparatus can use the first set of filter coefficients to perform in-loop filtering on both the reconstructed blocks of the first chroma component and the reconstructed blocks of the second chroma component, that is, the reconstructed blocks of the first chroma component and the reconstructed blocks of the second chroma component can share the same set of filter coefficients to achieve in-loop filtering, the encoding bit overhead of the chroma component filtering parameters is reduced, thereby saving encoding bits. Furthermore, the encoding apparatus sends the first set of filter coefficients to the decoding end through the bitstream, thereby facilitating the decoding end to use the same set of filter coefficients to perform in-loop filtering on the reconstructed blocks of the first chroma component and the reconstructed blocks of the second chroma component. Thus, the overall encoding performance is improved.

[0503] Each module of the above-mentioned encoding device can also be used to perform other actions in the above-mentioned method embodiments. All relevant content of each step involved in the above-mentioned method embodiments can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0504] Figure 10 illustrates another possible structural diagram of the encoding device involved in the above embodiments when using integrated units. As shown in Figure 10, the encoding device 1600 provided in this application embodiment may include a processing module 1601 and a communication module 1602. The processing module 1601 can be used to control and manage the operation of the encoding device. For example, the processing module 1601 can be used to support the encoding device in executing the various steps in the above-described encoding method embodiments, and / or other processes used in the technology described herein. The communication module 1602 can be used to support communication between the encoding device and other network entities, such as communication with the encoding device itself. In one example, as shown in Figure 10, the encoding device 1600 may also include a storage module 1603 for storing the program code and data of the encoding device, such as storing encoded images or bitstreams.

[0505] The processing module 1601 can be a processor, such as the encoder 112 in Figure 3 above. The communication module 1602 can be a transceiver, transceiver circuit, or communication interface, such as the communication interface 113 in Figure 3. The storage module 1603 can be a memory.

[0506] For more details on how the modules included in the above encoding device implement the above functions, please refer to the descriptions in the preceding method embodiments, which will not be repeated here.

[0507] Accordingly, this application provides a decoding device. Based on the above method examples, the decoding device can be divided into functional modules. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used.

[0508] Figure 11 shows a possible structural diagram of the decoding device involved in the above embodiments, where each functional module is divided according to its corresponding function. As shown in Figure 11, the decoding device 180 includes: a parsing module 181 and a filtering module 182.

[0509] The parsing module 181 is used to parse the bitstream to obtain a first set of filtering coefficients. The filtering module 182 is used to perform intra-block filtering on the reconstruction block of the first chroma component based on the first set of filtering coefficients obtained by the parsing module 181, and to perform intra-block filtering on the reconstruction block of the second chroma component based on the first set of filtering coefficients obtained by the parsing module 181.

[0510] In some implementations, the parsing module 181 is specifically used to: parse the first syntax element in the bitstream to obtain the APS index, which is used to indicate the first APS in the bitstream, the first APS including at least one set of filter coefficients, the set of filter coefficients including N sets of filter coefficients, the first set of filter coefficients being one of the at least one set of filter coefficients, where N is a positive integer.

[0511] In some implementations, the parsing module 181 is further used to obtain N sets of filter coefficients in the first filter coefficient set based on parsing the second syntax element in the first APS; wherein, the filter coefficient set for filtering the first chromaticity component and the second chromaticity component within the loop is: the same set of filter coefficients in the N sets of filter coefficients in the first filter coefficient set.

[0512] In some implementations, the parsing module 181 is further used to: parse the second syntax element in the first APS to obtain the absolute value of the power exponent and the power exponent sign; and obtain N sets of filter coefficients in the first filter coefficient set based on the absolute value of the power exponent and the power exponent sign.

[0513] In some implementations, the parsing module 181 is further used to parse the third syntax element in the bitstream to obtain first identification information, which is used to indicate a first index, which is used to indicate the filter coefficient group for the first chromaticity component loop filtering of the CTU.

[0514] In some implementations, the parsing module 181 is further used to parse the fourth syntax element in the bitstream to obtain second identification information, which is used to indicate a second index, which is used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

[0515] In some implementations, the parsing module 181 is also used to parse the fifth syntax element in the bitstream to obtain first indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component of the CTU within the loop.

[0516] In some implementations, the parsing module 181 is also used to parse the sixth syntax element in the bitstream to obtain third identification information, which is used to indicate a third index, which is used to indicate the filter coefficient group for the first and second chromaticity components of the CTU in-loop filtering.

[0517] In some implementations, the parsing module 181 is also used to parse the seventh syntax element in the bitstream to obtain second indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chroma component and the second chroma component within the loop.

[0518] In some implementations, the filtering module 182 is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component; wherein the first filtering coefficient group and the second filtering coefficient group are the same set of filtering coefficients in the first set of filtering coefficients; or, the first filtering coefficient group and the second filtering coefficient group are different sets of filtering coefficients in the first set of filtering coefficients; and the first filtering information and the second filtering information are both information output from the pre-stage filtering of the in-loop filtering.

[0519] In some implementations, the filtering module 182 is specifically used to perform in-loop filtering on the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and to perform in-loop filtering on the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information; wherein the third filtering information includes any one of the following: the reconstruction block of the luminance component of the current block, the residual block of the luminance component of the current block, and the reconstruction block of the adjacent chromaticity components of the chromaticity component of the current block.

[0520] In some implementations, the first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

[0521] In the decoding apparatus of this application embodiment, since the decoding apparatus can use the first set of filtering coefficients to perform in-loop filtering on both the reconstructed blocks of the first chroma component and the reconstructed blocks of the second chroma component, that is, the reconstructed blocks of the first chroma component and the reconstructed blocks of the second chroma component can share the same set of filtering coefficients to achieve in-loop filtering, the encoding bit overhead of the filtering parameters of the chroma component is reduced, thereby saving encoding bits and thus improving the overall encoding performance.

[0522] Each module of the above-mentioned decoding device can also be used to perform other actions in the above-mentioned method embodiments. All relevant content of each step involved in the above-mentioned method embodiments can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0523] Figure 12 illustrates another possible structural diagram of the decoding device involved in the above embodiments when using integrated units. As shown in Figure 12, the decoding device 1800 provided in this application embodiment may include a processing module 1801 and a communication module 1802. The processing module 1801 can be used to control and manage the operation of the decoding device. For example, the processing module 1801 can be used to support the decoding device in executing various steps in the above-described decoding method embodiments, and / or other processes used in the technology described herein. The communication module 1802 can be used to support communication between the decoding device and other network entities, such as communication with an image encoding device. In one example, as shown in Figure 12, the decoding device 1800 may also include a storage module 1803 for storing the program code and data of the decoding device, such as storing the decoded image.

[0524] The processing module 1801 can be a processor, such as the decoder 122 in Figure 3. The communication module 1802 can be a transceiver, transceiver circuit, or communication interface, such as the communication interface 121 in Figure 3. The storage module 1803 can be a memory.

[0525] For more details on how the modules included in the above decoding device implement the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here.

[0526] This application also provides an encoding / decoding system, including an encoder and a decoder. The encoder is used to execute the encoding method described in the above embodiments, and the decoder is used to execute the decoding method described in the above embodiments.

[0527] This application also provides a computer-readable storage medium storing a computer program. When executed by at least one processor, the computer program implements the various processes of the above-described encoding or decoding method embodiments and achieves the same technical effects. To avoid repetition, further details are omitted here. The readable storage medium includes computer-readable storage media such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0528] This application also provides a computer storage medium for storing a bitstream generated by the encoding method described in the above embodiments.

[0529] This application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described encoding or decoding method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0530] This application also provides a computer program product, including computer program instructions. When these computer program instructions are executed, they implement the various processes of the above-described encoding or decoding method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0531] This application also provides a computer program that, when run on a computer, causes the computer to execute the encoding method as described in the above embodiments, or to execute the decoding method as described in the above embodiments.

[0532] It should be noted that the scope of the methods and apparatus in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.

[0533] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.

[0534] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0535] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0536] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0537] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0538] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0539] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A decoding method, comprising: include: Parse the bitstream to obtain the first set of filter coefficients; Based on the first set of filtering coefficients, the reconstruction block of the first chromaticity component is filtered within the loop, and based on the first set of filtering coefficients, the reconstruction block of the second chromaticity component is filtered within the loop.

2. The method of claim 1, wherein, The parsed bitstream yields a first set of filter coefficients, including: Parse the first syntax element in the bitstream to obtain the Adaptive Parameter Set (APS) index. The APS index is used to indicate the first APS in the bitstream. The first APS includes at least one set of filter coefficients. The set of filter coefficients includes N sets of filter coefficients. The first set of filter coefficients is one of the at least one set of filter coefficients, and N is a positive integer.

3. The method of claim 2, wherein, The method further includes: Based on parsing the second syntax element in the first APS, N sets of filter coefficients in the first set of filter coefficients are obtained; The filter coefficient set for the loop filtering of the first chromaticity component and the second chromaticity component is the same set of filter coefficients among the N sets of filter coefficients in the first filter coefficient set.

4. The method of claim 2, wherein, The method further includes: Parse the second syntax element in the first APS to obtain the absolute value of the exponent and the sign of the exponent; Based on the absolute value of the power exponent and the sign of the power exponent, N sets of filter coefficients are obtained in the first set of filter coefficients.

5. The method of claim 2, wherein, The method further includes: Parse the third syntax element in the bitstream to obtain first identification information. The first identification information is used to indicate a first index. The first index is used to indicate the filter coefficient group for the in-ring filtering of the first chroma component of the coding tree unit (CTU).

6. The method of claim 2, wherein, The method further includes: Parse the fourth syntax element in the bitstream to obtain the second identification information. The second identification information is used to indicate the second index, which is used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

7. The method of claim 3, wherein, The method further includes: Parse the fifth syntax element in the bitstream to obtain the first indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component of the CTU in the loop.

8. The method of claim 7, wherein, The method further includes: The sixth syntax element in the bitstream is parsed to obtain the third identification information, which is used to indicate the third index. The third index is used to indicate the filter coefficient group for the in-loop filtering of the first chroma component and the second chroma component of CTU.

9. The method of claim 1, wherein, The method further includes: The seventh syntax element in the bitstream is parsed to obtain the second indication information, which is used to indicate whether the same set of filtering coefficients is used to filter the first chroma component and the second chroma component within the loop.

10. The method according to any one of claims 1 to 9, characterized in that, The step of filtering the reconstructed block loop of the first chromaticity component based on the first set of filter coefficients, and filtering the reconstructed block loop of the second chromaticity component based on the first set of filter coefficients, includes: Based on the first filtering coefficient set and the first filtering information of the first chromaticity component, the reconstruction block loop of the first chromaticity component is filtered, and based on the second filtering coefficient set and the second filtering information of the second chromaticity component, the reconstruction block loop of the second chromaticity component is filtered. Wherein, the first filter coefficient group and the second filter coefficient group are the same group of filter coefficients in the first filter coefficient set; or, the first filter coefficient group and the second filter coefficient group are different groups of filter coefficients in the first filter coefficient set; the first filter information and the second filter information are both information from the pre-stage filter output of the in-loop filter.

11. The method according to any one of claims 1 to 10, characterized in that, The step of filtering the reconstructed block-loop portion of the first chromaticity component based on the first set of filter coefficients, and filtering the reconstructed block-loop portion of the second chromaticity component based on the first set of filter coefficients, includes: Based on the first set of filter coefficients and the third filter information, the reconstruction block loop of the first chromaticity component is filtered, and based on the first set of filter coefficients and the third filter information, the reconstruction block loop of the second chromaticity component is filtered. The third filtering information includes any one of the following: a reconstructed block of the luminance component of the current block, a residual block of the luminance component of the current block, and a reconstructed block of the adjacent chrominance components of the chrominance component of the current block.

12. The method according to any one of claims 1 to 11, characterized in that, The first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

13. An encoding method, characterized by, include: Determine the first set of filter coefficients; Based on the first set of filter coefficients, in-loop filtering is applied to the reconstructed block of the first chromaticity component, and based on the first set of filter coefficients... Combined, the reconstruction block loop filtering of the second chromaticity component; Write the first set of filter coefficients into the bitstream.

14. The method of claim 13, wherein, The method further includes: A first syntax element is written into the bitstream. The first syntax element is used to characterize the adaptive parameter set (APS) index. The APS index is used to indicate the first APS in the bitstream. The first APS includes at least one set of filter coefficients. The set of filter coefficients includes N sets of filter coefficients. The first set of filter coefficients is one of the at least one set of filter coefficients. N is a positive integer.

15. The method of claim 14, wherein, The method further includes: Write the second syntax element into the first APS. The second syntax element is used to characterize the N sets of filter coefficients in the first set of filter coefficients. The filter coefficient set for the loop filtering of the first chromaticity component and the second chromaticity component is the same set of filter coefficients among the N sets of filter coefficients in the first filter coefficient set.

16. The method of claim 14, wherein, The method further includes: Write the second syntax element into the first APS. The second syntax element is used to represent the absolute value of the power exponent and the sign of the power exponent. The absolute value of the power exponent and the sign of the power exponent are used to determine the N sets of filter coefficients in the first set of filter coefficients.

17. The method of claim 14, wherein, The method further includes: A third syntax element is written into the bitstream. The third syntax element is used to characterize first identification information. The first identification information is used to indicate a first index. The first index is used to indicate the filter coefficient group for the in-ring filtering of the first chroma component of the coding tree unit (CTU).

18. The method of claim 14, wherein, The method further includes: A fourth syntax element is written into the bitstream, the fourth syntax element being used to characterize second identification information, the second identification information being used to indicate a second index, the second index being used to indicate a set of filter coefficients for the second chromaticity component loop filtering of the CTU.

19. The method of claim 15, wherein, The method further includes: A fifth syntax element is written into the bitstream. The fifth syntax element is used to characterize first indication information, which indicates whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component of the CTU within the loop.

20. The method of claim 19, wherein, The method further includes: The sixth syntax element is written into the bitstream. The sixth syntax element is used to characterize the third identification information. The third identification information is used to indicate the third index. The third index is used to indicate the filter coefficient group for the in-loop filtering of the first chromaticity component and the second chromaticity component of the CTU.

21. The method of claim 13, wherein, The method further includes: A seventh syntax element is written into the bitstream. The seventh syntax element is used to characterize second indication information, which indicates whether the same set of filter coefficients is used to filter the first chroma component and the second chroma component within the loop.

22. The method of any one of claims 13-21, wherein, The step of filtering the reconstructed block loop of the first chromaticity component based on the first set of filter coefficients, and filtering the reconstructed block loop of the second chromaticity component based on the first set of filter coefficients, includes: Based on the first filtering coefficient set and the first filtering information of the first chromaticity component, the reconstruction block loop of the first chromaticity component is filtered, and based on the second filtering coefficient set and the second filtering information of the second chromaticity component, the reconstruction block loop of the second chromaticity component is filtered. Wherein, the first filter coefficient group and the second filter coefficient group are the same group of filter coefficients in the first filter coefficient set; or, the first filter coefficient group and the second filter coefficient group are different groups of filter coefficients in the first filter coefficient set; the first filter information and the second filter information are both information from the pre-stage filter output of the in-loop filter.

23. The method of any one of claims 13-22, wherein, The step of filtering the reconstructed block loop of the first chromaticity component based on the first set of filter coefficients, and filtering the reconstructed block loop of the second chromaticity component based on the first set of filter coefficients, includes: Based on the first set of filter coefficients and the third filter information, the reconstruction block loop of the first chromaticity component is filtered, and based on the first set of filter coefficients and the third filter information, the reconstruction block loop of the second chromaticity component is filtered. The third filtering information includes any one of the following: a reconstructed block of the luminance component of the current block, a residual block of the luminance component of the current block, and a reconstructed block of the adjacent chrominance components of the chrominance component of the current block.

24. The method of any one of claims 13-23, wherein, The determination of the first set of filter coefficients includes: The first covariance matrix is ​​determined based on the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component; The first error vector is determined based on the error vector of the first chromaticity component and the error vector of the second chromaticity component; The first set of filter coefficients is determined based on the first covariance matrix and the first error vector.

25. The method of claim 24, wherein, The step of determining the first set of filter coefficients based on the first covariance matrix and the first error vector includes: Based on the first covariance matrix and the first error vector, determine the second set of filter coefficients; Calculate a first total distortion cost, a second total distortion cost, and a third total distortion cost; wherein, the first total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a third set of filter coefficients, the third set of filter coefficients being the set of filter coefficients for the first chromaticity component; the second total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a fourth set of filter coefficients, the fourth set of filter coefficients being the set of filter coefficients for the second chromaticity component; the third total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a second set of filter coefficients; The first set of filter coefficients is determined based on the first total distortion cost, the second total distortion cost, and the third total distortion cost.

26. The method of claim 25, wherein, The method further includes: Calculate the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost. The first rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients of the first chromaticity component. The second rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients of the second chromaticity component. The third rate-distortion cost is the rate-distortion cost of the first chromaticity component under the second set of filter coefficients. The third set of filter coefficients is determined based on the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost.

27. The method of claim 25, wherein, The method further includes: Calculate the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost, wherein the fourth rate distortion cost is the rate distortion cost of the second chromaticity component under the initial filter coefficient set of the first chromaticity component, the fifth rate distortion cost is the rate distortion cost of the second chromaticity component under the initial filter coefficient set of the second chromaticity component, and the sixth rate distortion cost is the rate distortion cost of the second chromaticity component under the second filter coefficient set; The fourth set of filter coefficients is determined based on the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost.

28. The method of any one of claims 25-27, wherein, The method further includes: If the cost of seventh rate distortion is less than the sum of the costs of eighth and ninth rate distortion, it is determined that the same set of filter coefficients should be used for in-loop filtering of the first chromaticity component and the second chromaticity component. Wherein, the seventh rate distortion cost is the minimum of the first total rate distortion cost, the second total rate distortion cost, and the third total rate distortion cost; the eighth rate distortion cost is the minimum of the rate distortion cost when the first chroma component is not filtered and the tenth rate distortion cost, the tenth rate distortion cost is the minimum of the rate distortion cost of the first chroma component under the filter coefficient set of the reconstructed block and the rate distortion cost of the first chroma component under the third filter coefficient set; the ninth rate distortion cost is the minimum of the rate distortion cost when the second chroma component is not filtered and the eleventh rate distortion cost, the eleventh rate distortion cost is the minimum of the rate distortion cost of the second chroma component under the filter coefficient set of the reconstructed block and the rate distortion cost of the second chroma component under the fourth filter coefficient set.

29. The method of any one of claims 13-28, wherein, The first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

30. A decoding apparatus, comprising: include: Analysis module and filtering module; The parsing module is used to parse the bitstream to obtain the first set of filter coefficients; The filtering module is used to perform intra-block filtering of the reconstruction block of the first chromaticity component based on the first set of filtering coefficients obtained by the analysis module, and to perform intra-block filtering of the reconstruction block of the second chromaticity component based on the first set of filtering coefficients obtained by the analysis module.

31. The apparatus of claim 30, wherein, The parsing module is specifically used for: Parse the first syntax element in the bitstream to obtain the Adaptive Parameter Set (APS) index. The APS index is used to indicate the first APS in the bitstream. The first APS includes at least one set of filter coefficients. The set of filter coefficients includes N sets of filter coefficients. The first set of filter coefficients is one of the at least one set of filter coefficients, and N is a positive integer.

32. The apparatus of claim 31, wherein, The parsing module is also used to obtain N sets of filter coefficients in the first set of filter coefficients based on parsing the second syntax element in the first APS. The filter coefficient set for the loop filtering of the first chromaticity component and the second chromaticity component is the same set of filter coefficients among the N sets of filter coefficients in the first filter coefficient set.

33. The apparatus of claim 31, wherein, The parsing module is also used for: Parse the second syntax element in the first APS to obtain the absolute value of the exponent and the sign of the exponent; Based on the absolute value of the power exponent and the sign of the power exponent, N sets of filter coefficients are obtained in the first set of filter coefficients.

34. The apparatus of claim 31, wherein, The parsing module is further configured to parse the third syntax element in the bitstream to obtain first identification information. The first identification information is used to indicate a first index, and the first index is used to indicate the filter coefficient group for the in-ring filtering of the first chroma component of the coding tree unit (CTU).

35. The apparatus of claim 31, wherein, The parsing module is further configured to parse the fourth syntax element in the bitstream to obtain second identification information. The second identification information is used to indicate a second index, which is used to indicate the filter coefficient group for the second chromaticity component loop filtering of the CTU.

36. The apparatus of claim 32, wherein, The parsing module is further configured to parse the fifth syntax element in the bitstream to obtain first indication information. The first indication information is used to indicate whether the same set of filtering coefficients is used to filter the first chromaticity component and the second chromaticity component of the CTU within the loop.

37. The device of claim 36, wherein, The parsing module is further configured to parse the sixth syntax element in the bitstream to obtain third identification information. The third identification information is used to indicate a third index, which is used to indicate the filter coefficient group for the in-loop filtering of the first chroma component and the second chroma component of the CTU.

38. The apparatus of claim 30, wherein, The parsing module is further configured to parse the seventh syntax element in the bitstream to obtain second indication information, which indicates whether the same set of filtering coefficients is used to filter the first chroma component and the second chroma component within the loop.

39. The apparatus of any one of claims 30-38, wherein, The filtering module is specifically used to filter the reconstruction block loop of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and to filter the reconstruction block loop of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component. Wherein, the first filter coefficient group and the second filter coefficient group are the same group of filter coefficients in the first filter coefficient set; or, the first filter coefficient group and the second filter coefficient group are different groups of filter coefficients in the first filter coefficient set; the first filter information and the second filter information are both information from the pre-stage filter output of the in-loop filter.

40. The apparatus of any one of claims 30-39, wherein, The filtering module is specifically used to perform intra-block filtering of the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and to perform intra-block filtering of the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information. The third filtering information includes any one of the following: a reconstructed block of the luminance component of the current block, a residual block of the luminance component of the current block, and a reconstructed block of the adjacent chrominance components of the chrominance component of the current block.

41. The apparatus of any one of claims 30-40, wherein, The first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

42. An encoding device, comprising: include: Filtering module and encoding module; The filtering module is used to determine the first set of filtering coefficients; And, based on the first set of filter coefficients, the reconstruction block loop of the first chromaticity component is filtered, and based on the first set of filter coefficients, the reconstruction block loop of the second chromaticity component is filtered; The encoding module is used to write the first set of filtering coefficients obtained by the filtering module into the bitstream.

43. The device of claim 42, wherein, The encoding module is further configured to write a first syntax element into the bitstream, the first syntax element being used to characterize an adaptive parameter set (APS) index, the APS index being used to indicate a first APS in the bitstream, the first APS including at least one set of filter coefficients, the set of filter coefficients including N sets of filter coefficients, the first set of filter coefficients being one of the at least one set of filter coefficients, and N being a positive integer.

44. The device of claim 43, wherein, The encoding module is further configured to write a second syntax element into the first APS, wherein the second syntax element is used to characterize N sets of filter coefficients in the first set of filter coefficients. The filter coefficient set for the loop filtering of the first chromaticity component and the second chromaticity component is the same set of filter coefficients among the N sets of filter coefficients in the first filter coefficient set.

45. The device of claim 43, wherein, The encoding module is further configured to write a second syntax element into the first APS, wherein the second syntax element is used to characterize the absolute value of the power exponent and the sign of the power exponent, and the absolute value of the power exponent and the sign of the power exponent are used to determine N sets of filter coefficients in the first set of filter coefficients.

46. The device of claim 43, wherein, The encoding module is further configured to write a third syntax element into the bitstream, the third syntax element being used to characterize first identification information, the first identification information being used to indicate a first index, and the first index being used to indicate a set of filtering coefficients for filtering the first chroma component within the loop of the coding tree unit (CTU).

47. The device of claim 43, wherein, The encoding module is further configured to write a fourth syntax element into the bitstream, the fourth syntax element being used to characterize second identification information, the second identification information being used to indicate a second index, and the second index being used to indicate a set of filter coefficients for the second chromaticity component loop filtering of the CTU.

48. The device of claim 44, wherein, The encoding module is further configured to write a fifth syntax element into the bitstream, the fifth syntax element being used to characterize first indication information, the first indication information being used to indicate whether the same set of filtering coefficients is used for in-loop filtering of the first chromaticity component and the second chromaticity component of the CTU.

49. The device of claim 48, wherein, The encoding module is further configured to write a sixth syntax element into the bitstream, the sixth syntax element being used to characterize third identification information, the third identification information being used to indicate a third index, and the third index being used to indicate a set of filter coefficients for in-loop filtering of the first chromaticity component and the second chromaticity component of the CTU.

50. The device of claim 42, wherein, The encoding module is further configured to write a seventh syntax element into the bitstream, the seventh syntax element being used to characterize second indication information, the second indication information being used to indicate whether the same set of filtering coefficients is used to filter the first chroma component and the second chroma component within the loop.

51. The apparatus of any one of claims 42-50, wherein, The filtering module is specifically used to filter the reconstruction block loop of the first chromaticity component based on the first filtering coefficient group and the first filtering information of the first chromaticity component, and to filter the reconstruction block loop of the second chromaticity component based on the second filtering coefficient group and the second filtering information of the second chromaticity component. Wherein, the first filter coefficient group and the second filter coefficient group are the same group of filter coefficients in the first filter coefficient set; or, the first filter coefficient group and the second filter coefficient group are different groups of filter coefficients in the first filter coefficient set; the first filter information and the second filter information are both information from the pre-stage filter output of the in-loop filter.

52. The apparatus of any one of claims 42-51, wherein, The filtering module is specifically used to perform intra-block filtering of the reconstruction block of the first chromaticity component based on the first set of filtering coefficients and the third filtering information, and to perform intra-block filtering of the reconstruction block of the second chromaticity component based on the first set of filtering coefficients and the third filtering information. The third filtering information includes any one of the following: a reconstructed block of the luminance component of the current block, a residual block of the luminance component of the current block, and a reconstructed block of the adjacent chrominance components of the chrominance component of the current block.

53. The apparatus of any one of claims 42-52, wherein, The filtering module is specifically used for: The first covariance matrix is ​​determined based on the covariance matrix of the first chromaticity component and the covariance matrix of the second chromaticity component; The first error vector is determined based on the error vector of the first chromaticity component and the error vector of the second chromaticity component; The first set of filter coefficients is determined based on the first covariance matrix and the first error vector.

54. The device of claim 53, wherein, The filtering module is specifically used for: Based on the first covariance matrix and the first error vector, determine the second set of filter coefficients; Calculate a first total distortion cost, a second total distortion cost, and a third total distortion cost; wherein, the first total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a third set of filter coefficients, the third set of filter coefficients being the set of filter coefficients for the first chromaticity component; the second total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a fourth set of filter coefficients, the fourth set of filter coefficients being the set of filter coefficients for the second chromaticity component; the third total distortion cost is the total distortion cost of the first chromaticity component and the second chromaticity component under a second set of filter coefficients; The first set of filter coefficients is determined based on the first total distortion cost, the second total distortion cost, and the third total distortion cost.

55. The device of claim 54, wherein, The filtering module is also used for: Calculate the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost. The first rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients of the first chromaticity component. The second rate-distortion cost is the rate-distortion cost of the first chromaticity component under the initial set of filter coefficients of the second chromaticity component. The third rate-distortion cost is the rate-distortion cost of the first chromaticity component under the second set of filter coefficients. The third set of filter coefficients is determined based on the first rate-distortion cost, the second rate-distortion cost, and the third rate-distortion cost.

56. The device of claim 54, wherein, The filtering module is also used for: Calculate the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost, wherein the fourth rate distortion cost is the rate distortion cost of the second chromaticity component under the initial filter coefficient set of the first chromaticity component, the fifth rate distortion cost is the rate distortion cost of the second chromaticity component under the initial filter coefficient set of the second chromaticity component, and the sixth rate distortion cost is the rate distortion cost of the second chromaticity component under the second filter coefficient set; The fourth set of filter coefficients is determined based on the fourth rate distortion cost, the fifth rate distortion cost, and the sixth rate distortion cost.

57. The apparatus of any one of claims 54-56, wherein, The filtering module is further configured to determine, when the cost of the seventh rate distortion is less than the sum of the costs of the eighth and ninth rate distortions, to use the same set of filtering coefficients to filter the first chromaticity component and the second chromaticity component within the loop. Wherein, the seventh rate distortion cost is the minimum of the first total rate distortion cost, the second total rate distortion cost, and the third total rate distortion cost; the eighth rate distortion cost is the minimum of the rate distortion cost when the first chroma component is not filtered and the tenth rate distortion cost, the tenth rate distortion cost is the minimum of the rate distortion cost of the first chroma component under the filter coefficient set of the reconstructed block and the rate distortion cost of the first chroma component under the third filter coefficient set; the ninth rate distortion cost is the minimum of the rate distortion cost when the second chroma component is not filtered and the eleventh rate distortion cost, the eleventh rate distortion cost is the minimum of the rate distortion cost of the second chroma component under the filter coefficient set of the reconstructed block and the rate distortion cost of the second chroma component under the fourth filter coefficient set.

58. The apparatus of any one of claims 42-57, wherein, The first chromaticity component is the Cb component, and the second chromaticity component is the Cr component.

59. A decoder, comprising: include: A memory and a processor, wherein the memory is used to store executable data instructions, and the processor is used to implement the decoding method as described in any one of claims 1 to 12 when executing the executable instructions stored in the memory.

60. An encoder comprising: include: A memory and a processor, wherein the memory is used to store executable data instructions, and the processor is used to implement the encoding method as described in any one of claims 13 to 29 when executing the executable instructions stored in the memory.

61. A computer storage medium, comprising, The computer storage medium is used to store the bitstream generated by the encoding method as described in any one of claims 13 to 29.

62. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by at least one processor, implements the decoding method as described in any one of claims 1 to 12, or the encoding method as described in any one of claims 13 to 29.

63. A computer program product, characterized in that, It includes computer program instructions, which, when executed, implement the decoding method as described in any one of claims 1 to 12, or the encoding method as described in any one of claims 13 to 29.

Citation Information

Patent Citations

  • Loop filtering method and device

    CN112514401A

  • Video encoding and decoding method and device, and storage medium

    CN114097236A

  • Cross-component adaptive loop filtering for video coding

    CN114258675A

  • Bit shifting for cross-component adaptive loop filtering for video coding

    CN114402620A

  • Systems and methods for applying adaptive loop filters in video coding

    CN114793284A