Coding and decoding methods, code stream, encoder, decoder, and storage medium

Through the method of adaptively determining the filter coefficient and type parameters, the problem that filter coefficient processing cannot take into account both bit overhead and accuracy is solved, and the encoding efficiency and compression performance of video encoding are improved.

WO2025152089A1PCT designated stage expired Publication Date: 2025-07-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/072891
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-01-17
Publication Date
2025-07-24

AI Technical Summary

Technical Problem

In the prior art, the filter coefficient processing in video encoding cannot take into account both bit overhead and filtering accuracy, resulting in a degradation of encoding and decoding efficiency and compression performance.

Method used

Adaptive filter coefficient representation method is adopted to adaptively determine the filter coefficient and type parameters at the encoding end, and write the filter identification information to the code stream, and analyze the filter coefficients according to the type parameters at the decoding end to realize flexible filtering processing.

Benefits of technology

Improves encoding efficiency and compression performance, and obtains a more ideal filtering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024072891_24072025_PF_FP_ABST
    Figure CN2024072891_24072025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a coding and decoding method. At a decoding end, decoding a code stream and determining filtering identification information; if, based on the filtering identification information, it is determined that a current image component of a current image is filtered using a first filter, determining a filtering coefficient type parameter corresponding to the current image component; based on the filtering coefficient type parameter, determining a filtering coefficient corresponding to the current image component; and, based on the filtering coefficient, determining a reconstructed block of a current block in the current image.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] In Versatile Video Coding (VVC), the in-loop filter includes an adaptive loop filter (ALF) and a cross-component adaptive loop filter (CCALF). The ALF is a filter designed to minimize the mean square error between the reconstructed image and the original image, and the CCALF is a filter designed to use luminance information to minimize the mean square error between the chrominance reconstructed image and the original image.

[0003] During the filtering process, in order to solve the problem of large encoding and decoding bit overhead caused by floating-point filter coefficients, a scale factor is introduced to realize integer processing of the filter coefficients.

[0004] However, the processing process of the filter coefficients in common technologies cannot take into account both bit overhead and filtering accuracy, and thus cannot obtain a more ideal filtering effect, thereby reducing coding efficiency and compression performance.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can effectively improve coding and decoding efficiency and enhance compression performance.

[0007] The technical solution of the embodiment of the present application can be implemented as follows:

[0008] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0009] Decode the code stream and determine the filter identification information;

[0010] In a case where it is determined based on the filter identification information that a first filter is used to filter a current image component of the current image, determining a filter coefficient type parameter corresponding to the current image component;

[0011] Determining the filter coefficient corresponding to the current image component according to the filter coefficient type parameter;

[0012] A reconstructed block of a current block in the current image is determined according to the filter coefficients.

[0013] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0014] Adaptively determining a filter coefficient and a filter coefficient type parameter corresponding to a current image component of a current image;

[0015] Determining filter identification information based on the filter coefficient, and writing the filter identification information into a bitstream; wherein the filter identification information is used to determine whether to use a first filter to filter the current image component of the current image;

[0016] In a case where it is determined to use the first filter to filter the current image component of the current image, the filter coefficient and the filter coefficient type parameter are written into a code stream.

[0017] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on the information to be encoded; wherein the information to be encoded includes at least: filter identification information, the filter coefficient corresponding to the current image component of the current image, the filter coefficient type parameter corresponding to the current image component, third identification information, fourth identification information, the APS index corresponding to the current image, and the APS unit corresponding to the current image.

[0018] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit; wherein,

[0019] The first determination unit is configured to adaptively determine a filter coefficient and a filter coefficient type parameter corresponding to a current image component of a current image; determine filter identification information based on the filter coefficient, and write the filter identification information into a bitstream; wherein the filter identification information is used to determine whether to use a first filter to filter the current image component of the current image; and if it is determined that the first filter is to be used to filter the current image component of the current image, write the filter coefficient and the filter coefficient type parameter into the bitstream.

[0020] In a fifth aspect, an embodiment of the present application provides an encoder, the encoder including a first memory and a first processor; wherein,

[0021] The first memory is used to store a computer program that can be run on the first processor;

[0022] The first processor is configured to execute the encoding method described above when running the computer program.

[0023] In a sixth aspect, an embodiment of the present application provides a decoder, the decoder including a second determining unit; wherein,

[0024] The second determination unit is configured to decode the code stream and determine the filter identification information; when it is determined based on the filter identification information that the current image component of the current image is filtered using the first filter, determine the filter coefficient type parameter corresponding to the current image component; determine the filter coefficient corresponding to the current image component according to the filter coefficient type parameter; and determine a reconstructed block of the current block in the current image according to the filter coefficient.

[0025] In a seventh aspect, an embodiment of the present application provides a decoder, the decoder including a second memory and a second processor; wherein,

[0026] The second memory is used to store a computer program that can be run on the second processor;

[0027] The second processor is configured to execute the above-mentioned decoding method when running the computer program.

[0028] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the decoding method as described in the first aspect, or implements the encoding method as described in the second aspect.

[0029] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. At the decoding end, the code stream is decoded to determine filter identification information; when it is determined based on the filter identification information that a first filter is used to filter a current image component of a current image, a filter coefficient type parameter corresponding to the current image component is determined; the filter coefficient corresponding to the current image component is determined based on the filter coefficient type parameter; and a reconstructed block of a current block in the current image is determined based on the filter coefficient. At the encoding end, the filter coefficient and filter coefficient type parameter corresponding to the current image component of the current image are adaptively determined; filter identification information is determined based on the filter coefficient, and the filter identification information is written into the code stream; wherein the filter identification information is used to determine whether the first filter is used to filter the current image component of the current image; when it is determined that the first filter is used to filter the current image component of the current image, the filter coefficient and filter coefficient type parameter are written into the code stream. That is to say, in an embodiment of the present application, an adaptive method can be used to represent the ALF and CCALF filter coefficients to determine the representation form of the filter coefficients, and the filter coefficient type parameters indicating the representation form of the filter coefficients are transmitted to the decoding end, so that the corresponding filter coefficients can be adaptively parsed at the decoding end through the filter coefficient type parameters, thereby increasing the flexibility of encoding, thereby obtaining a more ideal filtering effect, improving encoding efficiency, and enhancing compression performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] FIG1 is a schematic diagram of an application of a coding framework provided by related art;

[0031] Figure 2 is a schematic diagram of the shape of a common CCALF filter;

[0032] FIG3 is a schematic diagram of the shape of a common CCALF filter;

[0033] FIG4 is a schematic block diagram of a video encoding system according to an embodiment of the present application;

[0034] FIG5 is a schematic block diagram of a video decoding system according to an embodiment of the present application;

[0035] FIG6 is a first schematic diagram of a decoding method proposed in an embodiment of the present application;

[0036] FIG7 is a first test result of the decoding method proposed in an embodiment of the present application;

[0037] FIG8 is a second test result of the decoding method proposed in an embodiment of the present application;

[0038] FIG9 is a first schematic diagram of the encoding method proposed in an embodiment of the present application;

[0039] FIG10 is a schematic diagram of the structure of an encoder according to an embodiment of the present application;

[0040] FIG11 is a schematic diagram of the specific hardware structure of the encoder proposed in an embodiment of the present application;

[0041] FIG12 is a schematic diagram of the structure of a decoder according to an embodiment of the present application;

[0042] FIG13 is a schematic diagram of the specific hardware structure of the decoder proposed in an embodiment of the present application;

[0043] FIG14 is a schematic diagram of the composition structure of the encoding and decoding system proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the related applications and are not intended to limit the applications. It should also be noted that for ease of description, only the parts relevant to the related applications are shown in the drawings.

[0045] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0046] Digital video compression technology primarily compresses massive amounts of digital video data for easier transmission and storage. With the surge in Internet video usage and increasing demand for higher-quality video, while existing digital video compression standards can save significant amounts of video data, there is still a need for better digital video compression technologies to reduce bandwidth and traffic pressures associated with digital video transmission.

[0047] During digital video encoding, the encoder reads unequal pixels from the original video sequence in different color formats, including the luminance and chrominance components. In other words, the encoder reads a black and white or color image. It then divides the image into blocks and passes the block data to the encoder for encoding.

[0048] Common video codec standards all use a block-based hybrid coding framework. Each frame is divided into square Largest Coding Units (LCUs) or Coding Tree Units (CTUs) of the same size (e.g., 128×128, 64×64, etc.). Each LCU or CTU can be further divided into rectangular Coding Units (CUs) based on rules. Coding Units may also be further divided into smaller Prediction Units (PUs) and Transform Units (TUs), etc.

[0049] FIG1 is a schematic diagram of an application of a coding framework provided by related art. As shown in FIG1 , a hybrid coding framework may include a prediction module 11, a transform and quantization module 12, an entropy coding module 13, an inverse quantization and inverse transform module 14, a loop filter module 15, and a decoded picture cache module 16. The prediction module 11 may include an intra-frame prediction module 11a and an inter-frame prediction module 11b. The inter-frame prediction module 11b may include a motion estimation module and a motion compensation module. Since there is a strong correlation between adjacent pixels within a frame of a video image, the use of an intra-frame prediction method in video coding and decoding technology can eliminate spatial redundancy between adjacent pixels. However, since there is also a strong similarity between adjacent frames in a video image, the use of an inter-frame prediction method in video coding and decoding technology can eliminate temporal redundancy between adjacent frames, thereby improving coding and decoding efficiency. The basic process of a video codec is as follows: On the encoder side, a frame is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a predicted block for the current block. The predicted block is subtracted from the original block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​entropy encoded and output to the bitstream. On the decoder side, intra-frame prediction or inter-frame prediction is used on the current block to generate a predicted block for the current block. The decoded bitstream is then decoded to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​inversely quantized and inversely transformed to obtain a residual block. The predicted block and residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain the decoded image. The encoder side also performs similar operations to the decoder side to obtain the decoded image. The decoded image can serve as a reference frame for inter-frame prediction in subsequent frames. Block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoder are output to the bitstream if necessary. The decoding end determines the same block division information as the encoding end by parsing and analyzing the existing information, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is also usually called a reconstructed image. The current block can be divided into prediction units during prediction, and can be divided into transformation units during transformation. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.

[0050] It can be understood that intra-frame prediction only refers to the information of the same frame image, predicts the pixel information within the current partition block, and is used to eliminate spatial redundancy; inter-frame prediction can refer to the image information of different frames, and use motion estimation to search for the motion vector information that best matches the current partition block, which is used to eliminate temporal redundancy; the transformation converts the predicted image block into the frequency domain, redistributes the energy, and combines quantization to remove information that the human eye is not sensitive to, which is used to eliminate visual redundancy; entropy coding can eliminate character redundancy based on the current context model and the probability information of the binary code stream; loop filtering mainly processes the pixels after inverse transformation and inverse quantization to compensate for the distortion information and provide a better reference for subsequent encoded pixels.

[0051] In Versatile Video Coding (VVC), the in-loop filter mainly includes luminance mapping and chroma scaling, deblocking filter (DBF), sample adaptive offset (SAO), adaptive loop filter (ALF) and cross-component adaptive loop filter (CCALF).

[0052] In the latest standard VVC and the JVET traditional video coding exploration platform reference software test model (Enhanced Compression Model, ECM), the adaptive loop filter (ALF) is a filter designed to minimize the mean square error between the reconstructed image and the original image.

[0053] In the ECM encoder, the adaptive loop filter (hereinafter referred to as ALF) processes the luminance component and the chrominance component separately, with each component having its own filter.

[0054] There are fixed filter banks, filter banks in APS, and new filter banks for the luminance component. The processing steps for the luminance component are as follows:

[0055] Step 1: Divide the luminance component into several blocks of 2x2, and these blocks do not overlap with each other.

[0056] Step 2: Calculate the category information 1 of each 2x2 block in step 1. Category information 1 is used to determine the corresponding fixed filter.

[0057] Step 3: After calculating the category information 1 of all blocks in step 1, select a corresponding fixed filter according to the category information 1 to filter the pixels and residuals in the 2x2 block.

[0058] Step 4: Perform Gaussian filtering on the pixel luminance component before Deblocking.

[0059] Step 5: Calculate the class information 2 for each 2x2 block in Step 1. The class information 2 is used to determine the corresponding fixed filter.

[0060] Step 6: After calculating the class information 2 for all blocks in Step 1, select the corresponding fixed filter according to the class information 2 to filter the 2x2 block. Here, for this filtering, the input information is the filtering output in Step 3.

[0061] Step 7: Calculate the covariance matrix and error vector of each pixel luminance component.

[0062] Step 8: Calculate the class information 3, class information 4, and class information 5 for each 2x2 block in Step 1. The class information 3 - 5 is used to determine the new filter bank class division method.

[0063] Step 9: Divide a frame of image into several regions, and the minimum unit of each region is a coding tree unit (hereinafter referred to as CTU).

[0064] Step 10: For each region, respectively, under the class information 3 - 5, accumulate the covariance matrix and error vector of the same - class pixel luminance components in the same class information, then construct the Wiener - Hopf equation, and calculate the filter coefficients of this class in this class information by solving the equation. The filter coefficients are of floating - point type.

[0065] Step 11: Multiply each filter coefficient by a fixed scaling factor 1<<bitShift, where bitShift takes the value of 7. Then round the filter coefficients to convert them into integers.

[0066] Step 12: Parse the corresponding luminance component filter information from the available APS. The luminance component filter information includes: the number of region divisions, the number of filters in each region, the integer - type coefficients of each filter, and the class division method used in each region, etc. Information is collectively referred to as filter information hereinafter.

[0067] Step 13, determine the filter index used for each CTU luminance component. Calculate the rate-distortion cost 1 when the CTU luminance component is filtered using the fixed filter for the first time according to step 3. Calculate the rate-distortion cost 2 when the CTU luminance component is filtered using the fixed filter for the second time according to step 7. Use the filter information parsed in step 12 to filter the current CTU luminance component and calculate the corresponding rate-distortion cost 3. Calculate the rate-distortion cost 4 when the CTU luminance component is filtered using the new filter. If the rate-distortion cost 1 is the smallest, the current CTU luminance component is filtered using the fixed filter for the first time. If the rate-distortion cost 2 is the smallest, the current CTU luminance component is filtered using the fixed filter for the second time. If the rate-distortion cost 3 is the smallest, the current CTU luminance component is filtered using the filter in the APS. Otherwise, the CTU luminance component is filtered using the new filter.

[0068] Step 14: Determine whether to filter the luminance component of each CTU. Calculate the rate-distortion cost 4 when the luminance component of the current CTU is not filtered and compare it with the minimum rate-distortion cost determined in step 13. If the rate-distortion cost 4 is smaller, then the luminance component of the current CTU does not undergo ALF filtering. Otherwise, the luminance component of the current CTU undergoes ALF filtering.

[0069] Step 15: Determine the rate-distortion cost of the luma component of the current frame. Calculate the rate-distortion cost of the current frame based on the CTU luma component filtering information and the corresponding luma component filter information. The CTU luma component filtering information includes whether each CTU luma component uses ALF filtering and the filter index when using ALF filtering. This information is collectively referred to as CTU luma component filtering information.

[0070] Step 16: Determine the optimal state information for the luma component of the current frame. Update the CTU luma component filter information and luma component filter information, and repeat steps 9 to 15. Select the set of CTU luma component filter information and luma component filter information that minimizes the current frame rate-distortion cost as the optimal state information for the luma component of the current frame. The minimum rate-distortion cost is recorded as 5.

[0071] Step 17: Determine whether the luminance component of the current frame is filtered using ALF. Calculate the rate-distortion cost 6 of the luminance component of the current frame when it is not filtered using ALF and compare it with the rate-distortion cost 5 calculated in step 16. If the rate-distortion cost 5 is less than the rate-distortion cost 6, the luminance component of the current frame is filtered using ALF. Otherwise, the luminance component of the current frame is not filtered using ALF.

[0072] Step 18: If the luminance component of the current frame is filtered using ALF, the luminance component of the current frame is filtered using the corresponding CTU luminance component filtering information and the luminance component filter information.

[0073] Step Nineteen: Determine whether the luminance component of the current frame uses a new filter. If there is information indicating that the CTU luminance component is filtered using a new filter in the CTU luminance component filtering information, the luminance component of the current frame will use the new filter. Otherwise, the luminance component of the current frame does not use the new filter.

[0074] Step Twenty: Write the CTU luminance component filtering information, the APS ID to be used, and the luminance component filter information into the code stream.

[0075] There are filter banks and new filter banks in the APS for the chrominance component. The processing steps are as follows:

[0076] Step One: Calculate the covariance matrix and error vector of each pixel's chrominance component.

[0077] Step Two: Divide an image frame into several regions, and the smallest unit of each region is a CTU.

[0078] Step Three: For each region, accumulate the covariance matrices and error vectors of all pixel chrominance components respectively, and then construct the Wiener-Hopf equation. Calculate the filter coefficients of this region by solving the equation. The filter coefficients are of floating-point type.

[0079] Step Four: Multiply each filter coefficient by a fixed scaling factor 1<<bitShift, where the value of bitShift is 7. Then round the filter coefficient to convert it into an integer.

[0080] Step Five: Determine the filter index used by each CTU chrominance component. According to the chrominance component filter information obtained in Steps Three and Four, the CTU chrominance component is filtered under each filter, and the corresponding rate-distortion cost is calculated. Select the filter index with the minimum rate-distortion cost as the filter index of the current CTU chrominance component. The chrominance component filter information includes: the number of filters and the integerized coefficients of each filter, etc. Collectively referred to as chrominance component filter information later.

[0081] Step Six: Determine whether each CTU chrominance component is filtered. Calculate the rate-distortion cost 1 when the current CTU chrominance component is not filtered, and compare it with the minimum rate-distortion cost determined in Step Five. If the rate-distortion cost 1 is smaller, the current CTU chrominance component does not perform ALF filtering. Otherwise, the current CTU chrominance component will perform ALF filtering.

[0082] Step 7: Determine the rate-distortion cost of the chroma component of the current frame. The rate-distortion cost of the current frame is calculated based on the CTU chroma component filtering information and the corresponding chroma component filter information. The CTU chroma component filtering information includes whether each CTU chroma component is filtered using ALF and the filter index when using ALF filtering. This is collectively referred to as CTU chroma component filtering information.

[0083] Step 8: Determine the optimal state information for the chroma components of the current frame. Update the CTU chroma component filter information and chroma component filter information, and repeat steps 2 to 7. Select the set of CTU chroma component filter information and chroma component filter information that minimizes the current frame rate-distortion cost as the optimal state information for the chroma components of the current frame. The minimum rate-distortion cost is denoted as rate-distortion cost 2.

[0084] Step nine: parse the corresponding chrominance component filter information from the available APS.

[0085] Step 10: Determine the rate-distortion cost 3 of the APS filter bank for the chroma pixels of the current frame. Filter the current frame using the chroma component filter information obtained from the APS, and calculate the corresponding rate-distortion cost 3.

[0086] Step 11: Determine whether the new filter should be used for the chrominance component of the current frame. Compare the rate-distortion cost 2 from step 8 with the filter cost 3 from step 10. If rate-distortion cost 2 is less than rate-distortion cost 3, the new filter should be used for the chrominance component of the current frame. Otherwise, the new filter should not be used for the chrominance component of the current frame. The smaller of rate-distortion cost 2 and rate-distortion cost 3 is denoted as rate-distortion cost 4.

[0087] Step 12: Determine whether ALF filtering is used for the chroma components of the current frame. Calculate the rate-distortion cost 5 when the chroma components of the current frame do not use ALF and compare it with the rate-distortion cost 4 in step 11. If the rate-distortion cost 4 is less than the rate-distortion cost 5, the chroma components of the current frame are filtered using ALF. Otherwise, the chroma components of the current frame are not filtered using ALF.

[0088] Step 13: If the chroma component of the current frame is filtered using ALF, the chroma component of the current frame is filtered using the corresponding CTU chroma component filtering information and the chroma component filter information.

[0089] Step 14: Write the CTU chroma component filtering information, the APS ID to be used, and the chroma component filter information into the bitstream.

[0090] Correspondingly, after receiving the bitstream at the ECM decoding end, the current frame luminance and chrominance ALF switches, CTU luminance and chrominance component filtering information, and luminance and chrominance component filter information are determined. In addition, the APS ID is parsed, and the corresponding APS is selected to determine the filter coefficients. And the pixels to be filtered are filtered.

[0091] In ECM, the cross-component adaptive loop filter (CCALF) is a filter designed to minimize the mean square error between the chrominance reconstructed image and the original image using luminance information.

[0092] In the ECM encoder, the cross-component adaptive loop filter (hereinafter referred to as CCALF) processes the chrominance components U and V separately, and each chrominance component has its own filter.

[0093] For each chrominance component, there are filter banks in the APS and new filter banks. The processing steps for the chrominance component are as follows:

[0094] Step 1, calculate the covariance matrix and error vector of the chrominance component of each pixel.

[0095] Step 2, divide an image frame into several regions, and the minimum unit of each region is a CTU.

[0096] Step 3, for each region, accumulate the covariance matrix and error vector of the chrominance component of all pixels in the region respectively, then construct the Wiener-Hopf equation, and calculate the filter coefficients of the region by solving the equation. The filter coefficients are floating-point type.

[0097] Step 4, multiply each filter coefficient by a fixed scale factor 1<<bitShift, where bitShift takes the value of 7. Then round the filter coefficients to convert them into integer numbers. Finally, map the integer coefficients to {0,±1,±2,±4,±8,±16,±32,±64} by rounding.

[0098] Step 5, determine the filter index used by the chrominance component of each CTU. According to the chrominance component filter information obtained in Steps 3 and 4, the chrominance component of the CTU is filtered under each filter, and the corresponding rate-distortion cost is calculated. Select the filter index with the minimum rate-distortion cost as the filter index of the chrominance component of the current CTU. The chrominance component filter information includes: information such as the number of filters and the integerized coefficients of each filter, etc. Hereinafter, it is collectively referred to as the chrominance component CCALF filter information.

[0099] Step 6: Determine whether to filter the chroma components of each CTU. Calculate the rate-distortion cost 1 when the chroma components of the current CTU are not filtered, and compare it with the minimum rate-distortion cost determined in step 5. If the rate-distortion cost 1 is smaller, then the chroma components of the current CTU are not filtered using CCALF. Otherwise, the chroma components of the current CTU are filtered using CCALF.

[0100] Step 7: Determine the rate-distortion cost of the chroma component of the current frame. The chroma component rate-distortion cost of the current frame is calculated based on the chroma component filtering information of the CTU and the corresponding CCALF filter information of the chroma component. The CTU chroma component filtering information includes whether the chroma component of each CTU is filtered using CCALF, and the filter index when CCALF filtering is used. This is hereinafter referred to as the CTU chroma component filtering information.

[0101] Step 8: Determine the optimal state information of the chroma components of the current frame. Update the chroma component filtering information and chroma component CCALF filter information of the CTU, and repeat steps 2 to 7. Select the set of chroma component filtering information and chroma component CCALF filter information of the CTU that has the lowest rate-distortion cost for the current frame as the optimal state information of the chroma components of the current frame. The lowest rate-distortion cost is denoted as rate-distortion cost 2.

[0102] Step nine: parse the available APS to obtain the corresponding chrominance component CCALF filter information.

[0103] Step 10: Determine the rate-distortion cost 3 of the chroma pixels in the current frame using the APS filter bank. Filter the current frame using the chroma component CCALF filter information obtained from the APS, and calculate the corresponding rate-distortion cost 3.

[0104] Step 11: Determine whether the new filter is used for the chrominance component of the current frame. Compare the rate-distortion cost 2 from step 8 with the filter cost 3 from step 10. If rate-distortion cost 2 is less than rate-distortion cost 3, the new filter is used for the chrominance component of the current frame. Otherwise, the new filter is not used for the chrominance component of the current frame. The smaller of rate-distortion cost 2 and rate-distortion cost 3 is denoted as rate-distortion cost 4.

[0105] Step 12: Determine whether CCALF filtering is used for the chroma components of the current frame. Calculate the rate-distortion cost 5 of the chroma components of the current frame when CCALF is not used, and compare it with the rate-distortion cost 4 in step 11. If the rate-distortion cost 4 is less than the rate-distortion cost 5, then CCALF is used for filtering the chroma components of the current frame. Otherwise, CCALF is not used for filtering the chroma components of the current frame.

[0106] Step 13: If the chroma component of the current frame is filtered using CCALF, the chroma component filtering information of the corresponding CTU and the chroma component CCALF filter information are used to filter the chroma component of the current frame.

[0107] Step 14: Write the chroma component filtering information of the CTU, the APS ID to be used, and the chroma component CCALF filter information into the bitstream.

[0108] Accordingly, after receiving the bitstream, the ECM decoder determines the current frame's chroma CCALF switch, the CTU's chroma component filtering information, and the chroma component CCALF filter information. Furthermore, it parses the APS ID, selects the corresponding APS, determines the filter coefficients, and then filters the pixels that require filtering.

[0109] In the VVC encoder, the cross-component adaptive loop filter processes the chrominance components U and V separately, and each component has its own filter. A maximum of four filters are allowed for each component, corresponding to four categories. CCALF classifies each CTU, and all pixels in the CTU belong to the same category. The covariance matrix and error vector of pixels in the same category are accumulated separately, and then the Wiener-Hopper equation is constructed, and the filter coefficients of the category are calculated by solving the equation. Each CTU will select the filter of the corresponding category for filtering, and the filtered result will be written into the reconstructed image. In addition, the filter coefficients need to be written into the APS, and the corresponding syntax elements need to be written into the bitstream through entropy coding.

[0110] Figure 2 shows the shape of a common CCALF filter. As shown in Figure 2, in VVC, CCALF uses adjacent luminance information to minimize the mean square error between the chrominance reconstructed image and the original image. The solid circles represent luminance pixels, and the grid circles represent chrominance pixels. The chrominance pixels at the center of the black frame are the chrominance pixels to be filtered, while the luminance pixels within the frame are input to the filter. You can see that there are eight luminance pixels within the frame, and their positions in the filter correspond to eight filter coefficients.

[0111] FIG3 is a schematic diagram of the filter coefficients. In FIG3 , 0, 1, 2, 3, 4, 5, 6, and x represent the filter coefficient indexes. It should be noted that the coefficient at x is generally not calculated and is 0 by default.

[0112] In the VVC encoder, CCALF classifies CTUs, and the classification process uses the rate-distortion optimization function (RDO) to make decisions. Every pixel in the CTU belongs to the same category. Specifically, when the cost (Cost) calculated by the CTU using a filter of a certain category is the smallest, the category of the CTU is the category of the filter. Of course, if the cost of not filtering is less than the cost of using the filter, the CTU is not filtered. At this time, the CTU has no category. Whether the CTU is filtered and the corresponding category information will be written into the bitstream and transmitted to the decoding end.

[0113] After determining the category of each CTU, the covariance matrix and error vector of all pixels in the same category are accumulated. Specifically, for each pixel, its covariance matrix A is a 7x7 square matrix. Each element of the matrix A is a i,j , where i,j∈[0,1,2,3,4,5,6], for a i,j , whose value is: a i,j =R(i)×R(j) (1)

[0114] The value of R(i) is: R(i)=recY(i)-recY(x) (2)

[0115] Where recY(*) represents the brightness reconstructed pixel output by the previous module, x corresponds to the position x in the filter shape, and i is the pixel at a non-x position.

[0116] The error vector B is a 7x1 vector. Each element in vector B is b i , where i∈[0,1,2,3,4,5,6], for bi, its value is: b i =R(i)×E (3)

[0117] The meaning of R(i) is the same as above. For E, we have: E=orgC-recC (4)

[0118] Wherein, recC is the reconstructed pixel value of the pixel to be filtered, and orgC is the original pixel value of the pixel to be filtered.

[0119] After obtaining the covariance matrix A and error vector B for each pixel, sum the covariance matrices and error vectors for pixels of the same category within a frame. This constructs the Wiener-Hopper equation Ac = B, where A is the sum of the covariance matrices for pixels of the same category, and B is the sum of the error vectors for pixels of the same category. The coefficient c for this category needs to be solved, where c is a 7x1 vector.

[0120] It should be noted that the filter coefficients obtained by solving the equation are all floating-point types. Since the range of floating-point numbers is almost unlimited, it takes a lot of bits to encode the coefficients. To solve this problem, the VVC encoder integerizes the filter coefficients. First, the filter coefficients are scaled: c′ i =2 scale ×c i (5)

[0121] Among them, c i is the filter coefficient for solving the Wiener-Hopper equation, and scale is the scale factor, which is set to a fixed value of 7 in VVC. i is the value after scaling. i After that, for c′ i Look up the table and compare it to c′ in {-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64} i The nearest number is used as the integer coefficient

[0122] After obtaining the integer filter coefficient c f After that, the pixels need to be filtered. The filtering process is as follows:

[0123] Where recC′ is the coefficient after filtering. The meanings of values ​​such as recY(i), recY(x), and scale have been explained above and will not be repeated here. After filtering pixels that require filtering, they are written to the reconstructed image. Pixels that do not require filtering are directly written to the reconstructed image.

[0124] In addition, relevant syntax elements need to be written into the bitstream. For example, information about whether the current image's CCALF is enabled, whether each CTU is filtered, and the corresponding filter type information needs to be written into the APS if a new filter is needed. Finally, the APS ID used for the frame is written into the slice header or picture header.

[0125] After receiving the bitstream, the VVC decoder determines whether the current image's CCALF is enabled, whether each CTU is filtered, and the corresponding category information. Furthermore, the decoder parses the APS ID and selects the corresponding APS to determine the filter coefficients. Pixels requiring filtering are filtered and written to the reconstructed image. Pixels not requiring filtering are written directly to the reconstructed image.

[0126] In the latest VVC standard and the Enhanced Compression Model (ECM) reference software test model of the JVET traditional video coding exploration platform, CCALF coefficients use a fixed scale factor when integerizing, which is unreasonable. Because the texture information of each frame varies, using the same scale factor for frames of varying texture complexity makes it difficult to achieve an ideal filtering effect.

[0127] To address these issues, a filter-class-based precision adaptive solution was introduced. After the floating-point coefficients c are calculated on the encoder side, an adaptive scaling factor (scale) is selected during the integer conversion of the coefficients. The scale factor (scale) with the lowest cost is selected as the optimal scale factor for the filter set using the rate-distortion optimization (RDO) function. The scale factor value and the corresponding filter coefficients are written into the APS and transmitted to the decoder via entropy coding. Furthermore, the selected scale factor is used during filtering.

[0128] Accordingly, at the decoding end, when obtaining the filter coefficients, it is necessary to simultaneously obtain the scale factor values ​​of the filter group. Similarly, the selected scale factor will be used for filtering during the filtering process.

[0129] Compared to fixed scaling factors, adaptive filter-class precision schemes offer greater flexibility by adaptively selecting scaling factors for each filter coefficient set. However, each filter set requires transmitting the scaling factor to the decoder, which results in a relatively high bit cost. Furthermore, within the CCALF algorithm architecture, this scheme struggles to achieve a globally optimal solution and cannot guarantee optimal results in all situations.

[0130] However, in the JVET Traditional Video Coding Exploration Platform (ECM), ALF coefficients are represented as integers. The encoder typically uses Exponential Golomb coding, which can consume a significant number of bits for large coefficient values. In CCALF, coefficients are represented as powers of 2. The encoder uses fixed-length coding, encoding 3 bits if the coefficient is 0 and 4 bits otherwise. This coefficient representation saves some bits, but filtering accuracy is reduced due to the double rounding.

[0131] It can be seen that the common encoding and decoding methods of filter coefficients cannot take into account both bit overhead and filtering accuracy, which reduces the encoding and decoding efficiency and affects the compression performance.

[0132] In response to the above-mentioned problems, embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the decoding end, the bitstream is decoded to determine filter identification information; when it is determined based on the filter identification information that a first filter is used to filter the current image component of the current image, a filter coefficient type parameter corresponding to the current image component is determined; the filter coefficient corresponding to the current image component is determined based on the filter coefficient type parameter; and a reconstructed block of the current block in the current image is determined based on the filter coefficient. At the encoding end, the filter coefficient and filter coefficient type parameter corresponding to the current image component of the current image are adaptively determined; filter identification information is determined based on the filter coefficient, and the filter identification information is written into the bitstream; wherein the filter identification information is used to determine whether the first filter is used to filter the current image component of the current image; when it is determined that the first filter is used to filter the current image component of the current image, the filter coefficient and filter coefficient type parameter are written into the bitstream. That is to say, in an embodiment of the present application, an adaptive method can be used to represent the ALF and CCALF filter coefficients to determine the representation form of the filter coefficients, and the filter coefficient type parameters indicating the representation form of the filter coefficients are transmitted to the decoding end, so that the corresponding filter coefficients can be adaptively parsed at the decoding end through the filter coefficient type parameters, thereby increasing the flexibility of encoding, thereby obtaining a more ideal filtering effect, improving encoding efficiency, and enhancing compression performance.

[0133] Refer to Figure 4, which shows an example of a system composition block diagram of an encoder provided in an embodiment of the present application. As shown in Figure 4, the encoder 100 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (DPB) unit 114 and an entropy coding unit 115. Here, the input of the encoder 100 can be a video consisting of a series of pictures or a static picture, and the output of the encoder 100 can be a bit stream (also referred to as a "code stream") for representing a compressed version of the input video.

[0134] Among them, the segmentation unit 101 segments the picture in the input video into one or more Coding Tree Units (CTUs). The segmentation unit 101 divides the picture into multiple tiles (or tiles), and can further divide a tile into one or more bricks. Here, a tile or a brick may include one or more complete and / or partial CTUs. In addition, the segmentation unit 101 can form one or more slices, where a slice may include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture. The segmentation unit 101 can also form one or more sub-pictures, where a sub-picture may include one or more slices, tiles or bricks.

[0135] During the encoding process of encoder 100, segmentation unit 101 transmits the CTU to prediction unit 102. Generally, prediction unit 102 may be composed of block segmentation unit 103, motion estimation (ME) unit 104, motion compensation (MC) unit 105, and intra prediction unit 106. Specifically, block segmentation unit 103 iteratively uses quadtree segmentation, binary tree segmentation, and ternary tree segmentation to further divide the input CTU into smaller coding units (CUs). Prediction unit 102 may use ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks for the CU. Intra-frame prediction unit 106 may use various intra-frame prediction modes, including MIP mode, to obtain intra-frame prediction blocks for the CU. In an example, a rate-distortion optimized motion estimation method may be used by ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks, and a rate-distortion optimized mode determination method may be used by intra-frame prediction unit 106 to obtain intra-frame prediction blocks.

[0136] The prediction unit 102 outputs the prediction block of the CU, and the first adder 107 calculates the difference between the CU in the output of the segmentation unit 101 and the prediction block of the CU, i.e., the residual CU. The transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 109 quantizes the coefficients and outputs the quantized coefficients (i.e., levels). The inverse quantization unit 110 performs a scaling operation on the quantized coefficients to output reconstructed coefficients. The inverse transform unit 111 performs one or more inverse transforms corresponding to the transform in the transform unit 108 and outputs the reconstructed residual. The second adder 112 calculates the reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 102. The second adder 112 also sends its output to the prediction unit 102 for use as an intra-frame prediction reference. After all CUs in the picture or sub-picture are reconstructed, the filtering unit 113 performs loop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), a luma mapping and chroma scaling (LMCS) filter, and a neural network-based filter. Alternatively, when the filtering unit 113 determines that a CU is not used as a reference for encoding other CUs, the filtering unit 113 performs loop filtering on one or more target pixels in the CU.

[0137] The output of the filtering unit 113 is a decoded picture or sub-picture, which is cached to the DPB unit 114. The DPB unit 114 outputs the decoded picture or sub-picture based on the timing and control information. Here, the picture stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter-frame prediction or intra-frame prediction. Finally, the entropy coding unit 115 converts the parameters required for decoding the picture from the encoder 100 (such as control parameters and supplementary information, etc.) into binary form and writes this binary form into the code stream according to the syntax structure of each data unit. That is, the encoder 100 finally outputs the code stream.

[0138] Furthermore, encoder 100 may include a first processor and a first memory storing a computer program. When the first processor reads and executes the computer program, encoder 100 reads the input video and generates a corresponding bitstream. Alternatively, encoder 100 may be a computing device comprising one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in FIG9 .

[0139] Referring to Figure 5 , an example block diagram of a system composition of a decoder provided in an embodiment of the present application is shown. As shown in Figure 5 , the decoder 200 may include: a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filtering unit 208, and a decoded picture buffer unit 209. Here, the input of the decoder 200 is a bitstream representing a compressed version of a video or a still picture, and the output of the decoder 200 may be a decoded video consisting of a series of pictures or a decoded still picture.

[0140] The input codestream to decoder 200 may be the codestream generated by encoder 100. Parsing unit 201 parses the input codestream and obtains syntax element values ​​from the input codestream. Parsing unit 201 converts the binary representation of the syntax elements into digital values ​​and sends the digital values ​​to units within decoder 200 to obtain one or more decoded pictures. Parsing unit 201 may also parse one or more syntax elements from the input codestream to display decoded pictures.

[0141] During the decoding process of the decoder 200 , the parsing unit 201 sends the values ​​of the syntax elements and one or more variables set or determined according to the values ​​of the syntax elements and used to obtain one or more decoded pictures to the units in the decoder 200 .

[0142] The prediction unit 202 determines a prediction block for the current decoding block (e.g., CU). Here, the prediction unit 202 may include a motion compensation unit 203 and an intra-frame prediction unit 204. Specifically, when the inter-frame decoding mode is indicated for decoding the current decoding block, the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the motion compensation unit 203 to obtain an inter-frame prediction block; when the intra-frame prediction mode (including the MIP mode indicated based on the MIP mode index value) is indicated for decoding the current decoding block, the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the intra-frame prediction unit 204 to obtain an intra-frame prediction block.

[0143] The inverse quantization unit 205 has the same function as the inverse quantization unit 110 in the encoder 100. The inverse quantization unit 205 performs a scaling operation on the quantization coefficients (ie, levels) from the parsing unit 201 to obtain reconstructed coefficients.

[0144] The inverse transform unit 206 has the same function as the inverse transform unit 111 in the encoder 100. The inverse transform unit 206 performs one or more transform operations (ie, inverse operations of one or more transform operations performed by the inverse transform unit 111 in the encoder 100) to obtain a reconstructed residual.

[0145] The adder 207 performs an addition operation on its input (the prediction block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206) to obtain a reconstructed block of the current decoded block. The reconstructed block is also sent to the prediction unit 202 to be used as a reference for other blocks encoded in the intra prediction mode.

[0146] After all CUs in the picture or sub-picture are reconstructed, the filtering unit 208 performs loop filtering on the reconstructed picture or sub-picture. The filtering unit 208 includes one or more filters, such as a deblocking filter, a sample adaptive offset filter, an adaptive loop filter, a luminance mapping and chroma scaling filter, and a neural network-based filter. Alternatively, when the filtering unit 208 determines that the reconstructed block is not used as a reference for decoding other blocks, the filtering unit 208 performs loop filtering on one or more target pixels in the reconstructed block. Here, the output of the filtering unit 208 is a decoded picture or sub-picture, which is cached to the DPB unit 209. The DPB unit 209 outputs the decoded picture or sub-picture based on timing and control information. The picture stored in the DPB unit 209 can also be used as a reference for performing inter-frame prediction or intra-frame prediction by the prediction unit 202.

[0147] Furthermore, the decoder 200 can be a second memory having a second processor and a computer program. When the first processor reads and executes the computer program, the decoder 200 reads the input bit stream and generates the corresponding decoded video. In addition, the decoder 200 can also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in Figure 5.

[0148] It should also be noted that when the embodiment of the present application is applied to the encoder 100, the "current block" specifically refers to the current block to be encoded in the video image (which can also be simply referred to as the "encoding block"); when the embodiment of the present application is applied to the decoder 200, the "current block" specifically refers to the current block to be decoded in the video image (which can also be simply referred to as the "decoding block").

[0149] Based on FIG4 , the encoding method in the embodiment of the present application is mainly applied to the “filtering unit 113 ” part in the encoder 100 .

[0150] Based on FIG. 5 , the decoding method in the embodiment of the present application is mainly applied to the “filtering unit 208 ” part in the decoder 200 .

[0151] That is to say, the encoding and decoding method in the embodiments of the present application can be applied to a video encoding system (referred to as "encoder" for short), a video decoding system (referred to as "decoder" for short), and can even be applied to both a video encoding system and a video decoding system at the same time, but no limitation is made here.

[0152] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.

[0153] An embodiment of the present application provides a decoding method, which is applied to a decoder and is used to perform filtering processing using ALF or CCALF. FIG6 is a schematic diagram of the decoding method provided in the embodiment of the present application. As shown in FIG6 , the decoding method performed by the decoder may include the following steps:

[0154] Step 101: Decode the code stream and determine the filter identification information.

[0155] In an embodiment of the present application, the code stream is decoded to determine filter identification information, wherein the filter identification information can be used to determine whether a current image component of a current image is filtered using the first filter.

[0156] It should be noted that, in the embodiments of the present application, in the video image, the first image component, the second image component and the third image component are generally used to represent the coding block (Coding Block, CB); wherein, these three image components are a brightness component, a blue color component and a red color component, specifically, the brightness component is usually represented by the symbol Y, the blue color component is usually represented by the symbol Cb or U, and the red color component is usually represented by the symbol Cr or V; in this way, the video image can be represented in the YCbCr format or the YUV format.

[0157] It is understood that in the embodiments of the present application, the current image component of the current image may include a current brightness component or a current color component. The current color component of the current image may be understood as the blue color component of the current image or the red color component of the current image, i.e., the current color component may be a U component or a V component. This is not specifically limited in the present application.

[0158] Furthermore, in an embodiment of the present application, the first filter may include a cross-component adaptive loop filter CCALF or an adaptive loop filter ALF. That is, in the present application, the filter identification information may be used to determine whether the current image component of the current image is filtered using CCALF, or the filter identification information may be used to determine whether the current image component of the current image is filtered using ALF.

[0159] It can be understood that, in the embodiment of the present application, when determining whether to use the first filter for filtering through filtering identification information, the filtering identification information may include the first identification information or the second identification information.

[0160] Accordingly, in an embodiment of the present application, the first identification information is used to determine whether to use CCALF for filtering; the second identification information is used to determine whether to use ALF for filtering.

[0161] Exemplarily, in some embodiments, if the filtering identification information is the first identification information, then the first identification information can be used to indicate whether to use CCALF; if the filtering identification information is the second identification information, then the second identification information can be used to indicate whether to use ALF.

[0162] Furthermore, in an embodiment of the present application, whether to use the first filter to filter the current image component of the current image can be determined by taking a value of the filter identification information.

[0163] Exemplarily, in some embodiments, when the value of the filter identification information is the first value, it is determined not to use the first filter to filter the current image component of the current image.

[0164] Exemplarily, in some embodiments, when the value of the filter identification information is the second value, it is determined to use the first filter to filter the current image component of the current image.

[0165] It should be noted that, in an embodiment of the present application, the filter identification information can be used to indicate whether the current image component of the current image is filtered using the first filter. In addition, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Under normal circumstances, the filter identification information can be a parameter written in a picture parameter set (PPS) or a parameter written in a sequence parameter set (SPS). The filter identification information can also be a flag, which is not limited here.

[0166] It should also be noted that if the filter identification information is a flag, then in a specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first value and the second value in the embodiment of the present application are not limited in any way.

[0167] Taking the first value as 1 and the second value as 0 as an example, in the embodiment of the present application, if the value of the filter identification information is 1, it can be determined that the first filter is not used to filter the current image component of the current image. Otherwise, if the value of the filter identification information is 0, the first filter can be used to filter the current image component of the current image.

[0168] Thus, in the embodiment of the present application, the filter identification information can be used to indicate whether to use CCALF or ALF to filter the current luminance component or the current color component of the current image. If the filter identification information indicates that the current image component of the current image is filtered using the first filter, then correspondingly, the current color component of the current image can also be filtered using the first filter, or the current color component of the current image can be filtered using ALF.

[0169] Step 102: When it is determined based on the filter identification information that a first filter is used to filter a current image component of a current image, a filter coefficient type parameter corresponding to the current image component is determined.

[0170] In an embodiment of the present application, after decoding the code stream and determining the filter identification information, when it is determined based on the filter identification information that the current image component of the current image is filtered using a first filter, the filter coefficient type parameter corresponding to the current image component can be further determined.

[0171] Furthermore, in an embodiment of the present application, when it is determined based on the filtering identification information that the current image component of the current image is filtered using the first filter, the code stream can be further decoded to determine the APS index corresponding to the current image; then, the APS unit corresponding to the current image can be determined based on the APS index; and then, the filter coefficient type parameter corresponding to the current image component can be determined based on the APS unit.

[0172] It should be noted that, in the embodiment of the present application, the APS index corresponding to the current image can be used to indicate the APS unit corresponding to the current image, wherein the APS index corresponding to the current image can be the APS ID corresponding to the current image.

[0173] That is to say, in an embodiment of the present application, if the filtering identification information determines that the current image component of the current image is filtered using the first filter, then the APS ID corresponding to the current image can be further determined, and the corresponding APS unit can be selected according to the APS ID corresponding to the current image.

[0174] It should be noted that, in the embodiment of the present application, the filter coefficient type parameter can be used to determine the representation form of the filter coefficient, wherein the representation form of the filter coefficient can include the first representation form or the second representation form.

[0175] For example, in some embodiments, the first representation may be an integer representation, and the second representation may be a power-exponential representation, which is not specifically limited in this application.

[0176] Furthermore, in this very light embodiment, when determining the filter coefficient corresponding to the current image component according to the filter coefficient type parameter, when the filter coefficient is determined to be in a first representation form based on the filter coefficient type parameter, the filter coefficient of the first representation form is determined according to a first analytical method corresponding to the first representation form; when the filter coefficient is determined to be in a second representation form based on the filter coefficient type parameter, the filter coefficient of the second representation form is determined according to a second analytical method corresponding to the second representation form.

[0177] Furthermore, in an embodiment of the present application, when determining the filter coefficient corresponding to the current image component based on the filter coefficient type parameter, if the filter coefficient is determined to be a filter coefficient in a first representation based on the filter coefficient type parameter, the filter coefficient in the first representation may be determined as the filter coefficient corresponding to the current image component. That is, the filter coefficient in the first representation may be directly used as the filter coefficient of the first filter.

[0178] Furthermore, in an embodiment of the present application, when determining the filter coefficient corresponding to the current image component based on the filter coefficient type parameter, when determining that the filter coefficient is a filter coefficient of the first representation based on the filter coefficient type parameter, the filter coefficient of the second representation is mapped to obtain the filter coefficient of the first filter.

[0179] That is to say, in the embodiments of the present application, the filter coefficients obtained in the first representation form can be directly used as the filter coefficients for subsequent filtering processing, that is, the filtering coefficients of the first filter; the filter coefficients obtained in the second representation form need to be further mapped before the filter coefficients of the first filter can be obtained.

[0180] For example, in some embodiments, the filter coefficients obtained in the second representation may be in a power exponential form of k bits, where k is greater than or equal to 1. For example, if k is 4, the obtained second representation may be in a power exponential form of 4 bits, where 1 bit is used to determine the sign and 3 bits are used to determine the value.

[0181] Exemplarily, in some embodiments, the value of the highest bit can be used to determine the sign. For example, 1 indicates a negative sign and 0 indicates a positive sign, and the other 3 bits are used to determine the value.

[0182] Exemplarily, in some embodiments, assume that the obtained filtering coefficient in the second representation form is 1101. Then, when mapping the filtering coefficient in the second representation form, it can be determined that the sign is negative and the value is 32. That is, after mapping the filtering coefficient in the second representation form, the determined filtering coefficient is -32.

[0183] Exemplarily, in some embodiments, assume that the obtained filtering coefficient in the second representation form is 0101. Then, when mapping the filtering coefficient in the second representation form, it can be determined that the sign is positive and the value is 32. That is, after mapping the filtering coefficient in the second representation form, the determined filtering coefficient is 32.

[0184] It should be noted that in the embodiments of the present application, after determining the filtering coefficient corresponding to the current image component, in the subsequent filtering process, the filtering coefficient of the current image component can also be scaled based on the corresponding scale factor, which is not specifically limited in the present application.

[0185] It can be understood that in the embodiments of the present application, at the encoding end, different data processing strategies can be selected to obtain the filtering coefficient. Among them, the representation forms of the filtering coefficients obtained under different data processing strategies are different. Correspondingly, after adaptively determining the filtering coefficient, the representation form of the filtering coefficient can be indicated by a filtering coefficient type parameter, and the filtering coefficient type parameter can be written into the code stream and transmitted to the decoding end, so that the decoder can know the representation form corresponding to the filtering coefficient based on the filtering coefficient type parameter.

[0186] Exemplarily, in some embodiments, at the encoding end, for the initially obtained floating-point filtering coefficient, if the first data processing strategy is used to determine the filtering coefficient, then the floating-point filtering coefficient can be first multiplied by a scale factor 1<<bitShift, where bitShift represents the number of bits of the shift. In some embodiments, the value of bitshift can be any value, which is not specifically limited in the present application. For example, the value of bitshift can be one of 5, 6, 7, 8. Then, round the filtering coefficient to convert it into an integer number, so as to obtain the filtering coefficient in the first representation form, and the first representation form can be an integerized representation form.

[0187] Exemplarily, in some embodiments, at the encoding end, for the initially obtained floating-point filter coefficients, if the second data processing strategy is used to determine the filter coefficients, then the floating-point filter coefficients can be multiplied by a scaling factor 1<<bitShift first, where bitShift represents the number of bits of shift. In some embodiments, the value of bitshift can be any value, which is not specifically limited in this application. The value of bitshift can be one of 5, 6, 7, and 8. Then, round the filter coefficients to convert them into integers, and then map the integer coefficients to another value. In some embodiments, the integer coefficients can be mapped to any value, which is not specifically limited in the embodiments of this application. For example, they can be mapped to one of {0, ±1, ±2, ±4, ±8, ±16, ±32, ±64}, so as to obtain the filter coefficients of the second data type, and the second data type can be a power-exponentiated data type.

[0188] Furthermore, in the embodiments of this application, the representation form of the filter coefficients can be determined based on the filter coefficient type parameter. Among them, the representation form of the filter coefficients can be determined as the first representation form or the second type according to the value of the filter coefficient type parameter.

[0189] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current luminance component, then the filter coefficient type parameter can be represented by the syntax element alf_luma_coeff_expression, that is, alf_luma_coeff_expression represents the coefficient representation method (the representation form of the filter parameter) used for the ALF luminance component. If the value of alf_luma_coeff_expression is 0, the ordinary integer representation is adopted, that is, the representation form of the filter coefficients is determined as the first representation form. If the value of alf_luma_coeff_expression is 1, the power-exponentiated representation is adopted, that is, the representation form of the filter coefficients is determined as the second representation form.

[0190] Of course, the values of alf_luma_coeff_expression are not limited to 0 and 1, and this application does not specifically limit them.

[0191] For example, in some embodiments, if the first filter is an ALF and the current image component is a current color component, the filter coefficient type parameter can be represented by the syntax element alf_chroma_coeff_expression, that is, alf_chroma_coeff_expression represents the coefficient representation method used by the ALF color component (representation form of the filter parameter). If the value of alf_chroma_coeff_expression is 0, ordinary integer representation is adopted, that is, the representation form of the filter coefficient is determined to be the first representation form; if the value of alf_chroma_coeff_expression is 1, power exponential representation is adopted, that is, the representation form of the filter coefficient is determined to be the second representation form.

[0192] Of course, the value of alf_chroma_coeff_expression is not limited to 0 and 1, and this application does not make any specific limitations.

[0193] For example, in some embodiments, if the first filter is a CCALF filter and the current image component is a current color component, such as a Cb component, the filter coefficient type parameter may be represented by the syntax element alf_cross_component_cb_coeff_expressio, that is, alf_cross_component_cb_coeff_expression represents the coefficient representation method (representation form of the filter parameter) used by the CCALF color component. If the value of alf_cross_component_cb_coeff_expression is 0, ordinary integer representation is adopted, that is, the representation form of the filter coefficient is determined to be the first representation form; if the value of alf_cross_component_cb_coeff_expression is 1, power exponential representation is adopted, that is, the representation form of the filter coefficient is determined to be the second representation form.

[0194] Of course, the value of alf_cross_component_cb_coeff_expression is not limited to 0 and 1, and this application does not make any specific limitation.

[0195] Exemplarily, in some embodiments, if the first filter is CCALF and the current image component is a current color component, such as a Cr component, the filter coefficient type parameter can be represented by the syntax element alf_cross_component_cr_coeff_expressio, that is, alf_cross_component_cr_coeff_expressio represents the coefficient representation method used by the CCALF color component (the representation form of the filter parameter). If the value of alf_cross_component_cr_coeff_expressio is 0, ordinary integer representation is adopted, that is, the representation form of the filter coefficient is determined to be the first representation form; if the value of alf_cross_component_cr_coeff_expressio is 1, power exponential representation is adopted, that is, the representation form of the filter coefficient is determined to be the second representation form.

[0196] Of course, the value of alf_cross_component_cr_coeff_expressio is not limited to 0 and 1, and this application does not make any specific limitations.

[0197] Furthermore, in an embodiment of the present application, when it is determined based on the filtering identification information that the first filter is used to filter the current image component of the current image, third identification information can also be determined based on the APS unit; when it is determined based on the third identification information to use the new first filter, the process of determining the filter coefficient type parameter can be executed.

[0198] It should be noted that, in the embodiment of the present application, the third identification information can be used to determine whether to use a new first filter, that is, based on the third identification information, it can be determined whether the current image component uses a new CCALF or a new ALF.

[0199] It is understood that in the embodiments of the present application, the APS unit can be parsed to obtain the corresponding third identification information, and thus, whether to use the new first filter can be determined based on the third identification information. Accordingly, if a new filter is used, further parsing of the filter parameters is required, and therefore, it is necessary to first determine the filter coefficient type parameter, and then use the filter coefficient type parameter to further determine the filter coefficient.

[0200] Furthermore, in an embodiment of the present application, the filter coefficient type parameter may include at least one type parameter corresponding to the current image.

[0201] It should be noted that, in the embodiments of the present application, the filter coefficient type parameter may include any number of type parameters, which is not specifically limited in the present application.

[0202] That is to say, in the embodiments of the present application, there is no restriction on the specific number of filter coefficient representations (filter coefficient type parameters).

[0203] For example, in some embodiments, for the luminance component ALF, the number of coefficient representations is not limited, that is, the number of filter coefficient type parameters is not limited. The filter coefficient type parameter can use the same coefficient representation for a frame, that is, a frame has only one coefficient representation; it can also use the same coefficient representation for each region, that is, a frame can have N coefficient representations, where N is the number of regions; it can also use a coefficient representation for each filter, that is, a frame can have M*N coefficient representations, where N is the number of regions and M is the number of filters in each region.

[0204] For example, in some embodiments, for the chrominance component ALF, there is no limit on the number of coefficient representations, that is, there is no limit on the number of filter coefficient type parameters. The filter coefficient type parameter can use the same coefficient representation for a frame, that is, a frame has only one coefficient representation; or it can use a coefficient representation for each filter, that is, a frame can have N coefficient representations, where N is the number of filters.

[0205] For example, in some embodiments, for CCALF, there is no limit on the number of coefficient representations, that is, the number of filter coefficient type parameters is not limited. The filter coefficient type parameter can use the same coefficient representation for a frame, that is, a frame has only one coefficient representation; or it can use a coefficient representation for each filter, that is, a frame can have N coefficient representations, where N is the number of filters.

[0206] Furthermore, in an embodiment of the present application, whether the current image component uses a new first filter can be determined by the value of the third identification information.

[0207] Exemplarily, in some embodiments, when the value of the third filter identification information is the third value, it is determined not to use the new first filter; when the value of the third filter identification information is the fourth value, it is determined to use the new first filter.

[0208] It should be noted that, in the embodiments of the present application, the third identification information can be used to indicate whether the current image component is filtered using the new first filter. Furthermore, the third value and the fourth value are different, and the third value and the fourth value can be in parameter form or in digital form. Typically, the third identification information can be a parameter written into the APS unit corresponding to the current image.

[0209] For example, in some embodiments, the third value may be set to 1 and the fourth value may be set to 0. In another specific example, the third value may be set to true and the fourth value may be set to false. In yet another specific example, the third value may be set to 0 and the fourth value may be set to 1. Alternatively, the third value may be set to false and the fourth value may be set to true. The third value and the fourth value in the embodiments of the present application are not limited in any way.

[0210] Taking the third value being 1 and the fourth value being 0 as an example, in the embodiment of the present application, if the value of the third identification information is 1, it can be determined that the new first filter is not used to filter the current image component. Otherwise, if the value of the third identification information is 0, it can be determined that the new first filter is used to filter the current image component.

[0211] Step 103: Determine the filter coefficient corresponding to the current image component according to the filter coefficient type parameter.

[0212] In an embodiment of the present application, if it is determined based on the filter identification information that the current image component of the current image is filtered using a first filter, then after determining the filter coefficient type parameter corresponding to the current image component, the filter coefficient corresponding to the current image component can be further determined based on the filter coefficient type parameter.

[0213] Further, in an embodiment of the present application, when determining the filter coefficient corresponding to the current image component based on the filter coefficient type parameter, when the filter coefficient is determined to be in a first representation form based on the filter coefficient type parameter, the filter coefficient can be determined according to a first analytical method corresponding to the first representation form; when the filter coefficient is determined to be in a second representation form based on the filter coefficient type parameter, the filter coefficient can be determined according to a second analytical method corresponding to the second representation form.

[0214] It should be noted that, in an embodiment of the present application, the first parsing method may be a method corresponding to exponential Golomb coding; the second parsing method may be a method corresponding to fixed-length coding.

[0215] It can be understood that in an embodiment of the present application, at the encoding end, if the first data processing strategy is used to determine the filter coefficient, then after obtaining the filter coefficient in the first representation form, the filter coefficient can be encoded using the exponential Golomb coding method.

[0216] Accordingly, in an embodiment of the present application, at the decoding end, if the filter coefficient is determined to be in the first representation form based on the filter coefficient type parameter, the first parsing method corresponding to the exponential Golomb coding can be used to complete the parsing of the filter coefficient.

[0217] It can be understood that in the embodiment of the present application, at the encoding end, if the second data processing strategy is used to determine the filter coefficient, then after obtaining the filter coefficient in the second representation form, the filter coefficient can be encoded using a fixed-length coding method.

[0218] Accordingly, in an embodiment of the present application, at the decoding end, if the filter coefficient is determined to be in the second representation based on the filter coefficient type parameter, the second parsing method corresponding to the fixed-length coding can be used to complete the parsing of the filter coefficient.

[0219] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current luminance component, then the filter coefficient type parameter can be represented by the syntax element alf_luma_coeff_expression; if the value of alf_luma_coeff_expression indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Columbus coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_luma_coeff_expression indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0220] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current color component, then the filter coefficient type parameter can be represented by the syntax element alf_chroma_coeff_expression; if the value of alf_chroma_coeff_expression indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Golomb coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_chroma_coeff_expression indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0221] Exemplarily, in some embodiments, if the first filter is CCALF and the current image component is the current color component, such as the Cb component, then the filter coefficient type parameter can be represented by the syntax element alf_cross_component_cb_coeff_expressio. If the value of alf_cross_component_cb_coeff_expressio indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Golomb coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_cross_component_cb_coeff_expressio indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0222] Exemplarily, in some embodiments, if the first filter is CCALF and the current image component is the current color component, such as the Cr component, then the filter coefficient type parameter can be represented by the syntax element alf_cross_component_cr_coeff_expressio. If the value of alf_cross_component_cr_coeff_expressio indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Golomb coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_cross_component_cr_coeff_expressio indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0223] That is to say, in the embodiments of the present application, the filter coefficients obtained in the first representation form can be directly used as the filter coefficients for subsequent filtering processing, that is, the filtering coefficients of the first filter; the filter coefficients obtained in the second representation form need to be further mapped before the filter coefficients of the first filter can be obtained.

[0224] For example, in some embodiments, the filter coefficients obtained in the second representation may be in a power exponential form of k bits, where k is greater than or equal to 1. For example, if k is 4, the obtained second representation may be in a power exponential form of 4 bits, where 1 bit is used to determine the sign and 3 bits are used to determine the value.

[0225] For example, in some embodiments, the value of the most significant bit can be used to determine the sign, for example, 1 indicates that the sign is negative, and 0 indicates that the sign is positive, and the other three bits are used to determine the value.

[0226] For example, in some embodiments, assuming that the obtained filter coefficient of the second representation is 1101, when mapping the filter coefficient of the second representation, it can be determined that the sign is negative and the value is 32, that is, after mapping the filter coefficient of the second representation, the determined filter coefficient is -32.

[0227] For example, in some embodiments, assuming that the obtained filter coefficient of the second representation is 0101, when mapping the filter coefficient of the second representation, it can be determined that the sign is positive and the value is 32, that is, after mapping the filter coefficient of the second representation, the determined filter coefficient is 32.

[0228] It should be noted that in an embodiment of the present application, after determining the filter coefficient corresponding to the current image component, in the subsequent filtering process, the filter coefficient of the current image component can also be scaled based on the corresponding scale factor, which is not specifically limited in the present application.

[0229] Step 104: Determine a reconstructed block of the current block in the current image according to the filter coefficient.

[0230] In an embodiment of the present application, after determining the filter coefficient corresponding to the current image component according to the filter coefficient type parameter, a reconstructed block of the current block in the current image may be further determined according to the filter coefficient.

[0231] It should be noted that, in the embodiment of the present application, the scale factor corresponding to the current image component may be determined first, that is, the scale factor corresponding to the current luminance component or the scale factor corresponding to the current chrominance component may be determined.

[0232] Furthermore, in an embodiment of the present application, when determining the reconstructed block of the current block in the current image according to the filter coefficient, the reconstructed block of the current block in the current image may be determined according to the scale factor and the filter coefficient.

[0233] That is, in the embodiment of the present application, after determining the scale factor and the filter coefficient corresponding to the current image component, filtering may be further performed according to the scale factor and the filter coefficient to determine a reconstructed block of the current block.

[0234] To sum up, through the decoding method proposed in the above steps 101 to 103, at the encoding end, an adaptive method can be used to represent the ALF and CCALF filter coefficients to determine the representation form of the filter coefficients, and the filter coefficient type parameter indicating the representation form of the filter coefficients is transmitted to the decoding end, so that the corresponding filter coefficients can be adaptively parsed at the decoding end through the filter coefficient type parameter, which increases the flexibility of encoding and improves the encoding efficiency.

[0235] In other words, the decoding method proposed in the embodiments of the present application includes a method for adaptively representing filter coefficients. In the ALF and CCALF techniques, the filter coefficients for ALF and CCALF within a frame of an image are adaptively selected and acquired using different data processing strategies, thereby enabling the use of different representations to represent the corresponding filter coefficients, including but not limited to integer representation or power exponent representation.

[0236] It can be seen from this that the decoding method proposed in the embodiment of the present application no longer limits the filter coefficients to a fixed representation method, but can adaptively select a filter coefficient representation that can achieve better filtering effects. That is, in the coefficient integerization process, the filter independently selects the coefficient representation form, for example, from the two forms of ordinary integer representation (used in ALF in ECM) and power exponential representation (used in CCALF in ECM), the best representation form is adaptively selected, thereby improving the encoding and decoding efficiency and improving the compression performance.

[0237] For example, in some embodiments, for ALF, the following uses the VVC syntax and semantics level as an example to illustrate the changes at the syntax and semantics level:

[0238] For example, in some embodiments, for CCALF, the following uses the VVC syntax and semantics level as an example to illustrate the changes at the syntax and semantics level:

[0239] alf_luma_coeff_expression indicates the coefficient representation used for the ALF luma component. If it is 0, ordinary integer representation is used, and the absolute value of the coefficient is encoded using Exponential Golomb coding. If it is 1, power exponential representation is used, and the absolute value of the coefficient is directly encoded using 3-bit fixed-length coding.

[0240] alf_chroma_coeff_expression specifies the coefficient representation used for the ALF chroma component. If it is 0, normal integer representation is used, and the absolute values ​​of the coefficients are encoded using Exponential Golomb coding. If it is 1, power representation is used, and the absolute values ​​of the coefficients are encoded directly using 3-bit fixed-length coding.

[0241] alf_cross_component_cb_coeff_expression specifies the coefficient representation used for the CCALF chroma Cb component. If 0, normal integer representation is used, and the absolute values ​​of the coefficients are encoded using Exponential Golomb coding. If 1, power representation is used, and the absolute values ​​of the coefficients are encoded directly using 3-bit fixed-length coding.

[0242] alf_cross_component_cr_coeff_expression specifies the coefficient representation used for the CCALF chrominance (Cr) component. If 0, normal integer representation is used, and the absolute values ​​of the coefficients are encoded using Exponential Golomb coding. If 1, power representation is used, and the absolute values ​​of the coefficients are encoded directly using a 3-bit fixed-length code.

[0243] It should be noted that, in the embodiments of the present application, the representation of the power exponentiation is not limited to the value of the base in the power exponentiation, which can be 2 in implementation, but can also be any positive integer.

[0244] Exemplarily, in some embodiments, during parsing, if an APS unit exists in the current frame (current image), the APS unit is parsed.

[0245] For example, in some embodiments, if the luma component ALF new filter flag (third identification information) in the APS unit is 1, the coefficient representation mode 1 (filter coefficient type parameter) of the luma component ALF of the current frame will be parsed when parsing the APS information. If the coefficient representation mode 1 is 0, the luma component ALF filter coefficients are parsed using the decoding method corresponding to the exponential Golomb coding (first parsing method). If the coefficient representation mode 1 is 1, the luma component ALF filter coefficients are parsed using the decoding method corresponding to the fixed-length coding (second parsing method).

[0246] For example, in some embodiments, if the chroma component ALF new filter flag in the APS unit is 1, the coefficient representation 2 (filter coefficient type parameter) of the chroma component ALF of the current frame will be parsed when parsing the APS information. If the coefficient representation 2 is 0, the chroma component ALF filter coefficients are parsed using a decoding method corresponding to exponential Golomb coding. If the coefficient representation 2 is 1, the chroma component ALF filter coefficients are parsed using a decoding method corresponding to fixed-length coding.

[0247] For example, in some embodiments, if the CCALF new filter flag of the chroma component Cb in the APS unit is 1, the coefficient representation 3 (filter coefficient type parameter) of the CCALF of the chroma component Cb of the current frame will be parsed when parsing the APS information. If the coefficient representation 3 is 0, the decoding method corresponding to the exponential Golomb coding is used to parse the filter coefficients of the CCALF of the chroma component Cb. If the coefficient representation 3 is 1, the decoding method corresponding to the fixed-length coding is used to parse the filter coefficients of the CCALF of the chroma component Cb.

[0248] For example, in some embodiments, if the CCALF new filter flag of the chroma component Cr in the APS unit is 1, the coefficient representation 4 (filter coefficient type parameter) of the CCALF of the chroma component Cr of the current frame will be parsed when parsing the APS information. If the coefficient representation 4 is 0, the decoding method corresponding to the exponential Golomb coding is used to parse the filter coefficients of the CCALF of the chroma component Cr. If the coefficient representation 4 is 1, the decoding method corresponding to the fixed-length coding is used to parse the filter coefficients of the CCALF of the chroma component Cr.

[0249] An embodiment of the present application provides a decoding method, wherein, at a decoding end, a code stream is decoded and filter identification information is determined; when a first filter is determined to be used to filter a current image component of a current image based on the filter identification information, a filter coefficient type parameter corresponding to the current image component is determined; a filter coefficient corresponding to the current image component is determined based on the filter coefficient type parameter; and a reconstructed block of a current block in the current image is determined based on the filter coefficient. That is, in an embodiment of the present application, an adaptive method can be used to represent ALF and CCALF filter coefficients to determine the representation form of the filter coefficients, and the filter coefficient type parameter indicating the representation form of the filter coefficients is transmitted to the decoding end, so that the corresponding filter coefficients can be adaptively parsed at the decoding end using the filter coefficient type parameter, thereby increasing the flexibility of encoding, thereby achieving a more ideal filtering effect, improving encoding efficiency, and enhancing compression performance.

[0250] It can be understood that in the embodiments of the present application, since an adaptive filter coefficient representation method is adopted, it is unreasonable to use a fixed scale factor scale in the process of determining the filter coefficient, and it is impossible to match the adaptive filter coefficient representation. That is, using the same scale factor for different filter coefficient representations makes it difficult to achieve an ideal filtering effect.

[0251] Accordingly, in the embodiments of the present application, when the optimal scale factor is adaptively selected for the image components, it is unreasonable to use fixed filter coefficients during the filtering process. This is because it is impossible to adapt the filter accuracy, that is, it is impossible to match the adaptive scale factor. In other words, it is also difficult to achieve an ideal filtering effect when the same filter coefficient representation is used for the adaptive scale factor.

[0252] Therefore, the decoding method proposed in the embodiment of the present application also includes a method for adaptive filter accuracy. In CCALF or ALF technology, the optimal scale factor is adaptively selected for the image components within a frame of image. Combined with the application of adaptive filter coefficient representation, the flexibility of filtering is greatly improved, and a more ideal filtering effect can be further obtained, thereby improving the coding performance.

[0253] Furthermore, in the embodiment of the present application, taking CCALF and color components as examples, the filter precision adaptive decoding method proposed in the embodiment of the present application is further exemplified, wherein the method for the decoder to perform decoding processing may include the following:

[0254] In an embodiment of the present application, the code stream is decoded to determine first identification information, wherein the first identification information can be used to determine whether the current color component of the current image is filtered using CCALF.

[0255] That is, in the embodiment of the present application, the first identification information determined by decoding the code stream can be used to determine whether the current color component of the current image is filtered using CCALF.

[0256] It should be noted that, in the embodiments of the present application, in the video image, the first image component, the second image component and the third image component are generally used to represent the coding block (Coding Block, CB); wherein, these three image components are a brightness component, a blue color component and a red color component, specifically, the brightness component is usually represented by the symbol Y, the blue color component is usually represented by the symbol Cb or U, and the red color component is usually represented by the symbol Cr or V; in this way, the video image can be represented in the YCbCr format or the YUV format.

[0257] Furthermore, in the embodiment of the present application, the current color component of the current image can be understood as the blue color component of the current image, or can be understood as the red color component of the current image, that is, the current color component can be the U component or the V component. This application does not make any specific limitations.

[0258] Exemplarily, in some embodiments, when the value of the first identification information is the fifth value, it can be determined that the current color component of the current image is not filtered using CCALF.

[0259] Exemplarily, in some embodiments, when the value of the first identification information is the sixth value, it can be determined that the current color component of the current image is filtered using CCALF.

[0260] It should be noted that, in an embodiment of the present application, the first identification information can be used to indicate whether the current color component of the current image is filtered using CCALF. In addition, the fifth value and the sixth value are different, and the fifth value and the sixth value can be in parameter form or in digital form. Under normal circumstances, the first identification information can be a parameter written in a picture parameter set (PPS) or a parameter written in a sequence parameter set (SPS). The first identification information can also be a flag, which is not limited here.

[0261] It should also be noted that if the first identification information is a flag, then in a specific example, the fifth value can be set to 1 and the sixth value can be set to 0; in another specific example, the fifth value can also be set to true and the sixth value can also be set to false; even in another specific example, the fifth value can also be set to 0 and the sixth value can also be set to 1; or, the fifth value can also be set to false and the sixth value can also be set to true. The fifth value and the sixth value in the embodiment of the present application are not limited in any way.

[0262] Taking the fifth value as 1 and the sixth value as 0 as an example, in the embodiment of the present application, if the value of the first identification information is 1, it can be determined that the current color component of the current image is not filtered using CCALF. Otherwise, if the value of the first identification information is 0, the current color component of the current image can be filtered using CCALF.

[0263] When it is determined to use the first filter to filter the current color component of the current image, a scale factor and a filter coefficient corresponding to the current color component are determined.

[0264] In an embodiment of the present application, when it is determined to use the first filter to filter the current color component of the current image, a scale factor and a filter coefficient corresponding to the current color component may be further determined.

[0265] It should be noted that in the embodiments of the present application, if CCALF filtering is determined to be used for the current color component of the current image based on the first identification information, then it is necessary to further determine the scale factor and filter coefficients used in the CCALF filtering process. The scale factor corresponds to the current color component of the current image, and the filter coefficients are related to the scale factor.

[0266] It can be understood that, in the embodiment of the present application, for the current color component of the current image, the determined corresponding scale factor and filter coefficient can be applied to the filtering process of the current color component.

[0267] That is, in an embodiment of the present application, when performing CCALF filtering on the current color component of the current image, a scale factor corresponding to the current color component of the current image can be used, that is, each color component corresponds to only one scale factor, and the scale factors corresponding to different color components can be the same or different, and this application does not make specific limitations.

[0268] It should be noted that, in the embodiments of the present application, the filter coefficients may be integer-processed filter coefficients. Specifically, at the encoding end, a scale factor may be selected to scale the solved floating-point filter coefficients, and then the scaled filter coefficients may be integer-processed to obtain integer filter coefficients.

[0269] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component, first scale factor information corresponding to the current color component may be determined first; and then the scale factor corresponding to the current color component may be determined based on the first scale factor information.

[0270] It should be noted that, in the embodiment of the present application, the first scale factor information can be used to determine the scale factor corresponding to the current color component. The first scale factor information can include any of the following information: an index value of the scale factor, a numerical value of the scale factor, or a related numerical value of the scale factor.

[0271] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component according to the first scale factor information, the scale factor corresponding to the current color component may be determined according to the first scale factor information and a scale factor candidate list.

[0272] It should be noted that, in an embodiment of the present application, if the first scale factor information is the index value of the scale factor corresponding to the current color component, then the candidate scale factor indicated by the index value of the scale factor in the scale factor candidate list can be determined as the scale factor corresponding to the current color component.

[0273] It can be understood that, in the embodiment of the present application, at least one scale factor candidate list may be preset, and the scale factor candidate list is used to determine the scale factor corresponding to the current color component.

[0274] It should be noted that, in the embodiment of the present application, the number of pre-set scaling factor candidate lists may be any integer greater than 0. For example, the number of scaling factor candidate lists may be 1 or 3, which is not specifically limited in the present application.

[0275] It is understandable that in the embodiments of the present application, for the encoder, the number of scaling factor candidate lists can be set; for the decoder, the number of scaling factor candidate lists can be set or determined based on list number information transmitted by the encoder.

[0276] Accordingly, in the embodiments of the present application, since the number of pre-set scaling factor candidate lists is an arbitrary value, after setting at least one scaling factor candidate list, list quantity information corresponding to the at least one scaling factor candidate list can also be written into the bitstream. Accordingly, at the decoding end, by decoding the bitstream, list quantity information indicating the number of scaling factor candidate lists can be determined. The number of scaling factor candidate lists can then be determined based on the list quantity information, thereby setting at least one scaling factor candidate list.

[0277] It should be noted that, in the embodiment of the present application, the preset scaling factor candidate list may include at least one scaling factor candidate, wherein at least one scaling factor candidate is greater than 0.

[0278] It is understandable that, in the embodiments of the present application, the number of candidate scale factors included in each preset scale factor candidate list may be any integer greater than 0. For example, the scale factor candidate list may include 4 candidate scale factors or 5 candidate scale factors, which is not specifically limited in the present application.

[0279] Accordingly, in the embodiment of the present application, for different scale factor candidate lists, the number of candidate scale factors included in each scale factor candidate list may be the same or different, which is not specifically limited in the present application.

[0280] For example, in some embodiments, three scale factor candidate lists are pre-set, wherein scale factor candidate list 1 includes four candidate scale factors, scale factor candidate list 2 includes seven candidate scale factors, and scale factor candidate list 3 includes two candidate scale factors.

[0281] It should be noted that, in the embodiment of the present application, the value of each candidate scaling factor included in the preset scaling factor candidate list may be any value greater than 0, and the present application does not impose any specific limitation thereto.

[0282] Illustratively, in some embodiments, the scale factor candidate list includes four candidate scale factors, and the values ​​of the four candidate scale factors are 7, 8, 9, and 10, respectively.

[0283] That is, in the embodiment of the present application, when the first scale factor information is the index value of the scale factor corresponding to the current color component, the corresponding scale factor can be determined from a preset scale factor candidate list according to the index value.

[0284] For example, in some embodiments, Table 1 shows a possible form of a scale factor candidate list, where the scale factor candidate list includes four candidate scale factors, namely 7, 8, 9, and 10. If the first scale factor information is a scale factor index value of 2, then candidate scale factor 8 can be determined to be the scale factor corresponding to the current color component.

[0285] Table 1

[0286] Further, in an embodiment of the present application, when determining the scale factor corresponding to the current color component according to the first scale factor information, the first scale factor information may be determined as the scale factor corresponding to the current color component.

[0287] It should be noted that, in the embodiment of the present application, if the first scale factor information is the value of the scale factor corresponding to the current color component, then the first scale factor information can be directly determined as the scale factor corresponding to the current color component.

[0288] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component according to the first scale factor information, conversion may be performed according to the first scale factor information, thereby determining the scale factor corresponding to the current color component.

[0289] It should be noted that, in the embodiment of the present application, if the first scale factor information is a related value of the scale factor corresponding to the current color component, then conversion can be further performed based on the first scale factor information to obtain the scale factor corresponding to the current color component.

[0290] For example, in some embodiments, after determining the first scale factor information, during the conversion process based on the first scale factor information, the result of a numerical operation between the first scale factor information and a preset value may be selected as the corresponding scale factor. The preset value may be any value and is not specifically limited in this application. For example, the first scale factor information may be summed with a value of 6 (a preset value), and the summed value may be determined as the corresponding scale factor.

[0291] It can be understood that, in the embodiment of the present application, the relevant numerical value of the scale factor may be a numerical value in other forms generated by converting the numerical value of the scale factor.

[0292] That is, in the embodiments of the present application, the first scale factor information transmitted from the encoder to the decoder can be in any form. For example, the first scale factor information includes but is not limited to an index value of the scale factor, a numerical value of the scale factor, and related numerical values ​​of the scale factor, which are not specifically limited in the present application.

[0293] It should be noted that in the embodiments of the present application, at the encoding end, the first scale factor information can be written into the bitstream in any manner and transmitted to the decoding end. Encoding the first scale factor information includes, but is not limited to, fixed-length coding, variable-length coding, or adaptive context coding, and is not specifically limited in the embodiments of the present application.

[0294] Furthermore, in an embodiment of the present application, when it is determined that the current color component of the current image is filtered using the first filter, the code stream can be decoded to determine the APS index corresponding to the current image; then, the APS unit corresponding to the current image can be determined based on the APS index; finally, the fourth identification information can be determined based on the APS unit; wherein the fourth identification information is used to determine whether the current color component of the current block is filtered using CCALF.

[0295] It should be noted that, in the embodiment of the present application, the APS index corresponding to the current image can be used to indicate the APS unit corresponding to the current image, wherein the APS index corresponding to the current image can be the APS ID corresponding to the current image.

[0296] That is to say, in an embodiment of the present application, if the first identification information indicates that the current color component of the current image is filtered using the first filter, then the APS ID corresponding to the current image can be further determined, and the corresponding APS unit can be selected according to the APS ID corresponding to the current image.

[0297] It should be noted that, in the embodiment of the present application, the APS unit corresponding to the current image may include CCALF parameter information corresponding to the current color component of the current image, wherein the CCALF parameter information may be used for CCALF filtering processing of the current color component of the current image.

[0298] That is to say, in an embodiment of the present application, the APS unit corresponding to the current image may include parameter information related to CCALF filtering processing, namely, CCALF parameter information, and the CCALF filtering processing of the current color component of the current image can be completed through the CCALF parameter information.

[0299] It should be noted that, in an embodiment of the present application, the CCALF parameter information may include fourth identification information. That is, the APS unit may include fourth identification information for indicating whether the current color component of the current block is filtered using CCALF. The fourth identification information corresponding to the current block can be determined by parsing the APS unit.

[0300] That is, in the embodiment of the present application, the fourth identification information determined by the APS unit can determine whether the current color component of the current block is filtered using CCALF.

[0301] Exemplarily, in some embodiments, when the value of the fourth identification information is the seventh value, it may be determined that the current color component of the current block is not filtered using the first filter.

[0302] Exemplarily, in some embodiments, when the value of the fourth identification information is the eighth value, it may be determined that the current color component of the current block is filtered using the first filter.

[0303] It should be noted that, in the embodiments of the present application, the fourth identification information may be used to indicate whether the current color component of the current block is filtered using CCALF. Furthermore, the seventh value and the eighth value are different, and the seventh value and the eighth value may be in parameter form or in digital form. Typically, the fourth identification information may be a parameter written into the APS unit corresponding to the current image.

[0304] For example, in some embodiments, the seventh value may be set to 1 and the eighth value may be set to 0. In another specific example, the seventh value may be set to true and the eighth value may be set to false. In yet another specific example, the seventh value may be set to 0 and the eighth value may be set to 1. Alternatively, the seventh value may be set to false and the eighth value may be set to true. The seventh and eighth values ​​in the embodiments of the present application are not limited in any way.

[0305] Taking the seventh value as 1 and the eighth value as 0 as an example, in this embodiment of the present application, if the value of the fourth identification information is 1, it can be determined that the first filter is not used to filter the current color component of the current block. Otherwise, if the value of the fourth identification information is 0, the first filter can be used to filter the current color component of the current block.

[0306] Furthermore, in an embodiment of the present application, when it is determined based on the fourth identification information that the current color component of the current block is filtered using the first filter, the process of determining a reconstructed block of the current block based on the scale factor and the filter coefficient may be continued.

[0307] That is to say, in an embodiment of the present application, after determining the fourth identification information according to the APS unit, if the fourth identification information indicates that the current color component of the current block is filtered using the first filter, then the current color component of the current block can be further CCALF filtered according to the scale factor and filter coefficient corresponding to the current color component, and finally the reconstructed block of the current block is determined.

[0308] Furthermore, in an embodiment of the present application, the first scale factor information corresponding to the current color component may be determined according to the APS unit.

[0309] It should be noted that, in the embodiments of the present application, the CCALF parameter information may include first scale factor information. Specifically, the APS unit may include first scale factor information indicating the scale factor corresponding to the current color component. The first scale factor information corresponding to the current color component may be determined by parsing the APS unit.

[0310] Furthermore, in an embodiment of the present application, a filter coefficient corresponding to the current color component may be determined according to an APS unit.

[0311] It should be noted that, in the embodiment of the present application, the CCALF parameter information may include a filter coefficient, that is, the APS unit may include the filter coefficient corresponding to the current color component. The filter coefficient corresponding to the current color component may be determined by parsing the APS unit.

[0312] It is understood that in the embodiment of the present application, the filter coefficient determined by the decoded code stream can be represented by 4 bits, wherein 1 bit is used to determine the sign of the filter coefficient and 3 bits are used to determine the value of the filter coefficient.

[0313] For example, in some embodiments, the value of the most significant bit can be used to determine the sign of the filter coefficient, for example, 1 indicates a negative sign and 0 indicates a positive sign, and the other three bits are used to determine the value of the filter coefficient. For example, -32 can be represented by 1101 using 4 bits, and 32 can be represented by 0101 using 4 bits.

[0314] That is to say, in an embodiment of the present application, when it is determined that the current color component of the current image is filtered using the first filter, the CCALF parameter information determined by parsing the APS unit corresponding to the current image may include at least fourth identification information, first scale factor information, and filter coefficients.

[0315] Exemplarily, in some embodiments, the CCALF parameter information may include at least one or more of the following information: an index in the candidate list (first scale factor information), the number of filter groups, the filter order, the filter coefficients (filter coefficients), whether the CTU uses CCALF (fourth identification information), and the filter category used by the CTU.

[0316] It should be noted that, for a video image, the video image can be divided into multiple image blocks, each image block to be decoded can be called a decoding block, and the current block here specifically refers to the decoding block currently to be predicted. The current block can be a CTU, or even a coding unit (CU), prediction unit (PU), etc., and this embodiment of the application does not impose any limitation.

[0317] A reconstructed block of the current block is determined according to the scale factor and the filter coefficient.

[0318] In an embodiment of the present application, if it is determined that the current color component of the current image is filtered using the first filter, then after determining the scale factor and filter coefficient corresponding to the current color component, the reconstructed block of the current block can be further determined based on the scale factor and filter coefficient.

[0319] Furthermore, in an embodiment of the present application, when determining the reconstructed block of the current block based on the scale factor and the filter coefficient, for the current pixel in the current block, the filtered reconstructed value of the current color component of the current pixel can be determined based on the brightness reconstruction value of the reference pixel corresponding to the current pixel, the brightness reconstruction value of the current pixel, the reconstruction value of the current color component of the current pixel, the scale factor and the filter coefficient; and then the reconstructed block of the current block can be determined based on the filtered reconstructed value of the current color component of the current pixel.

[0320] It should be noted that in the embodiments of the present application, after determining the scale factor and filter coefficient corresponding to the current color component, for any pixel in the current block, the luminance reconstruction value of the reference pixel can be further combined with the luminance reconstruction value of the pixel to filter the reconstruction value of the current color component of the pixel, and ultimately determine the filtered reconstruction value of the current color component of the pixel. By sequentially traversing some or all of the pixels in the current block, the filtered reconstruction values ​​of the current color components of some or all of the pixels are obtained, thereby determining that the current block corresponds to the reconstructed block of the current color component.

[0321] Exemplarily, in some embodiments, based on the above formula (6), for the current pixel, the reconstruction value recC of the current color component of the current pixel, the brightness reconstruction value recY(i) of the reference pixel i, the brightness reconstruction value recY(x) of the current pixel, the scale factor scale of the current color component and the filter coefficient Filtering is performed to ultimately determine a filtered reconstructed value recC′ of the current color component of the current pixel.

[0322] It should be noted that, in an embodiment of the present application, when determining the reconstructed block of the current block based on the filtered reconstruction value of the current color component of the current pixel, for the filtered pixels, the filtered reconstruction value can be written into the reconstructed block, and for the pixels that are not filtered, the reconstruction value of the pixel can be directly written into the reconstructed block.

[0323] That is, in the embodiment of the present application, all or part of the pixels of the current block may be filtered. Pixels that require filtering are written into the reconstructed image after filtering, while pixels that do not require filtering are directly written into the reconstructed image.

[0324] In summary, the decoding method proposed in this application has designed a method for adaptive filter precision. In CCALF technology, the optimal scaling factor is adaptively selected for the color components within a frame of an image. All filters for the same color component in the same frame use the same scaling factor, which can reduce bit costs. Furthermore, within the CCALF algorithm framework, it can more closely approach the global optimal solution, improving coding performance.

[0325] It is understood that in the embodiment of the present application, at the decoding end, if the current color component of the current image is filtered using the first filter, then the corresponding APS unit can be selected based on the APS ID used by the current image, and the scale factor of the current color component can be obtained based on the index of the scale factor corresponding to the current color component in the APS unit in the candidate list. It should be noted that all filters of the current color component of the current image use this scale factor.

[0326] For example, in some embodiments, the syntax and semantics of the ECM are used as an example to illustrate the changes in the syntax and semantics of the decoding method proposed in the embodiments of the present application:

[0327] alf_cross_component_cb_coeff_prec_idx represents the index of the optimal scale factor for the chroma U component in the candidate list (scale factor candidate list). In the current implementation, the number of candidate scale factors in the scale factor candidate list, N, is set to 4, so only 2 bits are required to encode this index. alf_cross_component_cr_coeff_prec_idx represents the optimal scale factor index for the chroma V component.

[0328] For example, in some embodiments, FIG7 shows test results 1 of the decoding method proposed in the present application, and FIG8 shows test results 2 of the decoding method proposed in the present application. The decoding method proposed in the present application was implemented in the reference software ECM-10.0. The number of candidate scale factors in the scale factor candidate list was set to N = 4, and the scale factor candidate list was {7, 8, 9, 10}. A portion of the test sequences required by ECM were tested under full intra (AI) configuration conditions. The test results are shown in FIG7 . The average BD-rate changes for the Y, U, and V components under Class B, C, and D were 0.00%, -0.22%, and -0.33%, respectively. A portion of the test sequences required by ECM were tested under random access configuration conditions. The test results are shown in FIG8 . The average BD-rate changes for the Y, U, and V components under Class B, C, and D were 0.00%, -0.36%, and -0.48%, respectively. These test results demonstrate that the decoding method proposed in the present application improves encoding performance.

[0329] That is to say, the decoding method proposed in the embodiment of the present application enables the common CCALF to obtain additional performance gains while the complexity of the encoding end and the decoding end remains almost unchanged.

[0330] Class represents the video category, Sequence represents the specific test sequence, and Y, Cb, and Cr represent the performance of the three video components, luma and chroma. The values ​​in the table represent BD-rate, a measure of algorithm performance that indicates the change in bitrate and Peak Signal to Noise Ratio (PSNR) (or SSIM) compared to the original encoding algorithm. A negative value indicates improved performance, and a larger absolute value indicates a greater improvement.

[0331] An embodiment of the present application provides a decoding method. At a decoding end, a code stream is decoded to determine first identification information. When it is determined that the first filter is to be used to filter the current color component of the current image, a scale factor and filter coefficient corresponding to the current color component are determined. A reconstructed block of the current block is determined based on the scale factor and filter coefficient. That is, in an embodiment of the present application, the encoding end can adaptively determine a corresponding scale factor for the current color component of the current image. When it is determined that the first filter is to be used to filter the current color component of the current image, the decoding end can perform CCALF filtering on the current color component using the scale factor corresponding to the current color component of the current image. Each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

[0332] Furthermore, in an embodiment of the present application, when filtering is performed by the ALF, the method for the decoder to perform decoding processing may include the following steps:

[0333] Step 301: Decode the code stream and determine first identification information.

[0334] In an embodiment of the present application, the code stream is decoded to determine first identification information, wherein the first identification information can be used to determine whether the current color component of the current image is filtered using ALF.

[0335] That is to say, when the decoding method proposed in the present application is applied to CCALF, the first identification information can be used to determine whether the current color component of the current image is filtered using CCALF; when the decoding method proposed in the present application is applied to ALF, the first identification information can be used to determine whether the current color component of the current image is filtered using ALF.

[0336] Exemplarily, in some embodiments, when the value of the first identification information is the fifth value, it can be determined that the current color component of the current image is not filtered using ALF.

[0337] Exemplarily, in some embodiments, when the value of the first identification information is the sixth value, it may be determined that the current color component of the current image is filtered using ALF.

[0338] Step 302: When it is determined that the current color component of the current image is to be filtered using ALF, fourth identification information is determined.

[0339] In an embodiment of the present application, after decoding the code stream and determining the first identification information, when it is determined to use ALF to filter the current color component of the current image, fourth identification information may be further determined.

[0340] It should be noted that, in the embodiment of the present application, the fourth identification information can be used to determine whether the current color component of the current image is filtered using non-fixed filter parameters in the ALF.

[0341] Exemplarily, in some embodiments, when the value of the fourth identification information is the ninth value, it may be determined that the current color component of the current image is not filtered using the non-fixed filter parameters in the ALF.

[0342] Exemplarily, in some embodiments, when the value of the fourth identification information is the tenth value, it can be determined that the current color component of the current image is filtered using the non-fixed filter parameters in the ALF.

[0343] It should be noted that, in an embodiment of the present application, the fourth identification information can be used to indicate whether the current color component of the current image is filtered using non-fixed filter parameters in the ALF. In addition, the ninth value and the tenth value are different, and the ninth value and the tenth value can be in parameter form or in digital form. Generally, the fourth identification information can be a parameter written in the PPS or a parameter written in the SPS. The fourth identification information can also be a flag, which is not limited here.

[0344] It should also be noted that if the fourth identification information is a flag, then in a specific example, the ninth value can be set to 1 and the tenth value can be set to 0; in another specific example, the ninth value can also be set to true and the tenth value can also be set to false; even in another specific example, the ninth value can also be set to 0 and the tenth value can also be set to 1; or, the ninth value can also be set to false and the tenth value can also be set to true. The ninth value and the tenth value in the embodiment of the present application are not limited in any way.

[0345] Taking the ninth value as 1 and the tenth value as 0 as an example, in the embodiment of the present application, if the value of the fourth flag information is 1, it can be determined that the current color component of the current image is not filtered using the non-fixed filter parameters in the ALF. Otherwise, if the value of the fourth flag information is 0, the current color component of the current image can be filtered using the non-fixed filter parameters in the ALF.

[0346] Step 303: When it is determined based on the fourth identification information that the current color component of the current image is filtered using non-fixed filter parameters in the ALF, determine a scale factor, a filter coefficient, and cropping information corresponding to the current color component.

[0347] In an embodiment of the present application, when it is determined based on the fourth identification information that the current color component of the current image is filtered using non-fixed filter parameters in the ALF, the scale factor, filter coefficient and cropping information corresponding to the current color component can be further determined.

[0348] It should be noted that in the embodiments of the present application, if, based on the fourth identification information, it is determined that the non-fixed filter parameters in the ALF filtering are used for filtering the current color component of the current image, it is necessary to further determine the scale factor, filter coefficients, and cropping information used in the ALF filtering process. The scale factor corresponds to the current color component of the current image, and the filter coefficients are related to the scale factor.

[0349] That is, in an embodiment of the present application, when performing ALF filtering on the current color component of the current image, a scale factor corresponding to the current color component of the current image can be used, that is, each color component corresponds to only one scale factor, and the scale factors corresponding to different color components can be the same or different, and this application does not specifically limit this.

[0350] It should be noted that, in the embodiments of the present application, the filter coefficients may be integer-processed filter coefficients. Specifically, at the encoding end, a scale factor may be selected to scale the solved floating-point filter coefficients, and then the scaled filter coefficients may be integer-processed to obtain integer filter coefficients.

[0351] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component, first scale factor information corresponding to the current color component may be determined first; and then the scale factor corresponding to the current color component may be determined based on the first scale factor information.

[0352] It should be noted that, in the embodiment of the present application, the first scale factor information can be used to determine the scale factor corresponding to the current color component. The first scale factor information can include any of the following information: an index value of the scale factor, a numerical value of the scale factor, or a related numerical value of the scale factor.

[0353] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component according to the first scale factor information, the scale factor corresponding to the current color component may be determined according to the first scale factor information and a scale factor candidate list.

[0354] It should be noted that, in an embodiment of the present application, if the first scale factor information is the index value of the scale factor corresponding to the current color component, then the candidate scale factor indicated by the index value of the scale factor in the scale factor candidate list can be determined as the scale factor corresponding to the current color component.

[0355] It can be understood that, in the embodiment of the present application, at least one scale factor candidate list may be preset, and the scale factor candidate list is used to determine the scale factor corresponding to the current color component.

[0356] It should be noted that, in the embodiment of the present application, the number of pre-set scaling factor candidate lists may be any integer greater than 0. For example, the number of scaling factor candidate lists may be 1 or 3, which is not specifically limited in the present application.

[0357] It is understandable that in the embodiments of the present application, for the encoder, the number of scaling factor candidate lists can be set; for the decoder, the number of scaling factor candidate lists can be set or determined based on list number information transmitted by the encoder.

[0358] Accordingly, in the embodiments of the present application, since the number of pre-set scaling factor candidate lists is an arbitrary value, after setting at least one scaling factor candidate list, list quantity information corresponding to the at least one scaling factor candidate list can also be written into the bitstream. Accordingly, at the decoding end, by decoding the bitstream, list quantity information indicating the number of scaling factor candidate lists can be determined. The number of scaling factor candidate lists can then be determined based on the list quantity information, thereby setting at least one scaling factor candidate list.

[0359] It should be noted that, in the embodiment of the present application, the preset scaling factor candidate list may include at least one scaling factor candidate, wherein at least one scaling factor candidate is greater than 0.

[0360] It is understandable that, in the embodiments of the present application, the number of candidate scale factors included in each preset scale factor candidate list may be any integer greater than 0. For example, the scale factor candidate list may include 4 candidate scale factors or 5 candidate scale factors, which is not specifically limited in the present application.

[0361] Accordingly, in the embodiment of the present application, for different scale factor candidate lists, the number of candidate scale factors included in each scale factor candidate list may be the same or different, which is not specifically limited in the present application.

[0362] For example, in some embodiments, three scale factor candidate lists are pre-set, wherein scale factor candidate list 1 includes four candidate scale factors, scale factor candidate list 2 includes seven candidate scale factors, and scale factor candidate list 3 includes two candidate scale factors.

[0363] It should be noted that, in the embodiment of the present application, the value of each candidate scaling factor included in the preset scaling factor candidate list may be any value greater than 0, and the present application does not impose any specific limitation thereto.

[0364] Illustratively, in some embodiments, the scale factor candidate list includes four candidate scale factors, and the values ​​of the four candidate scale factors are 7, 8, 9, and 10, respectively.

[0365] That is, in the embodiment of the present application, when the first scale factor information is the index value of the scale factor corresponding to the current color component, the corresponding scale factor can be determined from a preset scale factor candidate list according to the index value.

[0366] Further, in an embodiment of the present application, when determining the scale factor corresponding to the current color component according to the first scale factor information, the first scale factor information may be determined as the scale factor corresponding to the current color component.

[0367] It should be noted that, in the embodiment of the present application, if the first scale factor information is the value of the scale factor corresponding to the current color component, then the first scale factor information can be directly determined as the scale factor corresponding to the current color component.

[0368] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component according to the first scale factor information, conversion may be performed according to the first scale factor information, thereby determining the scale factor corresponding to the current color component.

[0369] It should be noted that, in the embodiment of the present application, if the first scale factor information is a related value of the scale factor corresponding to the current color component, then conversion can be further performed based on the first scale factor information to obtain the scale factor corresponding to the current color component.

[0370] For example, in some embodiments, after determining the first scale factor information, during the conversion process based on the first scale factor information, the result of a numerical operation between the first scale factor information and a preset value may be selected as the corresponding scale factor. The preset value may be any value and is not specifically limited in this application. For example, the first scale factor information may be summed with a value of 6 (a preset value), and the summed value may be determined as the corresponding scale factor.

[0371] It can be understood that, in the embodiment of the present application, the relevant numerical value of the scale factor may be a numerical value in other forms generated by converting the numerical value of the scale factor.

[0372] That is, in the embodiments of the present application, the first scale factor information transmitted from the encoder to the decoder can be in any form. For example, the first scale factor information includes but is not limited to an index value of the scale factor, a numerical value of the scale factor, and related numerical values ​​of the scale factor, which are not specifically limited in the present application.

[0373] It should be noted that in the embodiments of the present application, at the encoding end, the first scale factor information can be written into the bitstream in any manner and transmitted to the decoding end. Encoding the first scale factor information includes, but is not limited to, fixed-length coding, variable-length coding, or adaptive context coding, and is not specifically limited in the embodiments of the present application.

[0374] Furthermore, in an embodiment of the present application, when it is determined that the current color component of the current image is filtered using ALF, the code stream can be decoded to determine the APS index corresponding to the current image; then, the APS unit corresponding to the current image can be determined based on the APS index; finally, the fourth identification information can be determined based on the APS unit; wherein the fourth identification information is used to determine whether the current color component of the current block is filtered using ALF.

[0375] It should be noted that, in the embodiment of the present application, the APS index corresponding to the current image can be used to indicate the APS unit corresponding to the current image, wherein the APS index corresponding to the current image can be the APS ID corresponding to the current image.

[0376] That is, in an embodiment of the present application, if the first identification information indicates that the current color component of the current image is filtered using ALF, then the APS ID corresponding to the current image can be further determined, and the corresponding APS unit can be selected according to the APS ID corresponding to the current image.

[0377] It should be noted that, in the embodiment of the present application, the APS unit corresponding to the current image may include ALF parameter information corresponding to the current color component of the current image, wherein the ALF parameter information may be used for ALF filtering processing of the current color component of the current image.

[0378] That is to say, in an embodiment of the present application, the APS unit corresponding to the current image may include parameter information related to ALF filtering processing, namely ALF parameter information, and the ALF filtering processing of the current color component of the current image can be completed through the ALF parameter information.

[0379] It should be noted that, in an embodiment of the present application, the ALF parameter information may include fourth identification information. That is, the APS unit may include fourth identification information for indicating whether the current color component of the current block is filtered using ALF. The fourth identification information corresponding to the current block can be determined by parsing the APS unit.

[0380] That is, in the embodiment of the present application, the fourth identification information determined by the APS unit can determine whether the current color component of the current block is filtered using the ALF.

[0381] Exemplarily, in some embodiments, when the value of the fourth identification information is the seventh value, it may be determined not to use ALF to filter the current color component of the current block.

[0382] Exemplarily, in some embodiments, when the value of the fourth identification information is the eighth value, it may be determined that the current color component of the current block is filtered using ALF.

[0383] It should be noted that, in the embodiments of the present application, the fourth identification information may be used to indicate whether the current color component of the current block is filtered using ALF. Furthermore, the seventh value and the eighth value are different, and the seventh value and the eighth value may be in parameter form or in digital form. Typically, the fourth identification information may be a parameter written into the APS unit corresponding to the current image.

[0384] For example, in some embodiments, the seventh value may be set to 1 and the eighth value may be set to 0. In another specific example, the seventh value may be set to true and the eighth value may be set to false. In yet another specific example, the seventh value may be set to 0 and the eighth value may be set to 1. Alternatively, the seventh value may be set to false and the eighth value may be set to true. The seventh and eighth values ​​in the embodiments of the present application are not limited in any way.

[0385] Taking the seventh value being 1 and the eighth value being 0 as an example, in the embodiment of the present application, if the value of the first identification information is 1, it can be determined that the current color component of the current block is not filtered using ALF. Otherwise, if the value of the first identification information is 0, the current color component of the current block can be filtered using ALF.

[0386] Furthermore, in an embodiment of the present application, when it is determined based on the fourth identification information that the current color component of the current block is filtered using ALF, the process of determining the reconstructed block of the current block based on the scale factor, the filter coefficient and the cropping information can be continued.

[0387] That is to say, in an embodiment of the present application, after determining the fourth identification information according to the APS unit, if the fourth identification information indicates that the current color component of the current block is to be filtered using ALF, then the current color component of the current block can be further ALF filtered according to the scale factor, filter coefficient and cropping information corresponding to the current color component, and finally the filtered block of the current block is determined, and then the corresponding reconstructed block is determined.

[0388] Furthermore, in an embodiment of the present application, first scale factor information corresponding to the current color component may be determined according to an APS unit.

[0389] It should be noted that, in the embodiments of the present application, the ALF parameter information may include first scale factor information. That is, the APS unit may include first scale factor information indicating the scale factor corresponding to the current color component. The first scale factor information corresponding to the current color component may be determined by parsing the APS unit.

[0390] Furthermore, in an embodiment of the present application, the filter coefficient and cropping information corresponding to the current color component may be determined according to the APS unit.

[0391] It should be noted that in the embodiments of the present application, the ALF parameter information may include filter coefficients and cropping information. That is, the APS unit may include the filter coefficients and cropping information corresponding to the current color component. The filter coefficients and cropping information corresponding to the current color component may be determined by parsing the APS unit.

[0392] It is understood that in the embodiment of the present application, the filter coefficient determined by the decoded code stream can be represented by 4 bits, wherein 1 bit is used to determine the sign of the filter coefficient and 3 bits are used to determine the value of the filter coefficient.

[0393] For example, in some embodiments, the value of the most significant bit can be used to determine the sign of the filter coefficient, for example, 1 indicates a negative sign and 0 indicates a positive sign, and the other three bits are used to determine the value of the filter coefficient. For example, -32 can be represented by 1101 using 4 bits, and 32 can be represented by 0101 using 4 bits.

[0394] That is, in an embodiment of the present application, when it is determined that ALF is used to filter the current color component of the current image, the ALF parameter information determined by parsing the APS unit corresponding to the current image may include at least fourth identification information, first scale factor information, filter coefficients, and cropping information.

[0395] Exemplarily, in some embodiments, the ALF parameter information may include at least one or more of the following information: an index in the candidate list (first scale factor information), the number of filter groups, the filter order, the filter coefficients (filter coefficients), whether the CTU uses ALF (fourth identification information), and the filter category used by the CTU.

[0396] Further, in an embodiment of the present application, when it is determined based on the fourth identification information that the current color component of the current block is to be filtered using ALF, the category of the current color component of the sub-block of the current block can be calculated, and then the filtering coefficient of the current color component of the sub-block of the current block can be further determined based on the category of the current color component of the sub-block of the current block and the APS unit.

[0397] It should be noted that for a video image, the video image can be divided into multiple image blocks. Each image block to be decoded can be called a decoding block, and the current block here specifically refers to the decoding block currently to be predicted. The current block can be a CTU, or even a CU, PU, ​​etc., and this embodiment of the application does not impose any limitation.

[0398] Step 304: Determine a filtered block of the current block according to the scale factor, the filter coefficient, and the cropping information.

[0399] In an embodiment of the present application, if the fourth identification information indicates that the current color component of the current image is filtered using non-fixed filter parameters in the ALF, then after determining the scale factor, filter coefficient and cropping information corresponding to the current color component, the current block can be further ALF filtered according to the scale factor, filter coefficient and cropping information, thereby determining the filtered block of the current block.

[0400] Furthermore, in an embodiment of the present application, when determining the filtered block of the current block based on the scale factor, the filter coefficient, and the cropping information, for the current pixel in the current block, the filtered pixel value of the current color component of the current pixel is determined based on the reconstructed value of the reference pixel corresponding to the current pixel, the reconstructed value of the current pixel, the reference information of the current color component of the current pixel, the scale factor, the filter coefficient, and the cropping information; then, based on the filtered pixel value of the current color component of the current pixel, the filtered pixel block of the current block can be determined, that is, the filtered block of the current block is determined.

[0401] It should be noted that in the embodiments of the present application, after determining the scale factor, filter coefficient, and cropping information corresponding to the current color component, for any pixel in the current block, the brightness reconstruction value of the reference pixel can be further combined with the brightness reconstruction value of the pixel to filter the reconstruction value of the current color component of the pixel, and ultimately determine the filtered reconstruction value of the current color component of the pixel. By sequentially traversing some or all of the pixels in the current block, the filtered reconstruction values ​​of the current color components of some or all of the pixels are obtained, thereby determining that the current block corresponds to the reconstructed block of the current color component.

[0402] That is to say, the decoding method proposed in this application can be applied to both CCALF and ALF. The ALF iterative acquisition of ALF parameter information and filtering process are similar to those of CCALF.

[0403] Exemplarily, in some embodiments, at the encoder, the brightness and color components of the current image in the ALF adaptively select the optimal scale factor based on a set scale factor list, and write the scale factor and ALF parameter information into the bitstream for transmission to the decoder; at the decoder, the scale factor and ALF parameter information are determined by decoding the bitstream, and then the scale factor and ALF parameter information are used for filtering.

[0404] For example, in some embodiments, the syntax and semantics of the ECM are used as an example to illustrate the changes in the syntax and semantics of the decoding method proposed in the embodiments of the present application:

[0405] The embodiment of the present application provides a decoding method, in which, at the decoding end, a code stream is decoded and first identification information is determined; when it is determined that the current color component of the current image is filtered using ALF, fourth identification information is determined; when it is determined based on the fourth identification information that the current color component of the current image is filtered using the non-fixed filter parameters in the ALF, a scale factor, a filter coefficient, and cropping information corresponding to the current color component are determined, and a filtered block of the current block is determined based on the scale factor, the filter coefficient, and the cropping information. That is, in the embodiment of the present application, the encoding end can adaptively determine the corresponding scale factor for the current color component of the current image; at the decoding end, when it is determined that the current color component of the current image is filtered using ALF, the scale factor corresponding to the current color component of the current image can be used to perform ALF filtering on the current color component, wherein each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

[0406] Another embodiment of the present application provides an encoding method, which is applied to an encoder and is used to perform filtering processing using ALF or CCALF. FIG9 is a schematic diagram of the encoding method proposed in the embodiment of the present application. As shown in FIG9 , the encoding method performed by the encoder may include the following steps:

[0407] Step 401: Adaptively determine the filter coefficients and filter coefficient type parameters corresponding to the current image component of the current image.

[0408] In an embodiment of the present application, at the encoding end, the filter coefficients and filter coefficient type parameters corresponding to the current image components of the current image may be adaptively determined first, and then the filter coefficients and the filter coefficient type parameters may be written into the bitstream.

[0409] It should be noted that, in the embodiments of the present application, in the video image, the first image component, the second image component and the third image component are generally used to represent the coding block (Coding Block, CB); wherein, these three image components are a brightness component, a blue color component and a red color component, specifically, the brightness component is usually represented by the symbol Y, the blue color component is usually represented by the symbol Cb or U, and the red color component is usually represented by the symbol Cr or V; in this way, the video image can be represented in the YCbCr format or the YUV format.

[0410] It is understood that in the embodiments of the present application, the current image component of the current image may include a current brightness component or a current color component. The current color component of the current image may be understood as the blue color component of the current image or the red color component of the current image, i.e., the current color component may be a U component or a V component. This is not specifically limited in the present application.

[0411] Furthermore, in an embodiment of the present application, when adaptively determining the filter coefficients and filter coefficient type parameters corresponding to the current image component of the current image, the filter coefficients and the filter coefficient type parameters may be determined according to a rate-distortion optimization algorithm.

[0412] It can be understood that, in the implementation of the present application, the adaptive method for adaptively determining the filter coefficient representation (filter coefficient type parameter) includes but is not limited to the filter coefficient type parameter.

[0413] Furthermore, in the implementation of the present application, when determining the filter coefficient and the filter coefficient type parameter according to the rate-distortion optimization algorithm, the filter coefficient of the first representation can be first determined according to the first data processing strategy, and the first rate-distortion cost corresponding to the first representation can be determined; at the same time, the filter coefficient of the second representation can also be determined according to the second data processing strategy, and the second rate-distortion cost corresponding to the second representation can be determined; finally, the filter coefficient and the filter coefficient type parameter can be determined based on the first rate-distortion cost and the second rate-distortion cost.

[0414] It should be noted that, in the embodiment of the present application, the filter coefficient type parameter can be used to determine the representation form of the filter coefficient, wherein the representation form of the filter coefficient can include the first representation form or the second representation form.

[0415] For example, in some embodiments, the first representation may be an integer representation, and the second representation may be a power-exponential representation, which is not specifically limited in this application.

[0416] It should be noted that, in an embodiment of the present application, when determining the filter coefficient and the filter coefficient type parameter based on the first rate-distortion cost and the second rate-distortion cost, it can be selected that when the first rate-distortion cost is less than the second rate-distortion cost, the filter coefficient of the first representation form is determined as the filter coefficient, and the filter coefficient type parameter is set to indicate that the filter coefficient is the first representation form.

[0417] It should be noted that, in an embodiment of the present application, when determining the filter coefficient and the filter coefficient type parameter based on the first rate-distortion cost and the second rate-distortion cost, it can be selected that when the first rate-distortion cost is greater than the second rate-distortion cost, the filter coefficient of the second representation form is determined as the filter coefficient, and the filter coefficient type parameter is set to indicate that the filter coefficient is the second representation form.

[0418] It should be noted that, in an embodiment of the present application, when determining the filter coefficient and the filter coefficient type parameter based on the first rate-distortion cost and the second rate-distortion cost, it can be selected to determine the filter coefficient in the first representation or the second representation as the filter coefficient when the first rate-distortion cost is equal to the second rate-distortion cost. Accordingly, the filter coefficient type parameter can be set to indicate that the filter coefficient is in the first representation or the second representation.

[0419] Furthermore, in an embodiment of the present application, the first representation may represent a representation of the filter coefficients obtained by a first data processing strategy; wherein the first data processing strategy includes shaping.

[0420] Furthermore, in an embodiment of the present application, the second representation represents a representation of the filter coefficients obtained by a second data processing strategy; wherein the first data processing strategy includes shaping and mapping.

[0421] It will be appreciated that, in the embodiments of the present application, the encoder can select different data processing strategies to obtain filter coefficients, wherein the representation of the filter coefficients obtained under different data processing strategies is different. Accordingly, after adaptively determining the filter coefficients, the representation of the filter coefficients can be indicated by a filter coefficient type parameter. This filter coefficient type parameter can be written into the bitstream and transmitted to the decoder, so that the decoder can obtain the corresponding representation of the filter coefficients based on the filter coefficient type parameter.

[0422] For example, in some embodiments, at the encoding end, for the initially obtained floating-point filter coefficients, if the first data processing strategy is used to determine the filter coefficients, the floating-point filter coefficients may be multiplied by a scale factor. The value of bitShift is 7. The filter coefficients are then rounded off to convert them into integers, thereby obtaining the filter coefficients in a first representation form, which may be an integer representation form.

[0423] Exemplarily, in some embodiments, at the encoding end, for the initially obtained floating-point filter coefficients, if the second data processing strategy is used to determine the filter coefficients, then the floating-point filter coefficients can be first multiplied by a scaling factor 1<<bitShift, where bitShift has a value of 7. Then, the filter coefficients are rounded to convert them into integers, and then the integer coefficients are mapped to {0, ±1, ±2, ±4, ±8, ±16, ±32, ±64} by rounding, so as to obtain the filter coefficients in the second representation form, and this second representation form can be an exponentiated representation form.

[0424] Further, in the embodiments of the present application, after determining that the representation form of the filter coefficients is the first representation form or the second type, the value of the filter coefficient type parameter can be further set, so that the decoding end can determine the representation form of the filter coefficients based on the value of the filter coefficient type parameter.

[0425] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current luminance component, then the filter coefficient type parameter can be represented by the syntax element alf_luma_coeff_expression, that is, alf_luma_coeff_expression represents the coefficient representation method (representation form of filter parameters) used for the ALF luminance component. If the value of alf_luma_coeff_expression is 0, then the ordinary integer representation is adopted, that is, it is determined that the representation form of the filter coefficients is the first representation form. If the value of alf_luma_coeff_expression is 1, then the exponentiated representation is adopted, that is, it is determined that the representation form of the filter coefficients is the second representation form.

[0426] Of course, the values of alf_luma_coeff_expression are not limited to 0 and 1, and the present application does not make specific limitations.

[0427] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current color component, then the filter coefficient type parameter can be represented by the syntax element alf_chroma_coeff_expression, that is, alf_chroma_coeff_expression represents the coefficient representation method (representation form of filter parameters) used for the ALF color component. If the value of alf_chroma_coeff_expression is 0, then the ordinary integer representation is adopted, that is, it is determined that the representation form of the filter coefficients is the first representation form. If the value of alf_chroma_coeff_expression is 1, then the exponentiated representation is adopted, that is, it is determined that the representation form of the filter coefficients is the second representation form.

[0428] Of course, the value of alf_chroma_coeff_expression is not limited to 0 and 1, and this application does not make any specific limitations.

[0429] For example, in some embodiments, if the first filter is a CCALF filter and the current image component is a current color component, such as a Cb component, the filter coefficient type parameter may be represented by the syntax element alf_cross_component_cb_coeff_expressio, that is, alf_cross_component_cb_coeff_expression represents the coefficient representation method (representation form of the filter parameter) used by the CCALF color component. If the value of alf_cross_component_cb_coeff_expression is 0, ordinary integer representation is adopted, that is, the representation form of the filter coefficient is determined to be the first representation form; if the value of alf_cross_component_cb_coeff_expression is 1, power exponential representation is adopted, that is, the representation form of the filter coefficient is determined to be the second representation form.

[0430] Of course, the value of alf_cross_component_cb_coeff_expression is not limited to 0 and 1, and this application does not make any specific limitation.

[0431] Exemplarily, in some embodiments, if the first filter is CCALF and the current image component is a current color component, such as a Cr component, the filter coefficient type parameter can be represented by the syntax element alf_cross_component_cr_coeff_expressio, that is, alf_cross_component_cr_coeff_expressio represents the coefficient representation method used by the CCALF color component (the representation form of the filter parameter). If the value of alf_cross_component_cr_coeff_expressio is 0, ordinary integer representation is adopted, that is, the representation form of the filter coefficient is determined to be the first representation form; if the value of alf_cross_component_cr_coeff_expressio is 1, power exponential representation is adopted, that is, the representation form of the filter coefficient is determined to be the second representation form.

[0432] Of course, the value of alf_cross_component_cr_coeff_expressio is not limited to 0 and 1, and this application does not make any specific limitations.

[0433] Furthermore, in an embodiment of the present application, the filter coefficient type parameter may include at least one type parameter corresponding to the current image.

[0434] It should be noted that, in the embodiments of the present application, the filter coefficient type parameter may include any number of type parameters, which is not specifically limited in the present application.

[0435] That is to say, in the embodiments of the present application, there is no restriction on the specific number of filter coefficient representations (filter coefficient type parameters).

[0436] For example, in some embodiments, for the luminance component ALF, the number of coefficient representations is not limited, that is, the number of filter coefficient type parameters is not limited. The filter coefficient type parameter can use the same coefficient representation for a frame, that is, a frame has only one coefficient representation; it can also use the same coefficient representation for each region, that is, a frame can have N coefficient representations, where N is the number of regions; it can also use a coefficient representation for each filter, that is, a frame can have M*N coefficient representations, where N is the number of regions and M is the number of filters in each region.

[0437] For example, in some embodiments, for the chrominance component ALF, there is no limit on the number of coefficient representations, that is, there is no limit on the number of filter coefficient type parameters. The filter coefficient type parameter can use the same coefficient representation for a frame, that is, a frame has only one coefficient representation; or it can use a coefficient representation for each filter, that is, a frame can have N coefficient representations, where N is the number of filters.

[0438] For example, in some embodiments, for CCALF, there is no limit on the number of coefficient representations, that is, the number of filter coefficient type parameters is not limited. The filter coefficient type parameter can use the same coefficient representation for a frame, that is, a frame has only one coefficient representation; or it can use a coefficient representation for each filter, that is, a frame can have N coefficient representations, where N is the number of filters.

[0439] Step 402: Determine filter identification information based on the filter coefficient, and write the filter identification information into the bitstream; wherein the filter identification information is used to determine whether to use the first filter to filter the current image component of the current image.

[0440] In an embodiment of the present application, after adaptively determining the filter coefficient and filter coefficient type parameter corresponding to the current image component of the current image, filter identification information can be further determined based on the filter coefficient, and the filter identification information can be written into the code stream; wherein, the filter identification information is used to determine whether to use the first filter to filter the current image component of the current image.

[0441] Furthermore, in an embodiment of the present application, the first filter may include CCALF or ALF. That is, in the present application, the filter identification information may be used to determine whether the current image component of the current image is filtered using CCALF, or the filter identification information may be used to determine whether the current image component of the current image is filtered using ALF.

[0442] It can be understood that in the embodiment of the present application, corresponding to CCALF or ALF, when determining whether to use the first filter for filtering through filtering identification information, the filtering identification information may include first identification information or second identification information.

[0443] Accordingly, in an embodiment of the present application, the first identification information is used to determine whether to use CCALF for filtering; the second identification information is used to determine whether to use ALF for filtering.

[0444] Exemplarily, in some embodiments, if the filtering identification information is the first identification information, then the first identification information can be used to indicate whether to use CCALF; if the filtering identification information is the second identification information, then the second identification information can be used to indicate whether to use ALF.

[0445] Furthermore, in an embodiment of the present application, a first generation value may be determined when the current image component of the current image is not filtered using the first filter. Alternatively, a second generation value may be determined based on the filter coefficients when the current image component of the current image is filtered using the first filter. Furthermore, filter identification information may be determined based on the first and second generation values.

[0446] It should be noted that, in an embodiment of the present application, when the first generation value is less than the second generation value, the value of the filtering identification information is set to a first value, so that the filtering identification information indicates that the first filter is not used to filter the current image component of the current image; when the first generation value is greater than the second generation value, the value of the filtering identification information is set to a second value, so that the filtering identification information indicates that the first filter is used to filter the current image component of the current image.

[0447] It can be understood that in an embodiment of the present application, when the first generation value is equal to the second generation value, the value of the filter identification information can be set to the first value or the second value, so that the filter identification information indicates that the current image component of the current image is not filtered using the first filter, or indicates that the current image component of the current image is filtered using the first filter.

[0448] Further, in an embodiment of the present application, after determining whether to use the first filter to filter the current image component of the current image, the value of the filtering identification information can be set so that the value of the filtering identification information indicates whether to use the first filter to filter the current image component of the current image.

[0449] Exemplarily, in some embodiments, when it is determined that the current image component of the current image is not filtered using the first filter, the value of the filtering identification information is set to a first value.

[0450] Exemplarily, in some embodiments, when it is determined that the current image component of the current image is filtered using the first filter, the value of the filtering identification information is set to a second value.

[0451] It should be noted that, in an embodiment of the present application, the filter identification information can be used to indicate whether the current image component of the current image is filtered using the first filter. In addition, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Under normal circumstances, the filter identification information can be a parameter written in a picture parameter set (PPS) or a parameter written in a sequence parameter set (SPS). The filter identification information can also be a flag, which is not limited here.

[0452] It should also be noted that if the filter identification information is a flag, then in a specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first value and the second value in the embodiment of the present application are not limited in any way.

[0453] Taking the first value as 1 and the second value as 0 as an example, in the embodiment of the present application, if the value of the filter identification information is 1, it can be determined that the first filter is not used to filter the current image component of the current image. Otherwise, if the value of the filter identification information is 0, the first filter can be used to filter the current image component of the current image.

[0454] Thus, in the embodiment of the present application, the filter identification information can be used to indicate whether to use CCALF or ALF to filter the current luminance component or the current color component of the current image. If the filter identification information indicates that the current image component of the current image is filtered using the first filter, then correspondingly, the current color component of the current image can also be filtered using the first filter, or the current color component of the current image can be filtered using ALF.

[0455] Furthermore, in an embodiment of the present application, when it is determined that the current image component of the current image is filtered using the first filter, the APS unit corresponding to the current image can be determined; then, the APS index corresponding to the current image can be determined based on the APS unit; finally, the APS unit and the APS index can be written into the code stream.

[0456] It should be noted that, in the embodiment of the present application, the APS index corresponding to the current image can be used to indicate the APS unit corresponding to the current image, wherein the APS index corresponding to the current image can be the APS ID corresponding to the current image.

[0457] That is to say, in an embodiment of the present application, if it is determined that the current image component of the current image is filtered using the first filter, then the APS unit corresponding to the current image can be further determined, and then the APS ID corresponding to the current image can be determined based on the APS unit corresponding to the current image.

[0458] Furthermore, in an embodiment of the present application, when it is determined that the current image component of the current image is filtered using the first filter, the filter coefficient and the filter coefficient type parameter may also be written into the APS unit.

[0459] Accordingly, in an embodiment of the present application, at the decoding end, the filter coefficient type parameter corresponding to the current image component can be determined according to the APS unit.

[0460] Furthermore, in an embodiment of the present application, the third-generation value of the new first filter corresponding to the filter coefficient can also be determined; at the same time, the fourth-generation values ​​of other filters can be determined; wherein, the other filters include at least a fixed first filter and / or a reused first filter; and then the third identification information can be determined based on the third-generation value and the fourth-generation value, and the third identification information can be written into the APS unit.

[0461] It should be noted that, in the embodiment of the present application, the first fixed filter may include a fixed filter group corresponding to the current image component.

[0462] It should be noted that, in the embodiment of the present application, the reused first filter may include the first filter of the same image component of the frame previously filtered using the first filter corresponding to the current image.

[0463] Accordingly, in an embodiment of the application, the fourth cost value of other filters may include a cost value determined when filtering using the fixed first filter, and / or a cost value determined when filtering using the multiplexed first filter.

[0464] Further, in an embodiment of the present application, when determining the third identification information based on the third generation value and the fourth generation value, when the third generation value is less than the fourth generation value, the value of the third identification information can be set to the third value, so that the third identification information indicates that the new first filter is not used; when the third generation value is greater than the fourth generation value, the value of the third identification information can be set to the fourth value, so that the third identification information indicates that the new first filter is used.

[0465] It can be understood that in an embodiment of the present application, when determining the third identification information based on the third generation value and the fourth generation value, the value of the third identification information can be set to a third value or a fourth value when the third generation value is equal to the fourth generation value, so that the third identification information indicates not to use the new first filter, or indicates to use the new first filter.

[0466] Furthermore, in an embodiment of the present application, after determining the third identification information, the third identification information can also be written into the APS unit, so that the third identification information can be determined based on the APS unit at the decoding end; and when it is determined to use the new first filter based on the third identification information, the filter coefficient type parameter determination process can be executed.

[0467] It should be noted that, in the embodiment of the present application, the third identification information can be used to determine whether to use a new first filter, that is, based on the third identification information, it can be determined whether the current image component uses a new CCALF or a new ALF.

[0468] It can be understood that in an embodiment of the present application, at the decoding end, if it is determined to use a new filter based on the third identification information, it is necessary to further analyze the filter parameters, so it is necessary to first determine the filter coefficient type parameters, and then use the filter coefficient type parameters to further determine the filter coefficient.

[0469] Furthermore, in an embodiment of the present application, after determining whether the current image component uses a new first filter, the value of the third identification information can be set, so that the value of the third identification information can be used at the decoding end to determine whether the current image component uses a new first filter.

[0470] Exemplarily, in some embodiments, when it is determined that the new first filter is not to be used, the value of the third filter identification information is set to the third value; when it is determined that the new first filter is to be used, the value of the third filter identification information is set to the fourth value.

[0471] It should be noted that, in the embodiments of the present application, the third identification information can be used to indicate whether the current image component is filtered using the new first filter. Furthermore, the third value and the fourth value are different, and the third value and the fourth value can be in parameter form or in digital form. Typically, the third identification information can be a parameter written into the APS unit corresponding to the current image.

[0472] For example, in some embodiments, the third value may be set to 1 and the fourth value may be set to 0. In another specific example, the third value may be set to true and the fourth value may be set to false. In yet another specific example, the third value may be set to 0 and the fourth value may be set to 1. Alternatively, the third value may be set to false and the fourth value may be set to true. The third value and the fourth value in the embodiments of the present application are not limited in any way.

[0473] Taking the third value being 1 and the fourth value being 0 as an example, in the embodiment of the present application, if the value of the third identification information is 1, it can be determined that the new first filter is not used to filter the current image component. Otherwise, if the value of the third identification information is 0, it can be determined that the new first filter is used to filter the current image component.

[0474] Step 403: When it is determined that the first filter is used to filter the current image component of the current image, the filter coefficient and the filter coefficient type parameter are written into the bitstream.

[0475] In an embodiment of the present application, when it is determined that the first filter is used to filter the current image component of the current image, the filter coefficient and the filter coefficient type parameter may be written into the bitstream.

[0476] Furthermore, in an embodiment of the present application, when writing the filter coefficient into the bitstream, it is possible to choose to encode the filter coefficient according to the exponential Golomb coding method when the filter coefficient type parameter indicates that the filter coefficient is in the first representation form; it is also possible to choose to encode the filter coefficient according to the fixed-length coding method when the filter coefficient type parameter indicates that the filter coefficient is in the second representation form.

[0477] It can be understood that in an embodiment of the present application, at the encoding end, if the first data processing strategy is used to determine the filter coefficient, then after obtaining the filter coefficient in the first representation form, the filter coefficient can be encoded using the exponential Golomb coding method.

[0478] Accordingly, in an embodiment of the present application, at the decoding end, if the filter coefficient is determined to be in the first representation form based on the filter coefficient type parameter, the first parsing method corresponding to the exponential Golomb coding can be used to complete the parsing of the filter coefficient.

[0479] It can be understood that in the embodiment of the present application, at the encoding end, if the second data processing strategy is used to determine the filter coefficient, then after obtaining the filter coefficient in the second representation form, the filter coefficient can be encoded using a fixed-length coding method.

[0480] Accordingly, in an embodiment of the present application, at the decoding end, if the filter coefficient is determined to be in the second representation based on the filter coefficient type parameter, the second parsing method corresponding to the fixed-length coding can be used to complete the parsing of the filter coefficient.

[0481] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current luminance component, then the filter coefficient type parameter can be represented by the syntax element alf_luma_coeff_expression; if the value of alf_luma_coeff_expression indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Columbus coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_luma_coeff_expression indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0482] Exemplarily, in some embodiments, if the first filter is ALF and the current image component is the current color component, then the filter coefficient type parameter can be represented by the syntax element alf_chroma_coeff_expression; if the value of alf_chroma_coeff_expression indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Golomb coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_chroma_coeff_expression indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0483] Exemplarily, in some embodiments, if the first filter is CCALF and the current image component is the current color component, such as the Cb component, then the filter coefficient type parameter can be represented by the syntax element alf_cross_component_cb_coeff_expressio. If the value of alf_cross_component_cb_coeff_expressio indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Golomb coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_cross_component_cb_coeff_expressio indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0484] Exemplarily, in some embodiments, if the first filter is CCALF and the current image component is the current color component, such as the Cr component, then the filter coefficient type parameter can be represented by the syntax element alf_cross_component_cr_coeff_expressio. If the value of alf_cross_component_cr_coeff_expressio indicates that the representation of the filter coefficient is the first representation, then the decoding method corresponding to the exponential Golomb coding, that is, the first parsing method, can be used to determine the filter coefficient; if the value of alf_cross_component_cr_coeff_expressio indicates that the representation of the filter coefficient is the second representation, then the decoding method corresponding to the fixed-length coding, that is, the second parsing method, can be used to determine the filter coefficient of the second representation, and then the filter coefficient of the second representation is mapped to determine the filter coefficient of the current image component.

[0485] Furthermore, in an embodiment of the present application, after determining the filter coefficient corresponding to the current image component according to the filter coefficient type parameter, a reconstructed block of the current block in the current image may be further determined according to the filter coefficient.

[0486] It should be noted that, in the embodiment of the present application, the scale factor corresponding to the current image component may be determined first, that is, the scale factor corresponding to the current luminance component or the scale factor corresponding to the current chrominance component may be determined.

[0487] Furthermore, in an embodiment of the present application, when determining the reconstructed block of the current block in the current image according to the filter coefficient, the reconstructed block of the current block in the current image may be determined according to the scale factor and the filter coefficient.

[0488] That is, in the embodiment of the present application, after determining the scale factor and the filter coefficient corresponding to the current image component, filtering may be further performed according to the scale factor and the filter coefficient to determine a reconstructed block of the current block.

[0489] To sum up, through the encoding method proposed in the above steps 401 to 403, at the encoding end, an adaptive method can be used to represent the ALF and CCALF filter coefficients to determine the representation form of the filter coefficients, and the filter coefficient type parameter indicating the representation form of the filter coefficients is transmitted to the decoding end, so that the corresponding filter coefficients can be adaptively parsed at the decoding end through the filter coefficient type parameter, which increases the flexibility of encoding and improves the encoding efficiency.

[0490] In other words, the encoding method proposed in the embodiments of the present application includes a method for adaptively representing filter coefficients. In the ALF and CCALF techniques, the filter coefficients for ALF and CCALF within a frame of an image are adaptively selected and acquired using different data processing strategies, thereby enabling the use of different representations to represent the corresponding filter coefficients, including but not limited to integer representation or power exponent representation.

[0491] It can be seen from this that the encoding method proposed in the embodiment of the present application no longer limits the filter coefficients to a fixed representation method, but can adaptively select a filter coefficient representation that can achieve better filtering effects. That is, in the coefficient integerization process, the filter independently selects the coefficient representation form, for example, from the two forms of ordinary integer representation (used in ALF in ECM) and power exponential representation (used in CCALF in ECM), the best representation form is adaptively selected, thereby improving the encoding and decoding efficiency and improving the compression performance.

[0492] For example, in some embodiments, for ALF, the following uses the VVC syntax and semantics level as an example to illustrate the changes at the syntax and semantics level:

[0493] For example, in some embodiments, for CCALF, the following uses the VVC syntax and semantics level as an example to illustrate the changes at the syntax and semantics level:

[0494] alf_luma_coeff_expression indicates the coefficient representation used for the ALF luma component. If it is 0, ordinary integer representation is used, and the absolute value of the coefficient is encoded using Exponential Golomb coding. If it is 1, power exponential representation is used, and the absolute value of the coefficient is directly encoded using 3-bit fixed-length coding.

[0495] alf_chroma_coeff_expression specifies the coefficient representation used for the ALF chroma component. If it is 0, normal integer representation is used, and the absolute values ​​of the coefficients are encoded using Exponential Golomb coding. If it is 1, power representation is used, and the absolute values ​​of the coefficients are encoded directly using 3-bit fixed-length coding.

[0496] alf_cross_component_cb_coeff_expression specifies the coefficient representation used for the CCALF chroma Cb component. If 0, normal integer representation is used, and the absolute values ​​of the coefficients are encoded using Exponential Golomb coding. If 1, power representation is used, and the absolute values ​​of the coefficients are encoded directly using 3-bit fixed-length coding.

[0497] alf_cross_component_cr_coeff_expression specifies the coefficient representation used for the CCALF chrominance (Cr) component. If 0, normal integer representation is used, and the absolute values ​​of the coefficients are encoded using Exponential Golomb coding. If 1, power representation is used, and the absolute values ​​of the coefficients are encoded directly using a 3-bit fixed-length code.

[0498] It should be noted that, in the embodiments of the present application, the representation of the power exponentiation is not limited to the value of the base in the power exponentiation, which can be 2 in implementation, but can also be any positive integer.

[0499] Exemplarily, in some embodiments, for the ALF luminance component:

[0500] Step 1: Divide the luminance component into several blocks of 2x2, and these blocks do not overlap with each other.

[0501] Step 2: Calculate the category information 1 of each 2x2 block in step 1. Category information 1 is used to determine the corresponding fixed filter.

[0502] Step 3: After calculating the category information 1 of all blocks in step 1, select a corresponding fixed filter according to the category information 1 to filter the pixels and residuals in the 2x2 block.

[0503] Step 4: Perform Gaussian filtering on the pixel brightness component before deblocking.

[0504] Step 5: Calculate the category information 2 of each 2x2 block in step 1. The category information 2 is used to determine the corresponding fixed filter.

[0505] Step 6: After calculating the category information 2 of all blocks in step 1, select a corresponding fixed filter to filter the 2x2 block according to the category information 2. The input information of this filtering is the filtering output in step 3.

[0506] Step 7: Calculate the covariance matrix and error vector of each pixel brightness component.

[0507] Step 8: Calculate category information 3, category information 4, and category information 5 for each 2x2 block in step 1. Category information 3 to 5 are used to determine a new filter bank category division method.

[0508] Step nine: Divide a frame of image into several regions, and the smallest unit of each region is CTU.

[0509] Step 10: For each region, under category information 3 - 5, accumulate the covariance matrix and error vector of the pixel brightness components of the same category in the same category information respectively, and then construct the Wiener - Hopf equation. Calculate the filter coefficients of this category in this category information by solving the equation. The filter coefficients are of floating - point type.

[0510] Step 11: Multiply each filter coefficient by a fixed scaling factor 1 << bitShift, where bitShift takes the value of 7. Then round the filter coefficients to convert them into integer numbers.

[0511] Step 12: Parse the corresponding brightness component filter information from the available APS. The brightness component filter information includes: the number of region partitions, the number of filters for each region, the integer - type coefficients of each filter, and the category partitioning method used for each region, etc. Information is collectively referred to as filter information hereinafter.

[0512] Step 13: Determine the filter index used for each CTU brightness component. Calculate the rate - distortion cost 1 when the CTU brightness component is first filtered using a fixed filter according to Step 3. Calculate the rate - distortion cost 2 when the CTU brightness component is second filtered using a fixed filter according to Step 7. Filter the current CTU brightness component using the filter information parsed in Step 12 and calculate the corresponding rate - distortion cost 3. Calculate the rate - distortion cost 4 when the CTU brightness component is filtered using a new filter. If the rate - distortion cost 1 is the smallest, the current CTU brightness component is filtered using the first fixed filter. If the rate - distortion cost 2 is the smallest, the current CTU brightness component is filtered using the second fixed filter. If the rate - distortion cost 3 is the smallest, the current CTU brightness component is filtered using the filter in the APS. Otherwise, filter the CTU brightness component using the new filter.

[0513] Step 14: Determine whether each CTU brightness component is filtered. Calculate the rate - distortion cost 4 when the current CTU brightness component is not filtered, and compare it with the minimum rate - distortion cost determined in Step 13. If the rate - distortion cost 4 is smaller, the current CTU brightness component does not undergo ALF filtering. Otherwise, the current CTU brightness component will undergo ALF filtering.

[0514] Step 15: Determine the rate - distortion cost of the current frame brightness component. Calculate the rate - distortion cost of the current frame according to the CTU brightness component filtering information and the corresponding brightness component filter information. The CTU brightness component filtering information includes: whether each CTU brightness component uses ALF for filtering and the filter index when using ALF for filtering. Information is collectively referred to as CTU brightness component filtering information hereinafter.

[0515] Step Sixteen: Determine the optimal state information of the current frame's luminance component. Update the CTU luminance component filtering information and the luminance component filter information, and repeat Steps Nine to Fifteen. Select a set of CTU luminance component filtering information and luminance component filter information with the minimum rate distortion cost for the current frame as the optimal state information of the current frame's luminance component, and record the minimum rate distortion cost as rate distortion cost 5.

[0516] Step Seventeen: Divide an image frame into several regions, and the minimum unit of each region is a CTU.

[0517] Step Eighteen: For each region, under category information 3 - 5, accumulate the covariance matrix and error vector of the luminance components of the same category pixels in the same category information respectively, and then construct a Wiener - Hopf equation. Calculate the filter coefficients of this category in this category information by solving the equation. The filter coefficients are of floating - point type.

[0518] Step Nineteen: Multiply each filter coefficient by a fixed scale factor 1 << bitShift, where bitShift takes the value of 7. Then round the filter coefficient to convert it into an integer. Finally, map the integer coefficient to {0, ±1, ±2, ±4, ±8, ±16, ±32, ±64} by rounding.

[0519] Step Twenty: Parse the corresponding luminance component filter information from the available APS.

[0520] Step Twenty - One: Determine the filter index used for each CTU luminance component. Calculate the rate distortion cost 6 when the CTU luminance component is first filtered using a fixed filter according to Step Three. Calculate the rate distortion cost 7 when the CTU luminance component is second filtered using a fixed filter according to Step Seven. Filter the current CTU luminance component using the filter information parsed in Step Twelve and calculate the corresponding rate distortion cost 8. Calculate the rate distortion cost 9 when filtering the CTU luminance component using a new filter. If the rate distortion cost 6 is the smallest, the current CTU luminance component is filtered using the first fixed filter. If the rate distortion cost 7 is the smallest, the current CTU luminance component is filtered using the second fixed filter. If the rate distortion cost 8 is the smallest, the current CTU luminance component is filtered using the filter in the APS. Otherwise, filter the CTU luminance component using the new filter.

[0521] Step Twenty - Two: Determine whether each CTU luminance component is filtered. Calculate the rate distortion cost 10 when the current CTU luminance component is not filtered, and compare it with the minimum rate distortion cost determined in Step Thirteen. If the rate distortion cost 10 is smaller, the current CTU luminance component does not perform ALF filtering. Otherwise, the current CTU luminance component will perform ALF filtering.

[0522] Step 23: Determine the rate-distortion cost of the luminance component of the current frame. Calculate the rate-distortion cost of the current frame based on the CTU luminance component filter information and the corresponding luminance component filter information.

[0523] Step 24: Determine the optimal state information for the luma component of the current frame. Update the CTU luma component filter information and luma component filter information, and repeat steps 17 to 23. Select the set of CTU luma component filter information and luma component filter information that minimizes the current frame rate-distortion cost as the optimal state information for the luma component of the current frame. The minimum rate-distortion cost is recorded as 11.

[0524] Step 25: Determine the coefficient representation method used for the luminance component of the current frame and write the representation method into the APS unit. Compare the rate-distortion cost 5 under normal integer representation and the rate-distortion cost 11 under power-exponential representation. If the rate-distortion cost 5 is less than the rate-distortion cost 11, the filter coefficients are represented using normal integer representation (the representation method takes a value of 0). Otherwise, the filter coefficients are represented using power-exponential representation (the representation method takes a value of 1). The smaller of the rate-distortion cost 5 and the rate-distortion cost 11 is recorded as the rate-distortion cost 12.

[0525] Step 26: Determine whether the luminance component of the current frame is filtered using ALF. Calculate the rate-distortion cost 13 of the luminance component of the current frame when ALF is not used, and compare it with the rate-distortion cost 12 in step 25. If the rate-distortion cost 12 is less than the rate-distortion cost 13, the luminance component of the current frame is filtered using ALF. Otherwise, the luminance component of the current frame is not filtered using ALF.

[0526] Step 27: If the luminance component of the current frame is filtered using ALF, the luminance component of the current frame is filtered using the corresponding CTU luminance component filtering information and the luminance component filter information.

[0527] Step 28: Determine whether the new filter is used for the luminance component of the current frame. If the CTU luminance component filtering information indicates that the CTU luminance component is filtered using the new filter, the new filter is used for the luminance component of the current frame. Otherwise, the new filter is not used for the luminance component of the current frame.

[0528] Step 29: Write the CTU luminance component filtering information, the APS ID to be used, and the luminance component filter information into the bitstream.

[0529] For example, for the ALF chrominance component:

[0530] Step 1: Calculate the covariance matrix and error vector of each pixel chrominance component.

[0531] Step 2: Divide a frame of image into several regions, with the smallest unit of each region being a CTU.

[0532] Step 3: For each region, accumulate the covariance matrix and error vectors of all pixel chrominance components respectively, then construct the Wiener–Hopf equation, and calculate the filter coefficients of this region by solving the equation. The filter coefficients are in floating-point type.

[0533] Step 4: Multiply each filter coefficient by a fixed scaling factor 1 << bitShift, where bitShift has a value of 7. Then round the filter coefficients to convert them into integer numbers.

[0534] Step 5: Determine the filter index used for each CTU chrominance component. According to the chrominance component filter information obtained in Steps 3 and 4, the CTU chrominance components are filtered under each filter, and the corresponding rate-distortion cost is calculated. Select the filter index with the minimum rate-distortion cost as the filter index of the current CTU chrominance component. The chrominance component filter information includes: information such as the number of filters and the integerized coefficients of each filter, etc. It is collectively referred to as chrominance component filter information hereinafter.

[0535] Step 6: Determine whether each CTU chrominance component is filtered. Calculate the rate-distortion cost 1 when the current CTU chrominance component is not filtered, and compare it with the minimum rate-distortion cost determined in Step 5. If the rate-distortion cost 1 is smaller, the current CTU chrominance component does not perform ALF filtering; otherwise, the current CTU chrominance component will perform ALF filtering.

[0536] Step 7: Determine the rate-distortion cost of the current frame chrominance components. Calculate the rate-distortion cost of the current frame according to the CTU chrominance component filtering information and the corresponding chrominance component filter information. The CTU chrominance component filtering information includes: whether each CTU chrominance component uses ALF for filtering and the filter index when using ALF for filtering. It is collectively referred to as CTU chrominance component filtering information hereinafter.

[0537] Step 8: Determine the optimal state information of the current frame chrominance components. Update the CTU chrominance component filtering information and the chrominance component filter information, and repeat Steps 2 to 7. Select the set of CTU chrominance component filtering information and chrominance component filter information with the minimum rate-distortion cost of the current frame as the optimal state information of the current frame chrominance components, and record the minimum rate-distortion cost as rate-distortion cost 2.

[0538] Step 9: Divide a frame of image into several regions, with the smallest unit of each region being a CTU.

[0539] Step Ten: For each region, accumulate the covariance matrix and error vectors of all pixel chrominance components respectively, then construct the Wiener-Hopf equation, and calculate the filter coefficients of this region by solving the equation. The filter coefficients are in floating-point type.

[0540] Step Eleven: Multiply each filter coefficient by a fixed scaling factor 1 << bitShift, where bitShift takes the value of 7. Then round the filter coefficients to convert them into integer numbers. Finally, map the integer coefficients to {0, ±1, ±2, ±4, ±8, ±16, ±32, ±64} by rounding.

[0541] Step Twelve: Determine the filter index used for each CTU chrominance component. According to the chrominance component filter information obtained in Step Ten and Step Eleven, the CTU chrominance components are filtered under each filter, and the corresponding rate-distortion cost is calculated. Select the filter index with the minimum rate-distortion cost as the filter index of the current CTU chrominance component.

[0542] Step Thirteen: Determine whether each CTU chrominance component is filtered. Calculate the rate-distortion cost 3 when the current CTU chrominance component is not filtered, and compare it with the minimum rate-distortion cost determined in Step Twelve. If the rate-distortion cost 3 is smaller, the current CTU chrominance component does not undergo ALF filtering; otherwise, the current CTU chrominance component will undergo ALF filtering.

[0543] Step Fourteen: Determine the rate-distortion cost of the current frame chrominance components. Calculate the rate-distortion cost of the current frame according to the CTU chrominance component filtering information and the corresponding chrominance component filter information. The CTU chrominance component filtering information includes: whether each CTU chrominance component uses ALF for filtering and the filter index when using ALF for filtering. It is collectively referred to as the CTU chrominance component filtering information later.

[0544] Step Fifteen: Determine the optimal state information of the current frame chrominance components. Update the CTU chrominance component filtering information and the chrominance component filter information, and repeat Step Nine to Step Fourteen. Select the set of CTU chrominance component filtering information and chrominance component filter information with the minimum rate-distortion cost of the current frame as the optimal state information of the current frame chrominance components, and record the minimum rate-distortion cost as the rate-distortion cost 4.

[0545] Step 16: Determine the coefficient representation method used for the chrominance component of the current frame and write the representation method into the APS unit. Compare the rate-distortion cost 2 under normal integer representation and the rate-distortion cost 4 under power exponential representation. If the rate-distortion cost 2 is less than the rate-distortion cost 4, the filter coefficients are represented using normal integer representation (the representation method takes the value 0). Otherwise, the filter coefficients are represented using power exponential representation. The smaller value of the rate-distortion cost 2 and the rate-distortion cost 4 is recorded as the rate-distortion cost 5 (the representation method takes the value 1).

[0546] Step 17: parse the available APS to obtain the corresponding chrominance component filter information.

[0547] Step 18: Determine the rate-distortion cost 6 of the APS filter bank for the chroma pixels of the current frame. Filter the current frame using the chroma component filter information obtained from the APS, and calculate the corresponding rate-distortion cost 6.

[0548] Step 19: Determine whether the new filter should be used for the chrominance component of the current frame. Compare the rate-distortion cost 5 from step 16 with the filter cost 6 from step 18. If the rate-distortion cost 5 is less than the rate-distortion cost 6, the new filter should be used for the chrominance component of the current frame. Otherwise, the new filter should not be used for the chrominance component of the current frame. The smaller of the rate-distortion cost 5 and the rate-distortion cost 6 is denoted as rate-distortion cost 7.

[0549] Step 20: Determine whether ALF filtering is used for the chroma components of the current frame. Calculate the rate-distortion cost 8 when the chroma components of the current frame do not use ALF, and compare it with the rate-distortion cost 7 in step 19. If the rate-distortion cost 7 is less than the rate-distortion cost 8, the chroma components of the current frame are filtered using ALF. Otherwise, the chroma components of the current frame are not filtered using ALF.

[0550] Step 13: If the chroma component of the current frame is filtered using ALF, the chroma component of the current frame is filtered using the corresponding CTU chroma component filtering information and the chroma component filter information.

[0551] Step 14: Write the CTU chroma component filtering information, the APS ID to be used, and the chroma component filter information into the bitstream.

[0552] For example, for the CCALF chrominance component:

[0553] Step 1: Calculate the covariance matrix and error vector of the chrominance component of each pixel.

[0554] Step 2: Divide a frame image into several regions, and the smallest unit of each region is CTU.

[0555] Step 3: For each region, accumulate the covariance matrix and error vectors of all pixels of the chrominance component respectively, then construct the Wiener-Hopf equation, and calculate the filter coefficients of this region by solving the equation. The filter coefficients are in floating-point type.

[0556] Step 4: Multiply each filter coefficient by a fixed scaling factor 1 << bitShift, where bitShift has a value of 7. Then round the filter coefficients to convert them into integer numbers.

[0557] Step 5: Determine the filter index used for the chrominance component of each CTU. According to the chrominance component CCALF filter information obtained in Steps 3 and 4, the chrominance component of the CTU will be filtered under each filter, and the corresponding rate-distortion cost will be calculated. Select the filter index with the minimum rate-distortion cost as the filter index of the chrominance component of the current CTU. The chrominance component CCALF filter information includes: the number of filters and the integerized coefficients of each filter, etc. Collectively referred to as the chrominance component CCALF filter information hereinafter.

[0558] Step 6: Determine whether to filter the chrominance component of each CTU. Calculate the rate-distortion cost 1 when the chrominance component of the current CTU is not filtered, and compare it with the minimum rate-distortion cost determined in Step 5. If the rate-distortion cost 1 is smaller, the chrominance component of the current CTU will not be subjected to CCALF filtering; otherwise, the chrominance component of the current CTU will be subjected to CCALF filtering.

[0559] Step 7: Determine the rate-distortion cost of the chrominance component of the current frame. Calculate the rate-distortion cost of the current frame according to the chrominance component filtering information of the CTU and the corresponding chrominance component CCALF filter information. The chrominance component filtering information of the CTU includes: whether the chrominance component of each CTU uses CCALF for filtering and the filter index when using CCALF for filtering. Collectively referred to as the chrominance component filtering information of the CTU hereinafter.

[0560] Step 8: Determine the optimal state information of the chrominance component of the current frame. Update the chrominance component filtering information of the CTU and the chrominance component CCALF filter information, and repeat Steps 2 to 7. Select the group of chrominance component filtering information of the CTU and the chrominance component CCALF filter information with the minimum rate-distortion cost of the current frame as the optimal state information of the chrominance component of the current frame, and record the minimum rate-distortion cost as the rate-distortion cost 2.

[0561] Step 9: Divide a frame of image into several regions, and the minimum unit of each region is a CTU.

[0562] Step 10: For each region, accumulate the covariance matrix and error vector of all pixels' chrominance components respectively, then construct the Wiener-Hopf equation, and calculate the filter coefficients of this region by solving the equation. The filter coefficients are of floating-point type.

[0563] Step 11: Multiply each filter coefficient by a fixed scaling factor 1<<bitShift, where bitShift takes the value of 7. Then round the filter coefficients to convert them into integer numbers. Finally, map the integer coefficients to {0, ±1, ±2, ±4, ±8, ±16, ±32, ±64} by rounding.

[0564] Step 12: Determine the filter index used for the chrominance component of each CTU. According to the chrominance component CCALF filter information obtained in Step 10 and Step 11, the chrominance component of the CTU will be filtered under each filter, and the corresponding rate-distortion cost will be calculated. Select the filter index with the minimum rate-distortion cost as the filter index of the chrominance component of the current CTU.

[0565] Step 13: Determine whether to filter the chrominance component of each CTU. Calculate the rate-distortion cost 3 when the chrominance component of the current CTU is not filtered, and compare it with the minimum rate-distortion cost determined in Step 12. If the rate-distortion cost 3 is smaller, the chrominance component of the current CTU will not be filtered by CCALF; otherwise, the chrominance component of the current CTU will be filtered by CCALF.

[0566] Step 14: Determine the rate-distortion cost of the chrominance component of the current frame. Calculate the rate-distortion cost of the current frame according to the filter information of the chrominance component of the CTU and the corresponding chrominance component CCALF filter information.

[0567] Step 15: Determine the optimal state information of the chrominance component of the current frame. Update the filter information of the chrominance component of the CTU and the chrominance component CCALF filter information, and repeat Step 9 to Step 14. Select the set of filter information of the chrominance component of the CTU and the chrominance component filter information with the minimum rate-distortion cost of the current frame as the optimal state information of the chrominance component of the current frame, and record the minimum rate-distortion cost as the rate-distortion cost 4.

[0568] Step 16: Determine the coefficient representation method used for the chrominance component of the current frame, and write this representation method into the APS unit. Compare the rate-distortion cost 2 under the ordinary integer representation and the rate-distortion cost 4 under the power exponent representation. If the rate-distortion cost 2 is less than the rate-distortion cost 4, the filter coefficients use the ordinary integer representation (the representation method takes the value of 0). Otherwise, the filter coefficients use the power exponent representation. Record the smaller value of the rate-distortion cost 2 and the rate-distortion cost 4 as the rate-distortion cost 5 (the representation method takes the value of 1).

[0569] Step 17: parse the available APS to obtain the corresponding chrominance component CCALF filter information.

[0570] Step 18: Determine the rate-distortion cost 6 of the chroma pixels in the current frame using the APS filter bank. Filter the current frame using the chroma component CCALF filter information obtained from the APS, and calculate the corresponding rate-distortion cost 6.

[0571] Step 19: Determine whether the new filter is used for the chrominance component of the current frame. Compare the rate-distortion cost 5 from step 16 with the filter cost 6 from step 18. If the rate-distortion cost 5 is less than the rate-distortion cost 6, the new filter is used for the chrominance component of the current frame. Otherwise, the new filter is not used for the chrominance component of the current frame. The smaller of the rate-distortion cost 5 and the rate-distortion cost 6 is denoted as rate-distortion cost 7.

[0572] Step 20: Determine whether CCALF filtering is used for the chroma components of the current frame. Calculate the rate-distortion cost 8 of the chroma components of the current frame when CCALF is not used, and compare it with the rate-distortion cost 7 in step 19. If the rate-distortion cost 7 is less than the rate-distortion cost 8, the chroma components of the current frame are filtered using CCALF. Otherwise, the chroma components of the current frame are not filtered using CCALF.

[0573] Step 13: If the chroma component of the current frame is filtered using CCALF, the chroma component filtering information of the corresponding CTU and the chroma component CCALF filter information are used to filter the chroma component of the current frame.

[0574] Step 14: Write the chroma component filtering information of the CTU, the APS ID to be used, and the chroma component CCALF filter information into the bitstream.

[0575] An embodiment of the present application provides an encoding method, wherein, at an encoding end, filter coefficients and filter coefficient type parameters corresponding to a current image component of a current image are adaptively determined; filter identification information is determined based on the filter coefficients, and the filter identification information is written into a bitstream; wherein the filter identification information is used to determine whether a first filter is used to filter the current image component of the current image; and when it is determined that the first filter is used to filter the current image component of the current image, the filter coefficients and filter coefficient type parameters are written into the bitstream. That is, in an embodiment of the present application, an adaptive method can be used to represent ALF and CCALF filter coefficients to determine the representation form of the filter coefficients, and the filter coefficient type parameter indicating the representation form of the filter coefficients is transmitted to a decoding end, so that the corresponding filter coefficients can be adaptively parsed at the decoding end using the filter coefficient type parameter, thereby increasing the flexibility of encoding, thereby achieving a more ideal filtering effect, improving encoding efficiency, and enhancing compression performance.

[0576] It can be understood that in the embodiments of the present application, since an adaptive filter coefficient representation method is adopted, it is unreasonable to use a fixed scale factor scale in the process of determining the filter coefficient, and it is impossible to match the adaptive filter coefficient representation. That is, using the same scale factor for different filter coefficient representations makes it difficult to achieve an ideal filtering effect.

[0577] Accordingly, in the embodiment of the present application, when the optimal scale factor is adaptively selected for the image component, it is unreasonable to use a fixed filter coefficient in the filtering process. It cannot match the filter accuracy adaptation, that is, it cannot match the adaptive scale factor. In other words, it is also difficult to achieve an ideal filtering effect when the same filter coefficient representation is used in the case of the adaptive scale factor.

[0578] Therefore, the decoding method proposed in the embodiment of the present application also includes a method for adaptive filter accuracy. In CCALF or ALF technology, the optimal scale factor is adaptively selected for the image components within a frame of image. Combined with the application of adaptive filter coefficient representation, the flexibility of filtering is greatly improved, and a more ideal filtering effect can be further obtained, thereby improving the coding performance.

[0579] Furthermore, in the embodiment of the present application, taking CCALF and color components as examples, the filter precision adaptive decoding method proposed in the embodiment of the present application is further exemplified, wherein the method for the encoder to perform encoding processing may include the following:

[0580] Determines the scale factor corresponding to the current color component of the current image.

[0581] In an embodiment of the present application, the encoder may first determine a scale factor corresponding to a current color component of a current image.

[0582] It should be noted that, in the embodiments of the present application, in the video image, the first image component, the second image component and the third image component are generally used to represent the coding block (Coding Block, CB); wherein, these three image components are a brightness component, a blue color component and a red color component, specifically, the brightness component is usually represented by the symbol Y, the blue color component is usually represented by the symbol Cb or U, and the red color component is usually represented by the symbol Cr or V; in this way, the video image can be represented in the YCbCr format or the YUV format.

[0583] Furthermore, in the embodiment of the present application, the current color component of the current image can be understood as the blue color component of the current image, or can be understood as the red color component of the current image, that is, the current color component can be the U component or the V component. This application does not make any specific limitations.

[0584] Furthermore, in an embodiment of the present application, at least one scale factor candidate list may be preset, and the scale factor candidate list is used to determine the scale factor corresponding to the current color component.

[0585] It should be noted that, in the embodiment of the present application, the number of pre-set scaling factor candidate lists may be any integer greater than 0. For example, the number of scaling factor candidate lists may be 1 or 3, which is not specifically limited in the present application.

[0586] It is understandable that in the embodiments of the present application, for the encoder, the number of scaling factor candidate lists can be set; for the decoder, the number of scaling factor candidate lists can be set or determined based on list number information transmitted by the encoder.

[0587] Accordingly, in the embodiments of the present application, since the number of pre-set scaling factor candidate lists is an arbitrary value, after setting at least one scaling factor candidate list, list quantity information corresponding to the at least one scaling factor candidate list can also be written into the bitstream. Accordingly, at the decoding end, by decoding the bitstream, list quantity information indicating the number of scaling factor candidate lists can be determined. The number of scaling factor candidate lists can then be determined based on the list quantity information, thereby setting at least one scaling factor candidate list.

[0588] It should be noted that, in the embodiment of the present application, the preset scaling factor candidate list may include at least one scaling factor candidate, wherein at least one scaling factor candidate is greater than 0.

[0589] It is understandable that, in the embodiments of the present application, the number of candidate scale factors included in each preset scale factor candidate list may be any integer greater than 0. For example, the scale factor candidate list may include 4 candidate scale factors or 5 candidate scale factors, which is not specifically limited in the present application.

[0590] Accordingly, in the embodiment of the present application, for different scale factor candidate lists, the number of candidate scale factors included in each scale factor candidate list may be the same or different, which is not specifically limited in the present application.

[0591] For example, in some embodiments, three scale factor candidate lists are pre-set, wherein scale factor candidate list 1 includes four candidate scale factors, scale factor candidate list 2 includes seven candidate scale factors, and scale factor candidate list 3 includes two candidate scale factors.

[0592] It should be noted that, in the embodiment of the present application, the value of each candidate scaling factor included in the preset scaling factor candidate list may be any value greater than 0, and the present application does not impose any specific limitation thereto.

[0593] Illustratively, in some embodiments, the scale factor candidate list includes four candidate scale factors, and the values ​​of the four candidate scale factors are 7, 8, 9, and 10, respectively.

[0594] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component of the current image, at least one candidate scale factor in the scale factor candidate list may be traversed to determine the rate-distortion cost corresponding to the candidate scale factor; then, the candidate scale factor with the smallest rate-distortion cost may be determined as the optimal scale factor; and finally, the optimal scale factor may be determined as the scale factor corresponding to the current color component of the current image.

[0595] Furthermore, in an embodiment of the present application, when traversing at least one candidate scale factor in the scale factor candidate list and determining the rate-distortion cost corresponding to the candidate scale factor, for any candidate scale factor in the scale factor candidate list, a filter coefficient may be first determined based on the candidate scale factor, and a reconstructed block of the current block may be determined based on the candidate scale factor and the filter coefficient; and then, the rate-distortion cost corresponding to the candidate scale factor may be determined based on the reconstructed block of the current block.

[0596] It should be noted that for a video image, the video image can be divided into multiple image blocks, each image block to be encoded can be called a decoding block, and the current block here specifically refers to the coding block to be predicted. The current block can be a CTU, or even a coding unit (CU), prediction unit (PU), etc., and this embodiment of the application does not impose any limitation.

[0597] It should be noted that, in the embodiments of the present application, after the scale factor candidate list is constructed, corresponding filter coefficients may be determined for some or all of the candidate scale factors in the scale factor candidate list based on each candidate scale factor. The pixels in the current block are then filtered using the candidate scale factors and the corresponding filter coefficients to obtain a reconstructed block of the filtered current block. A rate-distortion cost may then be calculated based on the reconstructed block of the current block to obtain a rate-distortion cost corresponding to the candidate scale factor.

[0598] It should be noted that in the embodiments of the present application, for the current color component of the current image, it is necessary to determine the scale factor and filter coefficients used in the CCALF filtering process, wherein the scale factor corresponds to the current color component of the current image, and the filter coefficients are related to the scale factor.

[0599] It can be understood that, in the embodiment of the present application, for the current color component of the current image, the determined corresponding scale factor and filter coefficient can be applied to the filtering process of the current color component.

[0600] That is, in an embodiment of the present application, when performing CCALF filtering on the current color component of the current image, a scale factor corresponding to the current color component of the current image can be used, that is, each color component corresponds to only one scale factor, and the scale factors corresponding to different color components can be the same or different, and this application does not make specific limitations.

[0601] Furthermore, in an embodiment of the present application, before determining the filter coefficient based on the candidate scale factor, a first filter coefficient corresponding to the current color component of the current image may be determined first.

[0602] It should be noted that, in the embodiment of the present application, the first filter coefficient c of pixels of the same category can be solved by constructing the Wiener-Hopper equation Ac=B, wherein the filter coefficients obtained by the solution are all floating-point type.

[0603] Furthermore, in an embodiment of the present application, when determining the filter coefficient according to the candidate scale factor, the scaled coefficient may be first determined according to the candidate scale factor and the first filter coefficient; and then the filter coefficient may be determined according to the scaled coefficient.

[0604] It is understandable that, in the embodiment of the present application, after determining the first filter coefficient corresponding to the current color component, the first filter coefficient may be integerized to obtain the corresponding filter coefficient.

[0605] For example, in some embodiments, assuming that ci is the first filter coefficient of the Wiener-Hopper equation, scale is a scale factor (any candidate scale factor), c′ i Specifically, the candidate scale factor may be used to scale the first filter coefficient, as shown in the above formula (5).

[0606] Accordingly, it can be set to a fixed value of 7, and c′ i After that, for c′ i Look up the table and compare it to c′ in {-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64} i The closest value is used as the integer coefficient

[0607] That is to say, the final integer coefficient It can be one of {-64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64}. After the filter coefficients are determined, they can be written into the bitstream.

[0608] It should be noted that in the embodiment of the present application, when the filter coefficient is written into the bitstream and transmitted to the decoding end, 4 bits can be used to represent the filter coefficient, of which 1 bit is used to determine the sign of the filter coefficient and 3 bits are used to determine the value of the filter coefficient.

[0609] For example, in some embodiments, the value of the most significant bit can be used to determine the sign of the filter coefficient, for example, 1 indicates a negative sign and 0 indicates a positive sign, and the other three bits are used to determine the value of the filter coefficient. For example, -32 can be represented by 1101 using 4 bits, and 32 can be represented by 0101 using 4 bits.

[0610] That is, in the embodiment of the present application, the filter coefficients transmitted to the decoding end may be filter coefficients after integer processing. Specifically, at the encoding end, a scale factor may be selected to scale the solved floating-point filter coefficients, and then the scaled filter coefficients may be further integerized to obtain integer filter coefficients.

[0611] It should be noted that, in an embodiment of the present application, after determining the filter coefficients based on the candidate scale factors, a reconstructed block of the current block can be further determined based on the candidate scale factors and the filter coefficients. Specifically, when determining the reconstructed block of the current block based on the candidate scale factors and the filter coefficients, for a current pixel in the current block, a filtered reconstructed value of the current color component of the current pixel can be determined based on the luminance reconstructed value of the reference pixel corresponding to the current pixel, the luminance reconstructed value of the current pixel, the reconstructed value of the current color component of the current pixel, the candidate scale factors, and the filter coefficients. Subsequently, the reconstructed block of the current block can be determined based on the filtered reconstructed value of the current color component of the current pixel.

[0612] It should be noted that in the embodiments of the present application, after determining the candidate scale factors and filter coefficients corresponding to the current color component, for any pixel in the current block, the luminance reconstruction value of the reference pixel can be further combined with the luminance reconstruction value of the pixel to filter the reconstruction value of the current color component of the pixel, and ultimately determine the filtered reconstruction value of the current color component of the pixel. By sequentially traversing some or all of the pixels in the current block, the filtered reconstruction values ​​of the current color components of some or all of the pixels are obtained, thereby determining that the current block corresponds to the reconstructed block of the current color component.

[0613] Exemplarily, in some embodiments, based on the above formula (6), for the current pixel, the reconstruction value recC of the current color component of the current pixel, the brightness reconstruction value recY(i) of the reference pixel i, the brightness reconstruction value recY(x) of the current pixel, the candidate scale factor scale of the current color component and the filter coefficient Filtering is performed to ultimately determine a filtered reconstructed value recC′ of the current color component of the current pixel.

[0614] It should be noted that, in an embodiment of the present application, when determining the reconstructed block of the current block based on the filtered reconstruction value of the current color component of the current pixel, for the filtered pixels, the filtered reconstruction value can be written into the reconstructed block, and for the pixels that are not filtered, the reconstruction value of the pixel can be directly written into the reconstructed block.

[0615] That is, in the embodiment of the present application, all or part of the pixels of the current block may be filtered. Pixels that require filtering are written into the reconstructed image after filtering, while pixels that do not require filtering are directly written into the reconstructed image.

[0616] It should be noted that in the embodiments of the present application, after filtering the current color component of the current block, a rate-distortion cost corresponding to the candidate scale factor can be further determined based on the reconstructed block of the current block. The rate-distortion cost corresponding to the candidate scale factor can be composed of two parts: one part is the image distortion after filtering, and the other part is the bit cost required for entropy encoding of the syntax element.

[0617] For example, in some embodiments, it is assumed that the candidate scale factor scale i The rate distortion cost (RD Cost) under i , the corresponding filtered image distortion is D i , the bit cost required for entropy coding of the corresponding syntax element is R i , then the rate-distortion cost J can be calculated by the following formula i : J i =D i +λR i (7)

[0618] Where λ is the Lagrangian factor.

[0619] It is understood that in the embodiment of the present application, after traversing at least one candidate scale factor in the scale factor candidate list according to the above method and determining the rate-distortion cost corresponding to each candidate scale factor in the at least one candidate scale factor, the candidate scale factor with the smallest rate-distortion cost can be selected as the optimal scale factor scale best , and then the optimal scale factor can be determined as the scale factor corresponding to the current color component of the current image.

[0620] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component of the current image, the scale factor corresponding to the current color component of the previous frame of the current image filtered using the first filter can also be determined as the scale factor corresponding to the current color component.

[0621] That is, in an embodiment of the present application, at the encoder, the scale factor of the same color component of a frame previously filtered using CCALF can be reused, that is, the scale factor of the same color component of the frame previously filtered using CCALF can be directly determined as the scale factor of the current color component of the current image. The scale factor of the same color component of the frame previously filtered using CCALF can be obtained by traversing a list of scale factor candidates and searching for a candidate scale factor with the minimum rate-distortion cost.

[0622] It is understood that in the embodiments of the present application, when reusing the scale factors of the same color component of a frame previously filtered using CCALF, any previous frame filtered using CCALF can be selected. For example, the scale factor of the current color component of the current image can reuse the scale factor of the same color component of the previous frame corresponding to the current image that was filtered using CCALF, or can reuse the scale factor of the same color component of the third previous frame corresponding to the current image that was filtered using CCALF. This application does not specifically limit this.

[0623] It should be noted that in the embodiments of the present application, when traversing the scale factor candidate list, for any candidate scale factor, since it is necessary to perform operations such as updating the filter coefficients under the candidate scale factor, deciding whether to use CCALF for filtering the CTU (current block), and updating the filter category used by the CTU, the process of determining the optimal scale factor in the scale factor candidate list may involve multiple rounds of iterative calculations.

[0624] Furthermore, in an embodiment of the present application, after determining the scale factor corresponding to the current color component of the current image, CCALF parameter information corresponding to the current color component of the current image may be further determined based on the scale factor. The CCALF parameter information may be parameter information related to CCALF filtering.

[0625] It should be noted that, in the embodiment of the present application, the APS unit corresponding to the current image may include CCALF parameter information corresponding to the current color component of the current image, wherein the CCALF parameter information may be used for CCALF filtering processing of the current color component of the current image.

[0626] That is to say, in an embodiment of the present application, the APS unit corresponding to the current image may include parameter information related to CCALF filtering processing, namely, CCALF parameter information, and the CCALF filtering processing of the current color component of the current image can be completed through the CCALF parameter information.

[0627] Exemplarily, in some embodiments, the CCALF parameter information may include at least one or more of the following information: an index in the candidate list (first scale factor information), the number of filter groups, the filter order, the filter coefficients (filter coefficients), whether the CTU uses CCALF (fourth identification information), and the filter category used by the CTU.

[0628] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component of the current image, it is possible to directly determine the scale factor corresponding to the current color component.

[0629] That is, in an embodiment of the present application, it is also possible not to perform rate-distortion optimization (RDO) to select the optimal scale factor, but to directly specify the scale factor corresponding to the current color component, obtain the corresponding CCALF parameter information under the scale factor, and then write the scale factor and the corresponding CCALF parameter information into the bitstream.

[0630] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component of the current image, an optimal scale factor may be first determined in a scale factor candidate list; and then the optimal scale factor may be determined as the scale factor corresponding to the current color component of the current image.

[0631] That is, in the embodiment of the present application, it is also possible to select the optimal scale factor without performing rate-distortion optimization (RDO). Instead, the optimal scale factor may be directly determined from the scale factor candidate list. That is, the scale factor corresponding to the current color component may be directly specified in the scale factor candidate list.

[0632] It should be noted that in embodiments of the present application, when determining the scale factor corresponding to the current color component of the current image, an adaptive scale factor may be selected only during partial iterations of obtaining CCALF parameter information. The optimal filter scale factor and corresponding CCALF parameter information are selected through rate-distortion optimization (RDO), and then the scale factor and corresponding CCALF parameter information are written into the bitstream.

[0633] It should be noted that in the embodiments of the present application, when determining the scale factor corresponding to the current color component of the current image and iteratively obtaining CCALF parameter information, all adaptive scale factors are traversed in each iteration. After all iterations are completed, the optimal scale factor is selected through rate-distortion optimization (RDO) and the corresponding CCALF parameter information is obtained under the scale factor. The scale factor and the corresponding CCALF parameter information are then written into the bitstream.

[0634] Thus, in an embodiment of the present application, if the current color component of the current image is filtered using the first filter, information such as whether the CTU uses CCALF (fourth identification information) and the filter type used by the CTU can be written into the bitstream. If a new filter bank is used, information such as the index of the scale factor obtained under the optimal scale factor in the candidate list, the number of filter banks, the filter order, and the filter coefficients are written into the bitstream and transmitted to the decoder.

[0635] Furthermore, in an embodiment of the present application, after determining the scale factor corresponding to the current color component, first scale factor information corresponding to the current color component may be further determined based on the scale factor corresponding to the current color component; and then the first scale factor information is written into the bitstream.

[0636] It should be noted that, in the embodiment of the present application, the first scale factor information can be used to determine the scale factor corresponding to the current color component. The first scale factor information can include any of the following information: an index value of the scale factor, a numerical value of the scale factor, or a related numerical value of the scale factor.

[0637] Furthermore, in an embodiment of the present application, when determining the first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component, the first scale factor information may be set according to the scale factor corresponding to the current color component and the scale factor candidate list.

[0638] It should be noted that in this embodiment of the present application, if the first scale factor information is the index value of the scale factor corresponding to the current color component, then the index value of the scale factor can be set based on the candidate scale factor corresponding to the current color component in the scale factor candidate list. Accordingly, the candidate scale factor indicated by the index value of the scale factor in the scale factor candidate list is the scale factor corresponding to the current color component.

[0639] That is, in the embodiment of the present application, when the first scale factor information is the index value of the scale factor corresponding to the current color component, the corresponding scale factor can be determined from a preset scale factor candidate list according to the index value.

[0640] For example, in some embodiments, Table 2 shows a possible form of a scale factor candidate list, where the scale factor candidate list includes four candidate scale factors, namely 7, 8, 9, and 10. If candidate scale factor 9 is determined to be the scale factor corresponding to the current color component, the first scale factor information can be set to the scale factor index value 3.

[0641] Table 2

[0642] Further, when determining the first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component, the scale factor corresponding to the current color component may be determined as the first scale factor information.

[0643] It should be noted that, in the embodiment of the present application, if the first scale factor information is the value of the scale factor corresponding to the current color component, then the scale factor corresponding to the current color component can be directly determined as the first scale factor information.

[0644] Furthermore, when determining the first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component, conversion may be performed according to the scale factor corresponding to the current color component to determine the first scale factor information.

[0645] It should be noted that, in an embodiment of the present application, if the first scale factor information is a related value of the scale factor corresponding to the current color component, then further conversion can be performed based on the scale factor corresponding to the current color component to obtain the first scale factor information corresponding to the current color component.

[0646] For example, in some embodiments, after determining the scale factor, during the conversion process based on the scale factor, the result of a numerical operation between the scale factor and a preset value can be selected as the corresponding scale factor. The preset value can be any value and is not specifically limited in this application. For example, a difference operation can be performed between the scale factor and the value 6 (preset value), and the difference result can be determined as the corresponding first scale factor information.

[0647] It can be understood that, in the embodiment of the present application, the relevant numerical value of the scale factor may be a numerical value in other forms generated by converting the numerical value of the scale factor.

[0648] That is, in the embodiments of the present application, the first scale factor information transmitted from the encoder to the decoder can be in any form. For example, the first scale factor information includes but is not limited to an index value of the scale factor, a numerical value of the scale factor, and related numerical values ​​of the scale factor, which are not specifically limited in the present application.

[0649] It should be noted that in the embodiments of the present application, at the encoding end, the first scale factor information can be written into the bitstream in any manner and transmitted to the decoding end. Encoding the first scale factor information includes, but is not limited to, fixed-length coding, variable-length coding, or adaptive context coding, and is not specifically limited in the embodiments of the present application.

[0650] First identification information is determined according to the rate-distortion cost corresponding to the scale factor, and the first identification information is written into the bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

[0651] In an embodiment of the present application, after determining the scale factor corresponding to the current color component of the current image, the encoder can further determine first identification information based on the rate-distortion cost corresponding to the scale factor, and write the first identification information into the bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

[0652] Furthermore, in an embodiment of the present application, the rate-distortion cost corresponding to the scale factor may include a first cost corresponding to the optimal scale factor and a second cost corresponding to the scale factor corresponding to the current color component of the previous frame filtered using CCALF.

[0653] That is, in an embodiment of the application, when the current color component of the current image is filtered using the first filter, if the scale factor of the current color component of the current image is obtained by traversing the scale factor candidate list and finding the candidate scale factor with the minimum rate-distortion cost, then the rate-distortion cost corresponding to the scale factor may be a first cost of the optimal scale factor with the minimum rate-distortion cost; if the scale factor of the current color component of the current image is a scale factor of the same color component of a frame previously filtered using CCALF, then the rate-distortion cost corresponding to the scale factor may be a second cost corresponding to the scale factor corresponding to the current color component of the frame previously filtered using CCALF.

[0654] Furthermore, in an embodiment of the present application, when the current color component of the current image is not filtered using the first filter, a third cost may be determined, wherein the third cost is the rate-distortion cost corresponding to not performing CCALF filtering on the current color component of the current image.

[0655] Further, in an embodiment of the present application, when the third cost is less than the first cost and the second cost, the value of the first identification information is set to the fifth value, so that the first identification information indicates that the current color component of the current image is not filtered using the first filter; when the third cost is greater than the first cost or the second cost, the value of the first identification information is set to the sixth value, so that the first identification information indicates that the current color component of the current image is filtered using the first filter.

[0656] It is understood that in the embodiments of the present application, if the first cost, the second cost, and the third cost are all equal, then the value of the first identification information can be set to either the fifth value or the sixth value, and this application does not specifically limit this. For example, the value of the first identification information can be set to the fifth value so that the first identification information indicates that the first filter is not to be used to filter the current color component of the current image.

[0657] It should be noted that in an embodiment of the present application, the rate-distortion cost under the optimal scale factor, the distortion when no filtering is performed, and the rate-distortion cost when the filter of the same color component of the frame previously filtered using CCALF is reused can be compared to determine the first identification information. If the rate-distortion cost under the optimal scale factor is minimized, then the current color component of the current image uses the new filter, and the value of the first identification information is set to the sixth value, so that the first identification information indicates that the current color component of the current image is filtered using the first filter; if the distortion when no filtering is minimized, then the current color component of the current image is not filtered using CCALF, and the value of the first identification information is set to the fifth value, so that the first identification information indicates that the current color component of the current image is not filtered using the first filter; if the rate-distortion cost when filtering using the scale factor and filter of the same color component previously filtered using CCALF is minimized, then the value of the first identification information can be set to the sixth value, so that the first identification information indicates that the current color component of the current image is filtered using the first filter.

[0658] Accordingly, in an embodiment of the present application, if the current color component of the current image needs to be filtered and a new filter is required, the new filter coefficients and the optimal scale factor are used to filter the current color component of the current image; if the filter previously used to filter the same color component using CCALF is reused for filtering, the filter coefficients and the corresponding scale factor are used to filter the current color component of the current image. If the current color component of the current image is filtered using the first filter, after filtering the pixels that need to be filtered, they are written into the reconstructed image; pixels that do not need to be filtered are directly written into the reconstructed image.

[0659] Exemplarily, in some embodiments, when the value of the first identification information is the fifth value, it can be determined that the current color component of the current image is not filtered using the first filter.

[0660] Exemplarily, in some embodiments, when the value of the first identification information is the sixth value, it can be determined that the current color component of the current image is filtered using the first filter.

[0661] It should be noted that, in an embodiment of the present application, the first identification information can be used to indicate whether the current color component of the current image is filtered using CCALF. In addition, the fifth value and the sixth value are different, and the fifth value and the sixth value can be in parameter form or in digital form. Generally, the first identification information can be a parameter written in the PPS or a parameter written in the SPS. The first identification information can also be a flag, which is not limited here.

[0662] It should also be noted that if the first identification information is a flag, then in a specific example, the fifth value can be set to 1 and the sixth value can be set to 0; in another specific example, the fifth value can also be set to true and the sixth value can also be set to false; even in another specific example, the fifth value can also be set to 0 and the sixth value can also be set to 1; or, the fifth value can also be set to false and the sixth value can also be set to true. The fifth value and the sixth value in the embodiment of the present application are not limited in any way.

[0663] Taking the fifth value being 1 and the sixth value being 0 as an example, in this embodiment of the present application, if the value of the first identification information is 1, it can be determined that the first filter is not to be used to filter the current color component of the current image. Otherwise, if the value of the first identification information is 0, the first filter can be used to filter the current color component of the current image.

[0664] Furthermore, in an embodiment of the present application, when an optimal scale factor is used, a fourth cost corresponding to the current block is determined; when a scale factor corresponding to the current color component of a frame is filtered using the first filter before multiplexing the current image, a fifth cost corresponding to the current block is determined; when the current color component of the current image is not filtered using the first filter, a sixth cost corresponding to the current block is determined; fourth identification information is determined based on the fourth cost, the fifth cost, and the sixth cost, and the fourth identification information is written into the bitstream.

[0665] It should be noted that, in an embodiment of the present application, when determining the fourth identification information based on the fourth cost, the fifth cost and the sixth cost, when the sixth cost is less than the fourth cost and the fifth cost, the value of the fourth identification information is set to the seventh value, so that the fourth identification information indicates that the current color component of the current block is not filtered using the first filter; when the sixth cost is greater than the fourth cost or the fifth cost, the value of the fourth identification information is set to the eighth value, so that the fourth identification information indicates that the current color component of the current block is filtered using the first filter.

[0666] It is understood that in the embodiment of the present application, if the fourth cost, the fifth cost, and the sixth cost are all equal, then the value of the fourth identification information can be set to either the seventh value or the eighth value, and this application does not specifically limit this. For example, the value of the fourth identification information can be set to the seventh value so that the fourth identification information indicates that the first filter is not used to filter the current color component of the current block.

[0667] It is understood that in an embodiment of the present application, for the current block, the rate-distortion cost under the optimal scale factor, the distortion when no filtering is performed, and the rate-distortion cost when the filter previously used to filter the same color component of the frame using CCALF is reused can be compared to determine the fourth identification information. If the rate-distortion cost under the optimal scale factor is minimized, then the new filter is used for the current color component of the current block. In this case, the value of the fourth identification information is set to an eighth value, so that the fourth identification information indicates that the first filter is used to filter the current color component of the current block. If the distortion when no filtering is minimized, then the current color component of the current block is not filtered by CCALF. In this case, the value of the fourth identification information is set to a seventh value, so that the fourth identification information indicates that the first filter is not used to filter the current color component of the current block. If the rate-distortion cost when filtering by reusing the scale factor and filter previously used to filter the same color component of the frame using CCALF is minimized, then the value of the fourth identification information can be set to an eighth value, so that the fourth identification information indicates that the first filter is used to filter the current color component of the current block.

[0668] Accordingly, in an embodiment of the present application, if the current color component of the current block needs to be filtered and a new filter is required, the new filter coefficients and the optimal scale factor are used to filter the current color component of the current block; if the filter previously used to filter the same color component of the frame using CCALF is reused for filtering, the filter coefficients and the corresponding scale factor are used to filter the current color component of the current block. If the current color component of the current block is filtered using the first filter, after filtering the pixels that need to be filtered, they are written into the reconstructed block, and pixels that do not need to be filtered are directly written into the reconstructed block.

[0669] Exemplarily, in some embodiments, when the value of the fourth identification information is the seventh value, it may be determined that the current color component of the current block is not filtered using the first filter.

[0670] Exemplarily, in some embodiments, when the value of the fourth identification information is the eighth value, it may be determined that the current color component of the current block is filtered using the first filter.

[0671] It should be noted that, in the embodiments of the present application, the fourth identification information may be used to indicate whether the current color component of the current block is filtered using CCALF. Furthermore, the seventh value and the eighth value are different, and the seventh value and the eighth value may be in parameter form or in digital form. Typically, the fourth identification information may be a parameter written into the APS unit corresponding to the current image.

[0672] For example, in some embodiments, the seventh value may be set to 1 and the eighth value may be set to 0. In another specific example, the seventh value may be set to true and the eighth value may be set to false. In yet another specific example, the seventh value may be set to 0 and the eighth value may be set to 1. Alternatively, the seventh value may be set to false and the eighth value may be set to true. The seventh and eighth values ​​in the embodiments of the present application are not limited in any way.

[0673] Taking the seventh value being 1 and the eighth value being 0 as an example, in this embodiment of the present application, if the value of the first identification information is 1, it can be determined that the first filter is not to be used to filter the current color component of the current block. Otherwise, if the value of the first identification information is 0, the first filter can be used to filter the current color component of the current block.

[0674] Furthermore, in an embodiment of the present application, when it is determined that the current color component of the current image is filtered using the first filter, the APS unit corresponding to the current image can be determined; then, the APS index corresponding to the current image can be determined based on the APS unit; and finally, the APS unit and the APS index can be written into the code stream.

[0675] It should be noted that, in the embodiment of the present application, the APS index corresponding to the current image can be used to indicate the APS unit corresponding to the current image, wherein the APS index corresponding to the current image can be the APS ID corresponding to the current image.

[0676] That is to say, in an embodiment of the present application, if the current color component of the current image is filtered using the first filter, the APS unit corresponding to the current image can be further determined, and then the APS ID corresponding to the current image can be determined based on the APS unit corresponding to the current image.

[0677] It should be noted that, in an embodiment of the present application, if the scale factor corresponding to the current color component of the current image reuses the scale factor corresponding to the current color component of the previous frame of the current image filtered using the first filter, then when determining the APS unit corresponding to the current image, the reused APS unit of the previous frame filtered using CCALF can be directly used as the APS unit corresponding to the current image, or, the reused APS ID of the previous frame filtered using CCALF can be directly used as the APS ID corresponding to the current image.

[0678] Furthermore, in an embodiment of the present application, the APS unit corresponding to the current image includes at least one or more of the following information: fourth identification information, a filter coefficient corresponding to the current color component of the current image, and first scale factor information corresponding to the current color component of the current image.

[0679] That is, in an embodiment of the present application, the encoding end may write the APS unit corresponding to the current image into the code stream and transmit it to the decoding end, so that the decoding end can determine the APS unit corresponding to the current image through the decoded code stream, and determine the first scale factor information corresponding to the current color component, the filter coefficient corresponding to the current color component, and the fourth identification information by parsing the APS unit.

[0680] In summary, the encoding method proposed in this application designs a filter precision adaptive method. In CCALF technology, the optimal scaling factor is adaptively selected for the color components within a frame of an image. All filters for the same color component in the same frame use the same scaling factor, which can reduce bit consumption. Furthermore, within the CCALF algorithm framework, it can more closely approach the global optimal solution, improving encoding performance.

[0681] For example, in some embodiments, the changes in the syntax and semantics of the encoding method proposed in the embodiments of the present application are described by taking the syntax and semantics of ECM as an example:

[0682] alf_cross_component_cb_coeff_prec_idx represents the index of the optimal scale factor for the chroma U component in the candidate list (scale factor candidate list). In the current implementation, the number of candidate scale factors in the scale factor candidate list, N, is set to 4, so only 2 bits are required to encode this index. alf_cross_component_cr_coeff_prec_idx represents the optimal scale factor index for the chroma V component.

[0683] For example, in some embodiments, implemented on the reference software ECM-10.0, the number of candidate scale factors in the scale factor candidate list is set to N = 4, and the scale factor candidate list is {7, 8, 9, 10}. Under the full intraframe (AI) configuration, some test sequences required by ECM were tested. The average BD-rate changes for the Y, U, and V components under Class B, C, and D were 0.00%, -0.22%, and -0.33%, respectively. Under the random access configuration, some test sequences required by ECM were tested. The average BD-rate changes for the Y, U, and V components under Class B, C, and D were 0.00%, -0.36%, and -0.48%, respectively. It can be seen that the data from the above test results show that the encoding method proposed in the embodiments of the present application improves encoding performance.

[0684] That is to say, the encoding method proposed in the embodiment of the present application enables the common CCALF to obtain additional performance gains while the complexity of the encoding end and the decoding end remains almost unchanged.

[0685] Class represents the video category, Sequence represents the specific test sequence, and Y, Cb, and Cr represent the performance of the three video components, luma and chroma. The values ​​in the table represent BD-rate, a measure of algorithm performance that indicates the change in bitrate and Peak Signal to Noise Ratio (PSNR) (or SSIM) compared to the original encoding algorithm. A negative value indicates improved performance, and a larger absolute value indicates a greater improvement.

[0686] An embodiment of the present application provides an encoding method, wherein, at the encoding end, a scale factor corresponding to the current color component of the current image is determined; first identification information is determined based on the rate-distortion cost corresponding to the scale factor, and the first identification information is written into the bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF. In other words, in an embodiment of the present application, the encoding end can adaptively determine the corresponding scale factor for the current color component of the current image; and at the decoding end, when it is determined that the current color component of the current image is filtered using the first filter, the scale factor corresponding to the current color component of the current image can be used to perform CCALF filtering on the current color component, wherein each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

[0687] Furthermore, in an embodiment of the present application, when filtering is performed by the ALF, the method for the encoder to perform encoding processing may include the following steps:

[0688] Step 601: Determine a scale factor corresponding to a current color component of a current image.

[0689] In an embodiment of the present application, the encoder may first determine a scale factor corresponding to a current color component of a current image.

[0690] Furthermore, in an embodiment of the present application, at least one scale factor candidate list may be preset, and the scale factor candidate list is used to determine the scale factor corresponding to the current color component.

[0691] It should be noted that, in the embodiment of the present application, the number of pre-set scaling factor candidate lists may be any integer greater than 0. For example, the number of scaling factor candidate lists may be 1 or 3, which is not specifically limited in the present application.

[0692] It is understandable that in the embodiments of the present application, for the encoder, the number of scaling factor candidate lists can be set; for the decoder, the number of scaling factor candidate lists can be set or determined based on list number information transmitted by the encoder.

[0693] Accordingly, in the embodiments of the present application, since the number of pre-set scaling factor candidate lists is an arbitrary value, after setting at least one scaling factor candidate list, list quantity information corresponding to the at least one scaling factor candidate list can also be written into the bitstream. Accordingly, at the decoding end, by decoding the bitstream, list quantity information indicating the number of scaling factor candidate lists can be determined. The number of scaling factor candidate lists can then be determined based on the list quantity information, thereby setting at least one scaling factor candidate list.

[0694] It should be noted that, in the embodiment of the present application, the preset scaling factor candidate list may include at least one scaling factor candidate, wherein at least one scaling factor candidate is greater than 0.

[0695] It is understandable that, in the embodiments of the present application, the number of candidate scale factors included in each preset scale factor candidate list may be any integer greater than 0. For example, the scale factor candidate list may include 4 candidate scale factors or 5 candidate scale factors, which is not specifically limited in the present application.

[0696] Accordingly, in the embodiment of the present application, for different scale factor candidate lists, the number of candidate scale factors included in each scale factor candidate list may be the same or different, which is not specifically limited in the present application.

[0697] For example, in some embodiments, three scale factor candidate lists are pre-set, wherein scale factor candidate list 1 includes four candidate scale factors, scale factor candidate list 2 includes seven candidate scale factors, and scale factor candidate list 3 includes two candidate scale factors.

[0698] It should be noted that, in the embodiment of the present application, the value of each candidate scaling factor included in the preset scaling factor candidate list may be any value greater than 0, and the present application does not impose any specific limitation thereto.

[0699] Illustratively, in some embodiments, the scale factor candidate list includes four candidate scale factors, and the values ​​of the four candidate scale factors are 7, 8, 9, and 10, respectively.

[0700] Furthermore, in an embodiment of the present application, when determining the scale factor corresponding to the current color component of the current image, at least one candidate scale factor in the scale factor candidate list may be traversed to determine the rate-distortion cost corresponding to the candidate scale factor; then, the candidate scale factor with the smallest rate-distortion cost may be determined as the optimal scale factor; and finally, the optimal scale factor may be determined as the scale factor corresponding to the current color component of the current image.

[0701] Furthermore, in an embodiment of the present application, when traversing at least one candidate scale factor in the scale factor candidate list and determining the rate-distortion cost corresponding to the candidate scale factor, for any candidate scale factor in the scale factor candidate list, a filter coefficient may be first determined based on the candidate scale factor, and a reconstructed block of the current block may be determined based on the candidate scale factor, the filter coefficient, and the cropping information; and then the rate-distortion cost corresponding to the candidate scale factor may be determined based on the reconstructed block of the current block.

[0702] It should be noted that for a video image, the video image can be divided into multiple image blocks. Each image block to be encoded can be called a decoding block, and the current block here specifically refers to the coding block currently to be predicted. The current block can be a CTU or even a coding unit CU, PU, ​​etc., and this embodiment of the application does not impose any limitation.

[0703] It should be noted that in the embodiments of the present application, after the scale factor candidate list is constructed, corresponding filter coefficients may be determined for some or all of the candidate scale factors in the scale factor candidate list based on each candidate scale factor. The candidate scale factors, the filter coefficients, and the cropping information are then used to filter the pixels in the current block to obtain a reconstructed block of the filtered current block. A rate-distortion cost may then be calculated based on the reconstructed block of the current block to obtain a rate-distortion cost corresponding to the candidate scale factor.

[0704] It should be noted that in the embodiments of the present application, for the current color component of the current image, it is necessary to determine the scale factor, filter coefficients, and cropping information used in the ALF filtering process. The scale factor corresponds to the current color component of the current image, and the filter coefficients are related to the scale factor.

[0705] It can be understood that, in the embodiment of the present application, for the current color component of the current image, the determined corresponding scale factor, filter coefficient, and cropping information can be applied to the filtering process of the current color component.

[0706] That is, in an embodiment of the present application, when performing CCALF filtering on the current color component of the current image, a scale factor corresponding to the current color component of the current image can be used, that is, each color component corresponds to only one scale factor, and the scale factors corresponding to different color components can be the same or different, and this application does not make specific limitations.

[0707] Furthermore, in an embodiment of the present application, before determining the filter coefficient based on the candidate scale factor, a first filter coefficient corresponding to the current color component of the current image may be determined first.

[0708] It should be noted that, in the embodiment of the present application, the first filter coefficient c of pixels of the same category can be solved by constructing the Wiener-Hopper equation Ac=B, wherein the filter coefficients obtained by the solution are all floating-point type.

[0709] Furthermore, in an embodiment of the present application, when determining the filter coefficient according to the candidate scale factor, the scaled coefficient may be first determined according to the candidate scale factor and the first filter coefficient; and then the filter coefficient may be determined according to the scaled coefficient.

[0710] It is understandable that, in the embodiment of the present application, after determining the first filter coefficient corresponding to the current color component, the first filter coefficient may be integerized to obtain the corresponding filter coefficient.

[0711] For example, in some embodiments, it is assumed that is the first filter coefficient to solve the Wiener-Hope equation, scale is the scale factor (any candidate scale factor), c′ i Specifically, the candidate scale factor may be used to scale the first filter coefficient, as shown in the above formula (5).

[0712] Accordingly, it can be set to a fixed value of 7, and c′ i After that, for c′ iLook up the table and compare it to c′ in {-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64} i The closest value is used as the integer coefficient

[0713] That is to say, the final integer coefficient It can be one of {-64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64}. After the filter coefficients are determined, they can be written into the bitstream.

[0714] It should be noted that in the embodiment of the present application, when the filter coefficient is written into the bitstream and transmitted to the decoding end, 4 bits can be used to represent the filter coefficient, of which 1 bit is used to determine the sign of the filter coefficient and 3 bits are used to determine the value of the filter coefficient.

[0715] For example, in some embodiments, the value of the most significant bit can be used to determine the sign of the filter coefficient, for example, 1 indicates a negative sign and 0 indicates a positive sign, and the other three bits are used to determine the value of the filter coefficient. For example, -32 can be represented by 1101 using 4 bits, and 32 can be represented by 0101 using 4 bits.

[0716] That is, in the embodiment of the present application, the filter coefficients transmitted to the decoding end may be filter coefficients after integer processing. Specifically, at the encoding end, a scale factor may be selected to scale the solved floating-point filter coefficients, and then the scaled filter coefficients may be further integerized to obtain integer filter coefficients.

[0717] It should be noted that, in an embodiment of the present application, after determining the filter coefficient based on the candidate scale factor, the current color component of the current block can be further ALF filtered based on the candidate scale factor, the filter coefficient, and the cropping information, ultimately determining the filtered block of the current block, and then determining the corresponding reconstructed block. When determining the filtered block of the current block based on the scale factor, the filter coefficient, and the cropping information, for a current pixel in the current block, the filtered pixel value of the current color component of the current pixel is determined based on the reconstructed value of the reference pixel corresponding to the current pixel, the reconstructed value of the current pixel, the reference information of the current color component of the current pixel, the scale factor, the filter coefficient, and the cropping information; then, based on the filtered pixel value of the current color component of the current pixel, the filtered pixel block of the current block, i.e., the filtered block of the current block, can be determined.

[0718] It should be noted that in the embodiments of the present application, after determining the scale factor, filter coefficient, and cropping information corresponding to the current color component, for any pixel in the current block, the brightness reconstruction value of the reference pixel can be further combined with the brightness reconstruction value of the pixel to filter the reconstruction value of the current color component of the pixel, and ultimately determine the filtered reconstruction value of the current color component of the pixel. By sequentially traversing some or all of the pixels in the current block, the filtered reconstruction values ​​of the current color components of some or all of the pixels are obtained, thereby determining that the cu...

Claims

1. A decoding method, applied to a decoder, the method comprising: Decoding a bitstream to determine filtering identification information; When it is determined based on the filtering identification information that a first filter is used to filter the current image component of the current image, determining a filtering coefficient type parameter corresponding to the current image component; Determining a filtering coefficient corresponding to the current image component according to the filtering coefficient type parameter; Determining a reconstructed block of a current block in the current image according to the filtering coefficient.

2. The method according to claim 1, wherein The method further comprises: When it is determined based on the filtering identification information that the first filter is used to filter the current image component of the current image, decoding the bitstream to determine an Adaptive Parameter Set (APS) index corresponding to the current image; Determining an APS unit corresponding to the current image according to the APS index; Determining the filtering coefficient type parameter corresponding to the current image component according to the APS unit.

3. The method according to claim 2, wherein The determining a filtering coefficient corresponding to the current image component according to the filtering coefficient type parameter includes: When it is determined based on the filtering coefficient type parameter that the filtering coefficient is in a first representation form, determining the filtering coefficient in the first representation form according to a first parsing method corresponding to the first representation form; When it is determined based on the filtering coefficient type parameter that the filtering coefficient is in a second representation form, determining the filtering coefficient in the second representation form according to a second parsing method corresponding to the second representation form.

4. The method according to claim 3, wherein, The method further comprises: When it is determined based on the filtering coefficient type parameter that the filtering coefficient is the filtering coefficient in the first representation form, determining the filtering coefficient in the first representation form as the filtering coefficient corresponding to the current image component; When it is determined based on the filtering coefficient type parameter that the filtering coefficient is the filtering coefficient in the second representation form, mapping the filtering coefficient in the second representation form to obtain the filtering coefficient corresponding to the current image component.

5. The method according to claim 3, wherein The first parsing method is a method corresponding to exponential Golomb coding; The second parsing method is a method corresponding to fixed-length coding.

6. The method according to claim 5, wherein The filtering coefficient type parameter includes at least one type parameter corresponding to the current image.

7. The method according to any one of claims 2-6, wherein The first filter includes a Cross-Component Adaptive Loop Filter (CCALF) or an Adaptive Loop Filter (ALF).

8. The method according to claim 7, wherein The filtering identification information is used to determine whether to use the first filter for filtering; wherein, the filtering identification information includes first identification information or second identification information.

9. The method according to claim 8, wherein The first identification information is used to determine whether to use CCALF for filtering; The second identification information is used to determine whether to use ALF for filtering.

10. The method according to claim 9, wherein The current image component includes a current luminance component or a current color component.

11. The method according to any one of claims 2-6, wherein, The method further comprises: When it is determined, based on the filtering identification information, to filter the current image component of the current image using the first filter, the third identification information is determined according to the APS unit; When it is determined, based on the third identification information, to use the new first filter, the determination process of the filtering coefficient type parameter is executed.

12. The method according to claim 1, wherein, The method further includes: When the value of the filtering identification information is the first value, it is determined not to filter the current image component of the current image using the first filter; When the value of the filtering identification information is the second value, it is determined to filter the current image component of the current image using the first filter.

13. [Corrected according to Rule 91 on 02.07.2024] The method according to claim 11, wherein, The method further includes: When the value of the third identification information is the third value, it is determined not to use the new first filter; When the value of the third identification information is the fourth value, it is determined to use the new first filter.

14. The method according to claim 10, wherein The method further includes; Determine the scale factor corresponding to the current image component.

15. The method according to claim 14, wherein, The determining the reconstructed block of the current block in the current image according to the filtering coefficient includes: Determining the reconstructed block of the current block in the current image according to the scale factor and the filtering coefficient.

16. The method according to claim 14, wherein The determining the scale factor corresponding to the current image component includes: Determining the first scale factor information corresponding to the current color component; Determining the scale factor corresponding to the current color component according to the first scale factor information.

17. The method according to claim 16, wherein The determining the scale factor corresponding to the current color component according to the first scale factor information includes: Determining the scale factor corresponding to the current color component according to the first scale factor information and the scale factor candidate list.

18. The method according to claim 16, wherein, The determining the scale factor corresponding to the current color component according to the first scale factor information includes: Determining the first scale factor information as the scale factor corresponding to the current color component.

19. The method according to claim 16, wherein, The determining the scale factor corresponding to the current color component according to the first scale factor information includes: Performing a conversion according to the first scale factor information to determine the scale factor corresponding to the current color component.

20. [Corrected according to Rule 91 on 07.02.2024] The method according to any one of claims 16 - 19, wherein, The method further includes: Decoding the bitstream to determine the APS index; Determining the APS unit according to the APS index; Determining the fourth identification information according to the APS unit; wherein, the fourth identification information is used to determine whether to filter the current color component of the current block using CCALF.

21. The method according to claim 20, wherein, The method further includes: When it is determined, based on the fourth identification information, to filter the current color component of the current block using the first filter, execute the process of determining the reconstructed block of the current block according to the scale factor and the filtering coefficient.

22. The method according to claim 20, wherein The determining the first scale factor information corresponding to the current color component includes: Determining the first scale factor information corresponding to the current color component according to the APS unit.

23. The method according to claim 20, wherein The determining the filtering coefficient corresponding to the current color component includes: Determining the filtering coefficient corresponding to the current color component according to the APS unit.

24. [Corrected according to Rule 91 on 02.07.2024] The method according to any one of claims 16 - 19, 21 - 23, wherein, Determining the reconstructed block of the current block according to the scaling factor and the filtering coefficient includes: For a current pixel in the current block, determine the filtered reconstructed value of the current color component of the current pixel according to the luminance reconstructed value of the reference pixel corresponding to the current pixel, the luminance reconstructed value of the current pixel, the reconstructed value of the current color component of the current pixel, the scaling factor, and the filtering coefficient; Based on the filtered reconstructed value of the current color component of the current pixel, determine the reconstructed block of the current block.

25. The method according to claim 21, wherein, The method further includes: When the value of the fourth identification information is the seventh value, determine not to filter the current color component of the current block using the first filter; When the value of the fourth identification information is the eighth value, determine to filter the current color component of the current block using the first filter.

26. The method according to claim 17, wherein, The method further includes: Set at least one of the scaling factor candidate lists.

27. The method according to claim 17, wherein, The method further includes: Decode the bitstream to determine the list number information; Set at least one of the scaling factor candidate lists according to the list number information.

28. The method according to claim 17 or 26, wherein The scaling factor candidate list includes at least one candidate scaling factor; wherein, the at least one candidate scaling factor is greater than 0.

29. An encoding method, applied to an encoder, the method includes: Adaptively determine the filtering coefficient and the filtering coefficient type parameter corresponding to the current image component of the current image; Determine the filtering identification information based on the filtering coefficient and write the filtering identification information into the bitstream; wherein, the filtering identification information is used to determine whether to filter the current image component of the current image using the first filter; When it is determined to filter the current image component of the current image using the first filter, write the filtering coefficient and the filtering coefficient type parameter into the bitstream.

30. The method according to claim 29, wherein, The adaptively determining the filtering coefficient and the filtering coefficient type parameter corresponding to the current image component of the current image includes: Determine the filtering coefficient and the filtering coefficient type parameter according to the rate-distortion optimization algorithm.

31. The method according to claim 30, wherein, The determining the filtering coefficient and the filtering coefficient type parameter according to the rate-distortion optimization algorithm includes: Determine the filtering coefficient in the first representation form according to the first data processing strategy and determine the first rate-distortion cost corresponding to the first representation form; Determine the filtering coefficient in the second representation form according to the second data processing strategy and determine the second rate-distortion cost corresponding to the second representation form; Determine the filtering coefficient and the filtering coefficient type parameter according to the first rate-distortion cost and the second rate-distortion cost.

32. The method according to claim 31, wherein The determining the filtering coefficient and the filtering coefficient type parameter according to the first rate-distortion cost and the second rate-distortion cost includes: When the first rate-distortion cost is less than the second rate-distortion cost, determine the filtering coefficient in the first representation form as the filtering coefficient and set the filtering coefficient type parameter to indicate that the filtering coefficient is in the first representation form; When the first rate - distortion cost is greater than the second rate - distortion cost, determine the filtering coefficient of the second representation form as the filtering coefficient, and set the filtering coefficient type parameter to indicate that the filtering coefficient is of the second representation form.

33. The method according to claim 31, wherein, the first data - processing strategy includes shaping; the second data - processing strategy includes shaping and mapping.

34. The method according to claim 31, wherein, The writing the filtering coefficient into the bitstream includes: when the filtering coefficient type parameter indicates that the filtering coefficient is of the first representation form, encoding the filtering coefficient according to the exponential Golomb coding method; when the filtering coefficient type parameter indicates that the filtering coefficient is of the second representation form, encoding the filtering coefficient according to the fixed - length coding method.

35. The method according to any one of claims 29-34, wherein The method further includes: when it is determined to filter the current image component of the current image using the first filter, determining the APS unit corresponding to the current image; determining the APS index corresponding to the current image according to the APS unit; writing the APS unit and the APS index into the bitstream.

36. The method according to claim 35, wherein The method further includes: writing the filtering coefficient and the filtering coefficient type parameter into the APS unit.

37. The method according to claim 35, wherein, the filtering coefficient type parameter includes at least one type parameter corresponding to the current image.

38. The method according to claim 36 or 37, wherein, the first filter includes CCALF or ALF.

39. The method according to claim 38, wherein, the filtering identification information includes first identification information or second identification information.

40. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 39, wherein, the first identification information is used to determine whether to filter using CCALF; the second identification information is used to determine whether to filter using ALF.

41. The method according to claim 40, wherein, the current image component includes a current luminance component or a current color component.

42. The method according to any one of claims 37 - 41, wherein The method further includes: when the current image component of the current image does not use the first filter for filtering, determining a first - generation value.

43. The method according to claim 42, wherein The determining the filtering identification information based on the filtering coefficient includes: when the current image component of the current image uses the first filter for filtering, determining a second - generation value based on the filtering coefficient; when the first - generation value is less than the second - generation value, setting the value of the filtering identification information to a first value, so that the filtering identification information indicates not to use the first filter to filter the current image component of the current image; when the first - generation value is greater than the second - generation value, setting the value of the filtering identification information to a second value, so that the filtering identification information indicates to use the first filter to filter the current image component of the current image.

44. The method according to any one of claims 37-41, wherein, The method further includes: determining a third - generation value of the new first filter corresponding to the filtering coefficient; Determine the fourth-generation value of other filters; wherein, the other filters at least include the fixed first filter and / or the multiplexed first filter; Determine third identification information according to the third-generation value and the fourth-generation value, and write the third identification information into the APS unit.

45. The method according to claim 44, wherein, The determining the third identification information according to the third-generation value and the fourth-generation value includes: When the third-generation value is less than the fourth-generation value, set the value of the third identification information to a third value, so that the third identification information indicates not to use the new first filter; When the third-generation value is greater than the fourth-generation value, set the value of the third identification information to a fourth value, so that the third identification information indicates to use the new first filter.

46. The method according to claim 41, wherein, The method further includes; Determine the scale factor corresponding to the current image component; Determine the reconstructed block of the current block in the current image according to the scale factor and the filtering coefficient.

47. The method according to claim 46, the method further includes: Set at least one of the scale factor candidate lists.

48. The method according to claim 47, wherein, The method further includes: Set at least one of the scale factor candidate lists; Write the list quantity information corresponding to the at least one scale factor candidate list into the bitstream.

49. The method according to claim 48, wherein, The scale factor candidate list includes at least one candidate scale factor; wherein, all of the at least one candidate scale factors are greater than 0.

50. The method according to claim 49, wherein, The determining the scale factor corresponding to the current color component of the current image includes: Traverse at least one of the candidate scale factors in the scale factor candidate list, and determine the rate-distortion cost corresponding to the candidate scale factor; Determine the candidate scale factor with the minimum rate-distortion cost as the optimal scale factor; Determine the optimal scale factor as the scale factor corresponding to the current color component of the current image.

51. The method according to claim 50, wherein, The traversing at least one of the candidate scale factors in the scale factor candidate list and determining the rate-distortion cost corresponding to the candidate scale factor includes: For any candidate scale factor in the scale factor candidate list, determine the filtering coefficient according to the candidate scale factor, and determine the reconstructed block of the current block according to the candidate scale factor and the filtering coefficient; Determine the rate-distortion cost corresponding to the candidate scale factor based on the reconstructed block of the current block.

52. The method according to claim 51, wherein, The method further includes: Determine the first filtering coefficient corresponding to the current color component of the current image.

53. The method according to claim 52, wherein, The determining the filtering coefficient according to the candidate scale factor includes: Determine the scaled coefficient according to the candidate scale factor and the first filtering coefficient; Determine the filtering coefficient according to the scaled coefficient.

54. The method according to claim 50, wherein The determining the scale factor corresponding to the current color component of the current image includes: Determine the scale factor corresponding to the current color component as the scale factor corresponding to the frame that was previously filtered using the first filter in the current image.

55. The method according to claim 54, wherein, The rate - distortion cost corresponding to the scale factor includes a first cost corresponding to the optimal scale factor and a second cost corresponding to the scale factor of the frame filtered by CCALF before and corresponding to the current color component.

56. [Corrected according to Rule 91 on 02.07.2024] The method according to claim 51, wherein, The method further includes: When using the optimal scale factor, determining a fourth cost corresponding to the current block; When multiplexing the scale factor corresponding to the current color component of the frame filtered by the first filter before in the current image, determining a fifth cost corresponding to the current block; When the current color component of the current image is not filtered by the first filter, determining a sixth cost corresponding to the current block; According to the fourth cost, the fifth cost, and the sixth cost, determining fourth identification information and writing the fourth identification information into the bitstream.

57. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 56, wherein, The determining the fourth identification information according to the fourth cost, the fifth cost, and the sixth cost includes: When the sixth cost is less than the fourth cost and the fifth cost, setting the value of the fourth identification information to a seventh value, so that the fourth identification information indicates not to filter the current color component of the current block by the first filter; When the sixth cost is greater than the fourth cost or the fifth cost, setting the value of the fourth identification information to an eighth value, so that the fourth identification information indicates to filter the current color component of the current block by the first filter.

58. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 47 or 48, wherein, The determining the scale factor corresponding to the current color component of the current image includes: Directly determining the scale factor corresponding to the current color component.

59. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 50, wherein, The determining the scale factor corresponding to the current color component of the current image includes: Determining the optimal scale factor in the scale factor candidate list; Determining the optimal scale factor as the scale factor corresponding to the current color component of the current image.

60. [Corrected according to Rule 91 on 02.07.2024] The method according to claim 47 or 48, wherein, The method further includes: Determining first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component; Writing the first scale factor information into the bitstream.

61. [Corrected according to Rule 91 on 02.07.2024] The method according to claim 60, wherein, The determining the first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component includes: Setting the first scale factor information according to the scale factor corresponding to the current color component and the scale factor candidate list.

62. [Corrected according to Rule 91 on 02.07.2024] The method according to claim 60, wherein, The determining the first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component includes: Determining the scale factor corresponding to the current color component as the first scale factor information.

63. [Corrected according to Rule 91 on 02.07.2024] The method according to claim 60, wherein, The determining the first scale factor information corresponding to the current color component according to the scale factor corresponding to the current color component includes: Performing a conversion according to the scale factor corresponding to the current color component to determine the first scale factor information.

64. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 51, wherein, The determining the reconstructed block of the current block according to the candidate scale factor and the filtering coefficient includes: For the current pixel in the current block, determine the filtered reconstructed value of the current color component of the current pixel according to the luminance reconstruction value of the reference pixel corresponding to the current pixel, the luminance reconstruction value of the current pixel, the reconstruction value of the current color component of the current pixel, the candidate scale factor, and the filtering coefficient; Based on the filtered reconstructed value of the current color component of the current pixel, determine the reconstructed block of the current block.

65. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 51 or 52, wherein The method further includes: Determine the APS unit corresponding to the current image; Determine the APS index corresponding to the current image according to the APS unit; Write the APS unit and the APS index into the bitstream.

66. [Corrected according to Rule 91 on 07.02.2024] The method according to claim 57 or 58, wherein, The APS unit corresponding to the current image includes at least one or more of the following information: the fourth identification information, the filtering coefficient corresponding to the current image component of the current image, and the first scale factor information corresponding to the current color component of the current image.

67. [Corrected according to Rule 91 on 02.07.2024] A bitstream generated by bit encoding according to information to be encoded; wherein, The information to be encoded includes at least: filtering identification information, the filtering coefficient corresponding to the current image component of the current image, the filtering coefficient type parameter corresponding to the current image component, the third identification information, the fourth identification information, the APS index corresponding to the current image, and the APS unit corresponding to the current image.

68. [Corrected according to Rule 91 on 07.02.2024] An encoder, the encoder includes a first determination unit; wherein, The first determination unit is configured to adaptively determine the filtering coefficient and the filtering coefficient type parameter corresponding to the current image component of the current image; Determine the filtering identification information based on the filtering coefficient and write the filtering identification information into the bitstream; wherein, the filtering identification information is used to determine whether to filter the current image component of the current image using the first filter; In the case of determining to filter the current image component of the current image using the first filter, write the filtering coefficient and the filtering coefficient type parameter into the bitstream.

69. [Corrected according to Rule 91 on 07.02.2024] An encoder, the encoder includes a first memory and a first processor; wherein, The first memory is used to store a computer program that can run on the first processor; The first processor is used to execute the method according to any one of claims 29 to 66 when running the computer program.

70. [Corrected according to Rule 91 on 07.02.2024] A decoder, the decoder includes a second determination unit; wherein, The second determination unit is configured to decode the bitstream, determine the filtering identification information; in the case of determining to filter the current image component of the current image using the first filter based on the filtering identification information, determine the filtering coefficient type parameter corresponding to the current image component; Determine the filtering coefficient corresponding to the current image component according to the filtering coefficient type parameter; Determine a reconstructed block of a current block in the current image according to the filtering coefficient.

71. [Corrected according to Rule 91 on 07.02.2024] A decoder, the decoder includes a second memory and a second processor; wherein, the second memory is configured to store a computer program that can run on the second processor; the second processor is configured to execute the method according to any one of claims 1 to 28 when running the computer program.

72. [Corrected according to Rule 91 on 02.07.2024] A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 28, or implements the method according to any one of claims 29 to 66.

Citation Information

Patent Citations

  • Adaptive in-loop filtering method and apparatus

    CN113940085A

  • An adaptive loop filter

    GB2591446A

  • Video coding method and system, video decoding method and system, video coder and video decoder

    WO2022155922A1

  • Methods and systems for cross-component adaptive loop filter

    WO2023277810A2