Coding and decoding methods, bitstream, coder, decoder, and storage medium

By introducing a fixed filter in video encoding to filter pixels with similar textures, and using preset constant values ​​as filter coefficients, the problem of low encoding and decoding efficiency in existing technologies is solved, and codeword overhead is reduced while encoding and decoding performance is improved.

WO2026007150A1PCT designated stage Publication Date: 2026-01-08GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/104105
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2026-01-08

AI Technical Summary

Technical Problem

In multi-functional video coding, existing technologies encode similar filters for different sequences of images, resulting in low encoding and decoding efficiency and high codeword overhead.

Method used

A fixed filter is introduced to filter pixels with similar textures. A preset constant value is used as the first filter coefficient to reduce the encoding of filter coefficients during the encoding and decoding process. Filtering is performed by determining the filter identification information.

Benefits of technology

While ensuring filtering effect, it significantly reduces codeword overhead and improves encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024104105_08012026_PF_FP_ABST
    Figure CN2024104105_08012026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present application are coding and decoding methods. The decoding method comprises, at a decoding end: determining first filter identifier information and second filter identifier information, the first filter identifier information being used for determining whether to perform a first filter, the second filter identifier being used for determining whether to perform a second filter, the first filter being used for determining, at least on the basis of a first reconstructed value of a luma component and a first filter coefficient, a first chroma sample correction value, the second filter being used for determining, at least on the basis of a second reconstructed value of the luma component and a second filter coefficient, a second chroma sample correction value, the first filter coefficient comprising a preset constant value, and the second filter coefficient being determined on the basis of an APS; on the basis of the first filter identifier information and the second filter identifier information, performing the filters to determine the first chroma sample correction value and / or the second chroma sample correction value; and, on the basis of the first chroma sample correction value and / or the second chroma sample correction value, determining a filtered reconstructed value.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, bitstream, encoder, decoder and storage medium TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of image processing, and particularly relate to a coding and decoding method, a bitstream, an encoder, a decoder and a storage medium. BACKGROUND

[0002] In the loop filter in the Versatile Video Coding (VVC), there are 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 minimize the mean square error between the chroma reconstructed image and the original image by using the luminance information.

[0003] For multiple sequences, there may be similar textures between images and images. However, in common techniques, multiple similar filters are encoded for different sequences, which consumes more bits and reduces the coding efficiency.

[0004] SUMMARY

[0005] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder and a storage medium, which can greatly reduce the codeword overhead while ensuring the filtering effect and improve the coding and decoding performance.

[0006] The technical solution of the embodiments of the present application can be implemented as follows:

[0007] In a first aspect, the embodiments of the present application provide a decoding method applied to a decoder, and the method comprises:

[0008] determining first filter identification information and second filter identification information; wherein the first filter identification information is used to determine whether to perform a first filter, and the second filter identification is used to determine whether to perform a second filter; the first filter is used to determine a first chroma sample correction value according to at least a first reconstructed value of a luminance component and a first filter coefficient, and the second filter is used to determine a second chroma sample correction value according to at least a second reconstructed value of a luminance component and a second filter coefficient; the first filter coefficient comprises a preset constant value, and the second filter coefficient is determined based on an adaptive parameter set (APS);

[0009] filtering according to the first filter identification information and the second filter identification information, to determine the first chroma sample correction value and / or the second chroma sample correction value;

[0010] determining a filtered reconstruction value according to the first chroma sample correction value and / or the second chroma sample correction value.

[0011] In a second aspect, an encoding method is provided, which is applied to an encoder, and the method comprises:

[0012] determining a first generation value corresponding to performing first filtering, determining a second generation value corresponding to performing second filtering, and determining a third generation value corresponding to performing the first filtering and the second filtering, wherein the first filtering is used to determine a first chroma sample correction value according to a first reconstruction value of a luma component and a first filter coefficient, the second filtering is used to determine a second chroma sample correction value according to a second reconstruction value of the luma component and a second filter coefficient, the first filter coefficient comprises a preset constant value, and the second filter coefficient is determined based on APS;

[0013] determining first filter identification information and second filter identification information according to the first generation value, the second generation value, and the third generation value, wherein the first filter identification information is used to determine whether to perform the first filtering, and the second filter identification is used to determine whether to perform the second filtering;

[0014] filtering according to the first filter identification information and the second filter identification information, to determine the first chroma sample correction value and / or the second chroma sample correction value;

[0015] determining a filtered reconstruction value according to the first chroma sample correction value and / or the second chroma sample correction value.

[0016] In a third aspect, an encoded bitstream is provided, which is generated by bit encoding to-be-encoded information, wherein the to-be-encoded information comprises one or more of first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, eighth syntax element identification information, ninth syntax element identification information, tenth syntax element identification information, and eleventh syntax element identification information.

[0017] In a fourth aspect, an encoder is provided, which comprises a first determination unit, wherein the first determination unit is configured to:

[0018] The first determining unit is configured to determine a first generation value corresponding to execution of first filtering, determine a second generation value corresponding to execution of second filtering, and determine a third generation value corresponding to execution of the first filtering and the second filtering, wherein the first filtering is used to determine a first chroma sample correction value according to a first reconstructed value of a luma component and a first filtering coefficient, the second filtering is used to determine a second chroma sample correction value according to a second reconstructed value of the luma component and a second filtering coefficient, the first filtering coefficient includes a preset constant value, and the second filtering coefficient is determined based on APS; the first filtering identification information and the second filtering identification information are determined according to the first generation value, the second generation value, and the third generation value; the first filtering identification information is used to determine whether to execute the first filtering, the second filtering identification is used to determine whether to execute the second filtering; the first chroma sample correction value and / or the second chroma sample correction value are determined according to filtering performed according to the first filtering identification information and the second filtering identification information; and a reconstructed value after filtering is determined according to the first chroma sample correction value and / or the second chroma sample correction value.

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

[0020] The first memory is configured to store a computer program capable of running on the first processor.

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

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

[0023] The second determining unit is configured to determine first filtering identification information and second filtering identification information; wherein the first filtering identification information is used to determine whether to execute first filtering, and the second filtering identification is used to determine whether to execute second filtering; the first filtering is used to determine a first chroma sample correction value according to at least a first reconstructed value of a luma component and a first filtering coefficient, the second filtering is used to determine a second chroma sample correction value according to at least a second reconstructed value of the luma component and a second filtering coefficient, the first filtering coefficient includes a preset constant value, and the second filtering coefficient is determined based on APS; the first chroma sample correction value and / or the second chroma sample correction value are determined according to filtering performed according to the first filtering identification information and the second filtering identification information; and a reconstructed value after filtering is determined according to the first chroma sample correction value and / or the second chroma sample correction value.

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

[0025] the second memory, configured to store a computer program capable of running on the second processor;

[0026] the second processor, configured to execute the decoding method as described above when running the computer program.

[0027] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed to implement the decoding method in the first aspect, or to implement the encoding method in the second aspect.

[0028] In a ninth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium being configured to store a code stream generated by the encoding method in the first aspect.

[0029] The embodiment of the present application provides a coding method, a code stream, an encoder, a decoder and a storage medium. At a decoding end, first filter identification information and second filter identification information are determined; the first filter identification information is used for determining whether to perform first filtering, and the second filter identification is used for determining whether to perform second filtering; the first filtering is used for determining a first chroma sample correction value according to at least a first reconstruction value of a luminance component and a first filter coefficient, and the second filtering is used for determining a second chroma sample correction value according to at least a second reconstruction value of the luminance component and a second filter coefficient; the first filter coefficient comprises a preset constant value, and the second filter coefficient is determined based on APS; filtering is performed according to the first filter identification information and the second filter identification information, to determine the first chroma sample correction value and / or the second chroma sample correction value; and a filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value. At an encoding end, a first generation value corresponding to the first filtering is determined; a second generation value corresponding to the second filtering is determined; a third generation value corresponding to the first filtering and the second filtering is determined; the first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value; the first filter identification information is used for determining whether to perform the first filtering, and the second filter identification is used for determining whether to perform the second filtering; filtering is performed according to the first filter identification information and the second filter identification information, to determine the first chroma sample correction value and / or the second chroma sample correction value; and the filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value. Therefore, in the embodiment of the present application, the first filtering implemented by a fixed filter can be introduced to filter pixels with similar textures, wherein the first filter coefficient used when the first filtering is performed is a preset constant value which does not need to be coded, so that the first filtering is performed on the pixels with similar textures by the fixed filter, the code word overhead can be greatly reduced while the filtering effect is ensured, and the coding performance is improved. BRIEF DESCRIPTION OF DRAWINGS

[0030] FIG. 1 is an application schematic diagram of an encoding framework provided by the related art;

[0031] FIG. 2 is a shape schematic diagram of a common CCALF filter;

[0032] FIG. 3 is a component block diagram schematic diagram of a video encoding system provided by the embodiment of the present application;

[0033] FIG. 4 is a component block diagram schematic diagram of a video decoding system provided by the embodiment of the present application;

[0034] FIG. 5 is a schematic diagram of a decoding method provided by the embodiment of the present application;

[0035] FIG. 6 is a schematic diagram one of a fixed filter provided by the embodiment of the present application;

[0036] Fig. 7 is a schematic diagram of the fixed filter according to an embodiment of the present application;

[0037] Fig. 8 is a schematic diagram of the new CCALF filter according to an embodiment of the present application;

[0038] Fig. 9 is a schematic diagram of the encoding method according to an embodiment of the present application;

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

[0040] Fig. 11 is a schematic diagram of the specific hardware structure of the encoder according to an embodiment of the present application;

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

[0042] Fig. 13 is a schematic diagram of the specific hardware structure of the decoder according to an embodiment of the present application;

[0043] Fig. 14 is a schematic diagram of the structure of the codec system according to an embodiment of the present application. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It can be understood that the specific embodiments described herein are only used to explain the related application, but not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for convenience of description.

[0045] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. It should be noted that the terms "first", "second", "third" in the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that "first", "second", "third" can be interchanged in a specific order or sequence as allowed, 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 mainly compresses large digital video data for transmission and storage. With the rapid growth of Internet video and the increasing demand for video clarity, although existing digital video compression standards can save a lot of video data, better digital video compression technology is still needed to reduce the bandwidth and traffic pressure of digital video transmission.

[0047] In a digital video encoding process, an encoder reads unequal pixels of an original video sequence in different color formats, including luminance components and chrominance components, that is, the encoder reads a black and white or color image. Then, the image is divided into blocks, and the block data is transmitted to the encoder for encoding.

[0048] Among them, the common encoder is usually a hybrid framework encoding mode, which generally includes intra-frame and inter-frame prediction, transformation and quantization, inverse transformation and inverse quantization, loop filtering and entropy encoding, etc. FIG. 1 is an application schematic diagram of an encoding framework provided by the related art. As shown in FIG. 1, the hybrid encoding framework can include a prediction module 11, a transformation and quantization module 12, an entropy encoding module 13, an inverse quantization and inverse transformation module 14, a loop filtering module 15 and a decoded picture buffer module 16. Among them, the prediction module 11 can include an intra-frame prediction module 11a and an inter-frame prediction module 11b, and the inter-frame prediction module 11b can include a motion estimation module (Motion Estimation) and a motion compensation module (Motion Compensation).

[0049] Intra-frame prediction only refers to the information of the same frame image to predict the pixel information in the current divided block, which 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 divided block, which is used to eliminate temporal redundancy; transformation converts the predicted image block to the frequency domain, and the energy is redistributed, which, combined with quantization, can remove the information that is not sensitive to the human eye, which is used to eliminate visual redundancy; loop filtering uses the statistical information of the image to filter the image to improve the subjective and objective quality of the image; entropy encoding can eliminate character redundancy according to the current context model and the probability information of the binary code stream.

[0050] In the latest standard VVC and the traditional video encoding exploration platform reference software test model (Enhanced Compression Model, ECM) of JVET, the in loop filter mainly includes a bilateral filter, a luma mapping with chroma scaling (LMCS), a de-blocking filter (DBF), a sample adaptive offset (SAO), an adaptive loop filter (ALF) and a cross component adaptive loop filter (CCALF).

[0051] Among them, the cross-component adaptive loop filtering (CCALF) is a filter designed to minimize the mean square error between the chrominance reconstructed image and the original image using luminance information. CCALF processes the chrominance components Cb and Cr separately, and each component has its own filter. Each component is allowed to use up to 16 filters, corresponding to 16 categories respectively. CCALF classifies each coding tree unit (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 respectively, and then the Wiener-Hopf equation is constructed to calculate the filter coefficients of the category by solving the equation. Each CTU selects the filter corresponding to the category for filtering, and writes the filtered result into the reconstructed image. In addition, the filter coefficients need to be written into the adaptive parameter set (APS), and the corresponding syntax elements are written into the code stream through entropy coding.

[0052] In the ECM, the shape of the CCALF filter is shown in FIG. 2. In the left figure, x represents the position of the luminance pixel corresponding to the to-be-filtered chrominance pixel, and the numbers represent the adjacent luminance pixels. The right figure is also the position information of the adjacent luminance pixels, the difference is that the left figure inputs the reconstructed information of the luminance pixel, and the right figure inputs the residual information of the luminance pixel. It can be seen that the filter needs to input 28 values, which correspond to 28 filter coefficients according to their positions in the filter, as shown in the right figure. Among them, 0, 1, 2, …, 25, 26, x represent the filter coefficient index, and it needs to be explained that the coefficient at x is generally not calculated and is 0 by default.

[0053] In the ECM encoder, CCALF classifies CTUs, and the classification process uses a rate-distortion optimization function (RDO) to make decisions, and each pixel in the CTU belongs to the same category. Specifically, when the cost calculated by using a filter of a certain category for the CTU is the smallest, the category of the CTU is the category of the filter. Of course, if the cost of not filtering is smaller than the cost of using the filter, the CTU is not filtered, and at this time the CTU has no category. Whether the CTU is filtered and the corresponding category information are written into the code stream and transmitted to the decoding end.

[0054] After determining the category of each CTU, the covariance matrix and error vector of all pixels in the same category are accumulated respectively. Specifically, for each pixel, its covariance matrix A is a 27x27 matrix. Let each element of matrix A be a i,j , i, j ∈ [0, 1, 2, …, 25, 26], and for a i,j , the value is: ai,j =R(i)×R(j) (1)

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

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

[0057] The error vector B is a 27x1 vector. Let each element of vector B be b. i Where i∈[0,1,2,…,25,26], for b i Its value is: b i =R(i)×E (3)

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

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

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

[0061] It should be noted that the filter coefficients obtained from the equations are all floating-point numbers. Since the range of floating-point numbers is almost unlimited, encoding these coefficients requires a significant number of bits. To address this issue, the ECM encoder converts the filter coefficients to integers. First, the filter coefficients are scaled: c′ i =2 scale ×c i (5)

[0062] Among them, c i c′ represents the filter coefficients used to solve the Wiener-Hoppt equation, where scale is the scaling factor, set to a fixed value of 7 in ECM. i This is the scaled value. After obtaining c′... i Then, for c′i A look-up table is performed to select the number closest to c' from {-64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64} by comparison i as the quantized coefficient

[0063] After obtaining the quantized filter coefficient c f Next, the pixel needs to be filtered. The filtering process is as follows:

[0064] where recC' is the filtered coefficient. recC, recY(i), recY(x), scale, etc. have been described above, and will not be repeated here. After filtering the pixel that needs to be filtered, it is written into the reconstructed image. For the pixel that does not need to be filtered, it is directly written into the reconstructed image.

[0065] In addition, the related syntax elements need to be written into the code stream. For example, the current frame CCALF switch, whether each CTU is filtered, and the corresponding category information, etc. If a new filter is needed, the number of filters and the coefficients of each filter need to be written into the APS. Finally, the APS ID used by the frame is written into the slice header or picture header information.

[0066] At the ECM decoding end, after receiving the code stream, the current frame CCALF switch, whether each CTU is filtered, and the corresponding category information, etc. are determined. In addition, the APS ID is parsed, and the corresponding APS is selected to determine the coefficients of the filter. The pixel that needs to be filtered is filtered, and it is written into the reconstructed image. For the pixel that does not need to be filtered, it is directly written into the reconstructed image

[0067] In the ECM of the traditional video coding exploration platform of JVET, CCALF is filtered using a new filter determined by the current frame image or the previous frame image of the current frame image, that is, the new filter is a frame-level filter. For multiple sequences, there may be similar textures between their images and images, and these images with similar textures can use the same filter for filtering. However, in the common technology, multiple similar filters are encoded for different sequences, which consumes more bits and reduces the coding efficiency.

[0068] That is, considering that there are similar texture pixels in different sequences, different filters are coded for the pixels with similar textures, which consumes a large number of code words.

[0069] To solve the above problems, the embodiment of the present application provides a coding method, a code stream, an encoder, a decoder and a storage medium. At the decoding end, first filter identification information and second filter identification information are determined; the first filter identification information is used to determine whether to perform first filtering, and the second filter identification is used to determine whether to perform second filtering; the first filtering is used to determine a first chroma sample correction value according to at least a first reconstruction value of a luminance component and a first filter coefficient, and the second filtering is used to determine a second chroma sample correction value according to at least a second reconstruction value of the luminance component and a second filter coefficient; the first filter coefficient includes a preset constant value, and the second filter coefficient is determined based on APS; filtering is performed according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value; and a filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value. At the encoding end, a first generation value corresponding to the execution of the first filtering is determined; a second generation value corresponding to the execution of the second filtering is determined; a third generation value corresponding to the execution of the first filtering and the second filtering is determined; the first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value; the first filter identification information is used to determine whether to perform the first filtering, and the second filter identification is used to determine whether to perform the second filtering; filtering is performed according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value; and a filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value. It can be seen that, in the embodiment of the present application, the first filtering implemented by a fixed filter can be introduced to filter pixels with similar textures, wherein the first filter coefficient used when the first filtering is performed is a preset constant value that does not need to be coded, so that the first filtering is performed on the pixels with similar textures by the fixed filter, the code word overhead can be greatly reduced while the filtering effect is guaranteed, and the coding performance is improved.

[0070] Referring to FIG. 3, an example of a system composition block diagram of an encoder provided by the embodiment of the present application is shown. As shown in FIG. 3, the encoder 10 can include a partition unit 101, a prediction unit 102, a first adder 107, a transformation unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transformation unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (DPB) unit 114 and an entropy encoding unit 115. Here, the input of the encoder 10 can be a video composed of a series of pictures or a still picture, and the output of the encoder 10 can be a bit stream (also referred to as a "code stream") used to represent the compressed version of the input video.

[0071] The partition unit 101 partitions a picture in an input video into one or more Coding Tree Units (CTUs). The partition unit 101 partitions the picture into a plurality of tiles (or tiles), and can further partition a tile into one or more bricks, where a tile or a brick can include one or more complete and / or partial CTUs. In addition, the partition unit 101 can form one or more slices, where a slice can include one or more tiles arranged in raster order in the picture, or cover one or more tiles of a rectangular region in the picture. The partition unit 101 can also form one or more sub-pictures, where a sub-picture can include one or more slices, tiles, or bricks.

[0072] During the encoding process of the encoder 10, the partition unit 101 delivers a CTU to the prediction unit 102. Generally, the prediction unit 102 can be composed of a block partition unit 103, a Motion Estimation (ME) unit 104, a Motion Compensation (MC) unit 105, and an intra-prediction unit 106. Specifically, the block partition unit 103 iteratively partitions an input CTU into smaller Coding Units (CUs) using quad-tree partitioning, binary-tree partitioning, and ternary-tree partitioning. The prediction unit 102 can obtain an inter-predicted block for a CU using the ME unit 104 and the MC unit 105. The intra-prediction unit 106 can obtain an intra-predicted block for a CU using various intra-prediction modes including MIP mode. In an example, rate-distortion optimized motion estimation approaches can be invoked by the ME unit 104 and the MC unit 105 to obtain the inter-predicted block, and rate-distortion optimized mode determination approaches can be invoked by the intra-prediction unit 106 to obtain the intra-predicted block.

[0073] The prediction unit 102 outputs the prediction block of the CU, the first adder 107 calculates the difference between the CU in the output of the partition 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 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 transforms in the transform unit 108 and outputs reconstructed residuals. The second adder 112 calculates the reconstructed CU by adding the reconstructed residuals 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 to be used as an intra prediction reference. After all CUs in a picture or sub-picture are reconstructed, the filter unit 113 performs loop filtering on the reconstructed picture or sub-picture. Here, the filter unit 113 contains one or more filters, such as a deblocking filter, a Sample Adaptive Offset (SAO) filter, an Adaptive Loop Filter (ALF), a Luma Mapping with Chroma Scaling (LMCS) filter, and a neural network based filter, etc. Alternatively, when the filter unit 113 determines that a CU is not used as a reference for encoding of other CUs, the filter unit 113 performs loop filtering on one or more target pixels in the CU.

[0074] The output of the filter unit 113 is the decoded picture or sub-picture, which is buffered to the DPB unit 114. The DPB unit 114 outputs the decoded picture or sub-picture according to the timing and control information. Here, the pictures stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter prediction or intra prediction. Finally, the entropy encoding unit 115 converts the parameters necessary for decoding the picture from the encoder 10 (such as control parameters and supplemental information, etc.) into binary form, and writes such binary form into the bitstream according to the syntax structure of each data unit, i.e. the encoder 10 finally outputs the bitstream.

[0075] Further, the encoder 10 can be a computing device having a first processor and a first memory recording a computer program. When the first processor reads and runs the computer program, the encoder 10 reads the input video and generates the corresponding bitstream. In addition, the encoder 10 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 the figure.

[0076] Referring to FIG. 4, an example of a system composition diagram of a decoder is shown. As shown in FIG. 4, the decoder 20 can include a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filter unit 208, and a decoded picture buffer unit 209. Here, the input of the decoder 20 is a bitstream representing a compressed version of a video or a still picture, and the output of the decoder 20 can be a decoded video consisting of a series of pictures or a decoded still picture.

[0077] The input bitstream of the decoder 20 can be the bitstream generated by the encoder 10. The parsing unit 201 parses the input bitstream and obtains values of syntax elements from the input bitstream. The parsing unit 201 converts the binary representation of the syntax elements into numeric values and sends the numeric values to the units in the decoder 20 to obtain one or more decoded pictures. The parsing unit 201 can also parse one or more syntax elements from the input bitstream to display the decoded pictures.

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

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

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

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

[0082] The adder 207 performs an addition operation on its inputs (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 coded in the intra prediction mode.

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

[0084] Further, the decoder 20 can be a computing device with a second processor and a second memory recording a computer program. When the first processor reads and runs the computer program, the decoder 20 reads the input bitstream and generates the corresponding decoded video. In addition, the decoder 20 can also be a computing device with 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 the figure.

[0085] It also needs to be explained that when the embodiments of the present application are applied to the encoder 10, the "current block" specifically refers to the current block to be encoded (which can also be referred to as "encoding block") in the video image; when the embodiments of the present application are applied to the decoder 20, the "current block" specifically refers to the current block to be decoded (which can also be referred to as "decoding block") in the video image.

[0086] Based on FIG. 3, the encoding method in the embodiments of the present application is mainly applied to the "filter unit 113" part in the encoder 10.

[0087] Based on FIG. 4, the decoding method in the embodiments of the present application is mainly applied to the "filter unit 208" part in the decoder 20.

[0088] That is, the encoding and decoding method in the embodiments of the present application can be applied to a video encoding system (referred to as "encoder") and a video decoding system (referred to as "decoder"), and can even be applied to both a video encoding system and a video decoding system, but here is not limited in any way.

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

[0090] An embodiment of the present application provides a decoding method, which is applied to a decoder and used in a scenario of performing filtering processing through loop filtering. FIG. 5 is a schematic diagram of the decoding method according to an embodiment of the present application. As shown in FIG. 5, the method of performing decoding processing by the decoder can include the following steps.

[0091] In step 1001, first filtering identification information and second filtering identification information are determined. The first filtering identification information is used to determine whether to perform first filtering, and the second filtering identification is used to determine whether to perform second filtering. The first filtering is used to determine a first chroma sample correction value according to at least a first reconstructed value of a luminance component and a first filtering coefficient, and the second filtering is used to determine a second chroma sample correction value according to at least a second reconstructed value of the luminance component and a second filtering coefficient. The first filtering coefficient includes a preset constant value, and the second filtering coefficient is determined based on an APS.

[0092] In the embodiments of the present application, the first filtering identification information and the second filtering identification information can be determined respectively.

[0093] It should be noted that, in the embodiments of the present application, the first filtering identification information can be used to determine whether to perform the first filtering.

[0094] Further, in the embodiments of the present application, the first filtering can include filtering according to a first filtering coefficient. The first filtering coefficient can include a preset constant value, that is, the filtering coefficient used when performing the first filtering is a fixed value determined in advance.

[0095] For example, in some embodiments, the first filtering includes but is not limited to filtering through a fixed filter.

[0096] It can be understood that, in the embodiments of the present application, considering that there are pixels with similar textures in different sequences, the same or similar filter can be selected to filter the pixels with similar textures, so that the coding and decoding of different filters can be no longer performed, and the code word overhead can be greatly reduced.

[0097] Further, in the embodiments of the present application, when performing the first filtering, the corresponding input information can include at least the first reconstructed value of the luminance component, and the corresponding output information can be the first chroma sample correction value. The first chroma sample correction value can be understood as related information of the chroma component, including but not limited to chroma reconstruction information. For example, the input of the first filtering can be the luminance reconstruction information, and the output can be the chroma reconstruction information.

[0098] It can be understood that, in the embodiments of the present application, when performing the first filtering, in addition to the luminance reconstruction information, the corresponding input information can also include chroma reconstruction information, luminance residual information, and other luminance or chroma related sample information, which is not limited in the present application.

[0099] Further, in the embodiments of the present application, the input information of the fixed filter can be one or more of the following information: prediction information of luminance, residual information of luminance or luminance reconstruction information before de-blocking filtering, luminance reconstruction information after de-blocking filtering, SAO output luminance reconstruction information, ALF output luminance reconstruction information, prediction information of chroma, residual information of chroma or chroma reconstruction information before de-blocking filtering, chroma reconstruction information after de-blocking filtering, SAO output chroma reconstruction information, ALF output chroma reconstruction information, ALF fixed filter output luminance information, ALF fixed filter output chroma information, transformed luminance information or chroma information.

[0100] Further, in the embodiments of the present application, assuming that the first filtering is filtering using a fixed filter, the shape, type, and tap number of the fixed filter can also be different corresponding to different input information of the first filtering.

[0101] Exemplarily, in some embodiments, FIG. 6 is a schematic diagram of a fixed filter according to an embodiment of the present application, as shown in FIG. 6, the input of the fixed filter is the reconstruction value of the luminance sample output by the SAO, x in the fixed filter represents the position of the luminance sample corresponding to the chroma sample to be filtered, and the numbers correspond to the positions of the adjacent luminance samples. Among them, 0, 1, 2, … x, … 29, 30 represent the filter coefficient indexes. The value at x is usually defaulted to 0.

[0102] Exemplarily, in some embodiments, FIG. 7 is a schematic diagram of a fixed filter according to an embodiment of the present application, as shown in FIG. 7, the input of the left filter in the fixed filter is the reconstruction value of the luminance sample output by the SAO, x represents the position of the luminance sample corresponding to the chroma sample to be filtered, and the numbers correspond to the positions of the adjacent luminance samples; the input of the right filter in the fixed filter is the reconstruction value of the chroma sample output by the SAO, x represents the chroma sample to be filtered, and the numbers correspond to the positions of the adjacent chroma samples. Among them, 0, 1, 2, … x, … 29, 30, 31, 32, … x, … 41, 42 represent the filter coefficient indexes. The value at x is usually defaulted to 0.

[0103] Further, in embodiments of the present disclosure, the filter coefficients of the fixed filter are extracted from the video data set. There are various ways to obtain the filter coefficients of the fixed filter, including but not limited to using a Wiener filter method to calculate the filter coefficients, using a least square method to calculate the filter coefficients, using a neural network to learn the filter coefficients, which are not specifically limited in the present disclosure.

[0104] It should be noted that in embodiments of the present disclosure, the filter coefficients of the fixed filter can be integer numbers or floating point numbers, which are not specifically limited in the present disclosure.

[0105] It should be noted that in embodiments of the present disclosure, the second filter identification information can be used to determine whether to perform the second filtering.

[0106] Further, in embodiments of the present disclosure, the second filtering can include filtering according to the second filter coefficients. The second filter coefficients can be determined based on the APS. The second filter coefficients can be determined by analyzing the APS corresponding to the current image, or can be determined by analyzing the APS corresponding to other images, which are not specifically limited in the present disclosure.

[0107] For example, the second filtering can be filtering by a CCALF new filter.

[0108] Further, in embodiments of the present disclosure, when performing the second filtering, the corresponding input information can at least include the second reconstructed value of the luma component, and the corresponding output information can be the second chroma sample correction value. The second chroma sample correction value can be understood as related information of the chroma component, including but not limited to chroma reconstruction information. For example, the input of the second filtering can be the luma reconstruction information, and the output can be the chroma reconstruction information.

[0109] It can be understood that in embodiments of the present disclosure, when performing the second filtering, in addition to the luma reconstruction information, the corresponding input information can also include the chroma reconstruction information, the luma residual information and other luma or chroma related sample information, which are not specifically limited in the present disclosure.

[0110] Further, in embodiments of the present application, the input information of the fixed filter can be one or more of the following information: prediction information of luma, residual information of luma or luma reconstruction information before de-blocking filtering, luma reconstruction information after de-blocking filtering, luma reconstruction information output by SAO, luma reconstruction information output by ALF, prediction information of chroma, residual information of chroma or chroma reconstruction information before de-blocking filtering, chroma reconstruction information after de-blocking filtering, chroma reconstruction information output by SAO, chroma reconstruction information output by ALF, luma information output by ALF fixed filter, chroma information output by ALF fixed filter, luma information after transform processing or chroma information after transform processing.

[0111] Further, in embodiments of the present application, the output of the first filtering can also be used as the input information of the second filtering, and the second filtering is performed based on the input information. For example, after the first chroma sample modification value is output by the first filtering performed by the fixed filter, the first chroma sample modification value can be input into the subsequent CCALF new filter to perform the second filtering, and then the second chroma sample modification value is output.

[0112] Further, in embodiments of the present application, when the first filtering identification information and the second filtering identification information are determined, the syntax element identification information can be obtained by decoding the code stream, and then the first filtering identification information and the second filtering identification information are determined based on the obtained syntax element identification information.

[0113] For example, in some embodiments, one syntax element identification information indicating the enabling condition of the first filtering and the second filtering can be obtained by decoding the code stream, and then the first filtering identification information indicating whether the first filtering is performed and the second filtering identification information indicating whether the second filtering is performed can be determined based on the one syntax element identification information.

[0114] For example, in some embodiments, one syntax element identification information indicating the enabling condition of the first filtering can be obtained by decoding the code stream, and another syntax element identification information indicating the enabling condition of the second filtering can also be obtained, and then the first filtering identification information indicating whether the first filtering is performed and the second filtering identification information indicating whether the second filtering is performed can be determined based on the two syntax element identification information.

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

[0116] It can be understood that in the embodiments of the present application, the image component of the current image can include a current luminance component or a current chroma component. Wherein the current chroma component of the current image can be a first chroma component or a second chroma component. For example, the current chroma component can be understood as a blue chroma component of the current image, that is, the current chroma component can be a U component; the current chroma component can also be understood as a red chroma component of the current image, that is, the current chroma component can be a V component. The present application does not make specific limitation.

[0117] Step 1002, filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value.

[0118] In the embodiments of the present application, after the first filter identification information and the second filter identification information are determined, the first filter identification information and the second filter identification information can be further filtered to determine the first chroma sample correction value by the first filtering, and / or the second chroma sample correction value by the second filtering.

[0119] Further, in the embodiments of the present application, based on the first filter identification information and the second filter identification information, it can be determined that the following three filters are included: only the first filter is executed, only the second filter is executed, and the first filter and the second filter are executed simultaneously.

[0120] Correspondingly, in the embodiments of the present application, if only the first filter is executed, the obtained filtering result is the first chroma sample correction value, if only the second filter is executed, the obtained filtering result is the second chroma sample correction value, and if the first filter and the second filter are executed simultaneously, the obtained filtering result is the first chroma sample correction value and the second chroma sample correction value.

[0121] Further, in embodiments of the present application, when performing filtering according to the first filtering identification information and the second filtering identification information, determining the first chroma sample modification value and / or the second chroma sample modification value, in the case that the first filtering identification information indicates performing first filtering and the second filtering identification information indicates not performing second filtering, the first filtering coefficient and the number of times of performing first filtering are determined; and then first filtering is performed according to the first filtering coefficient and the number of times of performing first filtering, and the first chroma sample modification value is determined.

[0122] It should be noted that in embodiments of the present application, if it is determined based on the first filtering identification information and the second filtering identification information that only first filtering is performed, for example, it is determined that only fixed filter is used for filtering processing, then the determination of the first filtering coefficient and the number of times of performing first filtering can be performed first.

[0123] Further, in embodiments of the present application, when determining the first filtering coefficient and the number of times of performing first filtering, the code stream can be decoded first, and the first syntax element identification information and the second syntax element identification information are determined; then the fixed filtering index can be determined according to the first syntax element identification information, and the first filtering coefficient is determined according to the fixed filtering index; at the same time, the number of times of performing first filtering can be determined according to the second syntax element identification information.

[0124] It should be noted that in embodiments of the present application, the first syntax element identification information can be used to determine the fixed filter group index filterSetIdx corresponding to the first filtering coefficient, that is, to determine the fixed filtering index.

[0125] It can be understood that in embodiments of the present application, the value of the first syntax element identification information can be used to determine the corresponding fixed filtering index, so that the corresponding fixed filter group can be determined from the candidate filter group according to the fixed filtering index, and then the first filtering coefficient can be determined based on the fixed filter group.

[0126] It should be noted that in embodiments of the present application, the value range of the first syntax element identification information can depend on the number of candidate filter groups, that is, the number of candidate filter groups can determine the value range of the first syntax element identification information.

[0127] Further, in embodiments of the present application, the first syntax element identification information can be a flag, wherein the first syntax element identification information can be an image-level flag, or a slice-level flag. The present application does not make specific limitation.

[0128] Exemplarily, in some embodiments, if the current color component of the current slice is chroma C bIf the current color component is the luma Y component, the first syntax element identification information can be represented by the syntax element sh_alf_cc_y_fixed_filter_set_idx, i.e., the value of sh_alf_cc_y_fixed_filter_set_idx can be used to determine the fixed filter index filterSetIdx.

[0129] Exemplarily, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include the fixed filter set 0 and the fixed filter set 1, when the value of sh_alf_cc_cb_fixed_filter_set_idx is 0, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of sh_alf_cc_cb_fixed_filter_set_idx is 1, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0130] Of course, the number of candidate filter sets is not limited to 2, and correspondingly, the value of sh_alf_cc_cb_fixed_filter_set_idx is not limited to 0 and 1, which is not specifically limited in the present application.

[0131] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C r If the current color component is the luma Y component, the first syntax element identification information can be represented by the syntax element sh_alf_cc_y_fixed_filter_set_idx, i.e., the value of sh_alf_cc_y_fixed_filter_set_idx can be used to determine the fixed filter index filterSetIdx.

[0132] Exemplarily, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include the fixed filter set 0 and the fixed filter set 1, when the value of sh_alf_cc_cb_fixed_filter_set_idx is 0, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of sh_alf_cc_cb_fixed_filter_set_idx is 1, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0133] Of course, the number of candidate filter sets is not limited to 2, and accordingly, the values of sh_alf_cc_cr_fixed_filter_set_idx are not limited to 0 and 1, which are not limited in the present application.

[0134] It should be noted that in the embodiments of the present application, the second syntax element identification information can be used to determine the number of times of the first filtering, i.e., to determine the number of times of execution of the first filtering filterTimes.

[0135] It can be understood that in the embodiments of the present application, the value of the second syntax element identification information can determine the number of times of execution of the corresponding first filtering.

[0136] It should be noted that in the embodiments of the present application, the value range of the second syntax element identification information can depend on the pre-determined upper limit of the number of times of filtering, i.e., the pre-determined upper limit of the number of times of filtering can determine the value range of the second syntax element identification information.

[0137] Further, in the embodiments of the present application, the second syntax element identification information can be a flag, wherein the second syntax element identification information can be an image-level flag or a slice-level flag. The present application is not limited in detail.

[0138] Exemplarily, in some embodiments, if the current color component of the current slice is a chroma C b component, the second syntax element identification information can be represented by the syntax element sh_alf_cc_cb_fixed_filter_time_idx, i.e., the value of sh_alf_cc_cb_fixed_filter_time_idx can be used to determine the number of times of execution of the first filtering filterTimes.

[0139] Exemplarily, in some embodiments, assuming that the maximum number of times of filtering is set to 2, when the value of sh_alf_cc_cb_fixed_filter_time_idx is 0, the number of times of execution of the first filtering filterTimes can be determined to be 1, i.e., the first filtering is executed once; when the value of sh_alf_cc_cb_fixed_filter_time_idx is 1, the number of times of execution of the first filtering filterTimes can be determined to be 2, i.e., the first filtering is executed twice.

[0140] Of course, the pre-determined upper limit of the number of times of filtering is not limited to 2, and accordingly, the values of sh_alf_cc_cb_fixed_filter_time_idx are not limited to 0 and 1, which are not limited in the present application.

[0141] Exemplarily, in some embodiments, if the current color component of the current slice is chroma C r The second syntax element identifying information can be represented by a syntax element sh_alf_cc_cr_fixed_filter_time_idx, i.e. the value of sh_alf_cc_cr_fixed_filter_time_idx can be used to determine the execution times filterTimes of the first filtering.

[0142] Exemplarily, in some embodiments, assuming that the maximum filtering times is set to 2, when the value of sh_alf_cc_cr_fixed_filter_time_idx is 0, it can be determined that the execution times filterTimes of the first filtering is 1, i.e. the first filtering is executed once; when the value of sh_alf_cc_cr_fixed_filter_time_idx is 1, it can be determined that the execution times filterTimes of the first filtering is 2, i.e. the first filtering is executed twice.

[0143] Of course, the upper limit of the predetermined filtering times is not limited to 2, and correspondingly, the value of sh_alf_cc_cr_fixed_filter_time_idx is not limited to 0 and 1, which is not specifically limited in the present application.

[0144] Exemplarily, in some embodiments, the slice header syntax element is as follows:

[0145] Wherein,

[0146] sh_alf_cc_cb_filter_mode_idx represents the filtering mode of CCALF used by the chroma U component, a binary variable. When the value is 0, it means that the chroma U component only uses the CCALF fixed filter for filtering; when the value is 1, it means that the chroma U component uses the new filter of the current frame image or the previous frame image of the current frame image for filtering.

[0147] sh_alf_cc_cr_filter_mode_idx represents the filtering mode of CCALF used by the chroma V component, a binary variable. When the value is 0, it means that the chroma V component only uses the CCALF fixed filter for filtering; when the value is 1, it means that the chroma V component uses the new filter of the current frame image or the current frame image for filtering.

[0148] The sh alf cc cb fixed filter set idx indicates an index of a CCALF fixed filter set used by the chroma U component. Since the number of available filter sets is set to 2, it is a binary variable. A value of 1 indicates that the chroma U component is filtered using the CCALF fixed filter set 1; a value of 0 indicates that the chroma U component is filtered using the CCALF fixed filter set 0.

[0149] The sh alf cc cr fixed filter set idx indicates an index of a CCALF fixed filter set used by the chroma V component. Since the number of available filter sets is set to 2, it is a binary variable. A value of 1 indicates that the chroma V component is filtered using the CCALF fixed filter set 1; a value of 0 indicates that the chroma V component is filtered using the CCALF fixed filter set 0.

[0150] The sh alf cc cb fixed filter time idx indicates the number of times of using the CCALF fixed filter by the chroma U component. Since the maximum number of times is set to 2, it is a binary variable. A value of 1 indicates that the chroma U component is filtered twice using the CCALF fixed filter; a value of 0 indicates that the chroma U component is filtered once using the CCALF fixed filter.

[0151] The sh alf cc cr fixed filter time idx indicates the number of times of using the CCALF fixed filter by the chroma V component. Since the maximum number of times is set to 2, it is a binary variable. A value of 1 indicates that the chroma V component is filtered twice using the CCALF fixed filter; a value of 0 indicates that the chroma V component is filtered once using the CCALF fixed filter.

[0152] Further, in the embodiments of the present application, when the first filter coefficient is determined according to the fixed filter index, the fixed filter set can be determined in the candidate filter set according to the fixed filter index first; then the pixel category of the pixel to be filtered is determined, and the filter category corresponding to the pixel category of the pixel to be filtered is determined; finally, the first filter coefficient corresponding to the pixel to be filtered can be determined in the fixed filter set according to the filter category.

[0153] It can be understood that, in the embodiments of the present application, after the corresponding fixed filter index is determined based on the first syntax element identification information obtained by analysis, the corresponding fixed filter set can be selected in the candidate filter set according to the fixed filter index, and then the filter coefficient corresponding to the pixel to be filtered is determined from the fixed filter set by using the filter category of the pixel to be filtered, that is, the first filter coefficient is obtained.

[0154] Further, in the embodiments of the present application, when determining the pixel category of the to-be-filtered pixel, the horizontal direction index, the vertical direction index and the direction activity index corresponding to the to-be-filtered pixel can be determined according to the gradient parameter of the to-be-filtered pixel first, and then the variance division index of the to-be-filtered pixel is determined; and then the pixel category of the to-be-filtered pixel is determined according to the horizontal direction index, the vertical direction index, the direction activity index and the variance division index.

[0155] It can be understood that, in the embodiments of the present application, the image sample blocks with the same size can be obtained based on the current image component (luminance component or chrominance component) of the current image, so that the pixels in the image sample blocks obtained by division can be determined as to-be-filtered samples.

[0156] Exemplarily, in some embodiments, the component can be divided into a plurality of N x N pixel blocks. For a CTU with a size of M x M, it will be divided into ceil(M / N) x ceil(M / N) pixel blocks.

[0157] It can be understood that, in the embodiments of the present application, the gradient parameter of the to-be-filtered pixel can include one or more gradient values of the to-be-filtered pixel in one or more directions, for example, the gradient parameter of the to-be-filtered pixel can include but is not limited to the gradient values of the to-be-filtered pixel in the horizontal direction, the vertical direction, 45° and 135°.

[0158] Exemplarily, in some embodiments, the calculation of the gradient value can be performed in any manner, including but not limited to calculating the gradient value by using Laplace operator and calculating the gradient value by using Sobel operator.

[0159] Further, in the embodiments of the present application, after the gradient parameter corresponding to the to-be-filtered pixel is calculated, the gradient parameter including one or more gradient values can be used to determine the horizontal direction index H i , the vertical direction index V i and the direction activity index A i .

[0160] Further, in the embodiments of the present application, the variance value corresponding to the to-be-filtered pixel can also be determined, and then the variance division index D i corresponding to the to-be-filtered pixel can be further determined according to the variance value corresponding to the to-be-filtered pixel.

[0161] Further, in the embodiments of the present application, when determining the variance division index of the to-be-filtered sample, the variance value corresponding to the to-be-filtered sample can be determined, and then the variance division index D i corresponding to the to-be-filtered sample can be further determined according to the variance value corresponding to the to-be-filtered sample.

[0162] Further, in the embodiments of the present application, when determining the pixel class of the to-be-filtered sample according to the horizontal direction index, the vertical direction index, the direction activity index and the variance division index, the pixel class classIdx of each to-be-filtered sample in the image sample block can be calculated based on the horizontal direction index H i , the vertical direction index V i , the direction activity index A i and the variance division index D i by using a class calculation formula.

[0163] Exemplarily, in some embodiments, the class calculation formula is as follows: classIdx=D i ×H×V×A+A i ×H×V+H i ×V+V i (7)

[0164] wherein H is the number of horizontal direction divisions, V is the number of vertical direction divisions, and A is the number of direction activity divisions.

[0165] Correspondingly, in some embodiments, the number of pixel classes corresponding to the current image component totalClassNum can be determined by using the following formula: totalClassNum=H×V×A×D (8)

[0166] wherein D is the number of variance divisions.

[0167] Further, in the embodiments of the present application, when determining the pixel class of the to-be-filtered sample, the pixel class of the to-be-filtered sample can also be determined according to the position information of the to-be-filtered sample.

[0168] That is, in the embodiments of the present application, the division of the pixel classes in the fixed filter can also adopt other forms other than gradient calculation, for example, the position of the pixel or the position of the CTU can be used for determination.

[0169] Exemplarily, in some embodiments, the current image component can be divided into a plurality of N×N pixel blocks. For a CTU with a size of M×M, it will be divided into ceil(M / N)×ceil(M / N) pixel blocks. Then, the class classIdx of each pixel block can be obtained according to the position (x, y) of each pixel block, wherein classIdx=F((x, y)), and F(*) is a mapping function of the pixel block position.

[0170] Further, in embodiments of the present application, after determining the pixel class corresponding to the pixel to be filtered, the filter class corresponding to the pixel class of the pixel to be filtered can be further determined. The filter class can be understood as a fixed filter class.

[0171] For example, the pixel class is denoted as classIdx, and the filter class that can be used is filterIdx = Map(cIdx), wherein Map(*) is a mapping table.

[0172] Further, in embodiments of the present application, the construction of the candidate filter set can be performed first. The candidate filter set can be understood as one or more fixed filter sets allowed to be used, and the number of candidate filter sets is not limited in the present application.

[0173] For example, in some embodiments, when constructing the candidate filter set, the quantization parameter can be determined first; and then the candidate filter set is determined according to the quantization parameter.

[0174] It can be understood that in embodiments of the present application, the quantization parameter can be the quantization parameter of the current image, the quantization parameter of the current block, or the quantization parameter of the current slice, which is not limited in the present application.

[0175] For example, in some embodiments, the fixed filter set (candidate filter set) allowed to be used can be determined according to the quantization parameter of the current frame image. Assuming that the quantization parameter of the current frame image is qp, the filter set class that can be used is filterSetIdxVec = MapSet(qp), wherein MapSet(*) is a mapping table. It should be noted that filterSetIdxVec is a vector, indicating the fixed filter set available for the frame image, i.e., the candidate filter set can be represented as filterSetIdxVec.

[0176] For example, in some embodiments, when constructing the candidate filter set, the quantization parameter and the slice type of the current slice can be determined first; wherein the slice type includes I slice, B slice, and P slice; and then the candidate filter set is determined according to the quantization parameter and the slice type.

[0177] It can be understood that in embodiments of the present application, the calculation of the fixed filter set index is not only related to the quantization parameter, but also related to the type of the current frame image. For example, the frame type, i.e., the slice type, can be introduced in the process of constructing the candidate filter set.

[0178] Exemplarily, in some embodiments, the fixed filter set used can be determined according to the quantization parameter and the slice type of the current frame image. Assuming that the quantization parameter of the current frame image is qp, the slice type is type, and the filter set class that can be used is filterSetIdxVec = MapSet(qp, type), wherein MapSet(*) is a mapping table. It should be noted that filterSetIdxVec is a vector, which represents the fixed filter set available for the frame image, i.e., the candidate filter set can be represented as filterSetIdxVec.

[0179] Further, in the embodiments of the present application, when the first filter coefficient corresponding to the pixel to be filtered is determined in the fixed filter set according to the filter class, the filter coefficient corresponding to the filter class can be selected in the fixed filter set, and then the first filter coefficient is determined.

[0180] Exemplarily, in some embodiments, according to the fixed filter class filterIdx used by the pixel to be filtered, the corresponding fixed filter coefficient can be selected in the fixed filter set filterSetIdx (fixed filter set index) of the available fixed filter set vector filterSetIdxVec (candidate filter set), i.e., the filter coefficient corresponding to the pixel to be filtered is obtained, each first filter pixel is traversed, and finally the first filter coefficient can be obtained.

[0181] Further, in the embodiments of the present application, after the first filter coefficient is determined based on the first syntax element identification information, and the execution number of the first filter is determined based on the second syntax element identification information, the first filter can be performed according to the first filter coefficient and the execution number of the first filter, so as to obtain the first chroma sample correction value.

[0182] Further, in the embodiments of the present application, for the case of only performing the first filter, when the first filter coefficient and the execution number of the first filter are determined, the code stream can also be decoded to determine the third syntax element identification information and the fourth syntax element identification information; then the fixed filter index corresponding to the current block is determined according to the third syntax element identification information, and the first filter coefficient corresponding to the current block is determined according to the fixed filter index corresponding to the current block; at the same time, the execution number of the first filter corresponding to the current block can be determined according to the fourth syntax element identification information.

[0183] It should be noted that in the embodiments of the present application, for the case of only performing the first filtering, syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc indicating the index of the CCALF new filter can be selected at the CTU level, i.e., alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are reused in the coding tree unit process when only the fixed filter is used.

[0184] In the case of using the CCALF new filter, syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter class used by each CTU.

[0185] In the case of using the CCALF new filter, syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter class used by each CTU.

[0186] Exemplarily, in some embodiments, when only the fixed filter is used, if the current color component of the current block is the chroma C b component, the third syntax element identification information can be represented by syntax element alf_ctb_cc_cr_idc, i.e., the value of alf_ctb_cc_cr_idc can be used to determine the fixed filter index filterSetIdx.

[0187] Exemplarily, in some embodiments, when only the fixed filter is used, if the current color component of the current block is the chroma C r component, the third syntax element identification information can be represented by syntax element alf_ctb_cc_cr_idc, i.e., the value of alf_ctb_cc_cr_idc can be used to determine the fixed filter index filterSetIdx.

[0188] That is, in the embodiments of the present application, the third syntax element identification information can be a flag, wherein the third syntax element identification information can be a block-level flag.

[0189] Further, in the embodiments of the present application, the fourth syntax element identification information can be a flag, wherein the fourth syntax element identification information can be a block-level flag.

[0190] Exemplarily, in some embodiments, if the current color component of the current block is the chroma C bIf the current color component of the current block is the chroma C

[0191] For example, in some embodiments, assuming that the maximum filter number is set to 2, when the value of alf_ctb_cc_cb_time is 0, the execution number of the first filter filterTimes can be determined to be 1, i.e., the first filter is executed once; when the value of alf_ctb_cc_cb_time is 1, the execution number of the first filter filterTimes can be determined to be 2, i.e., the first filter is executed twice.

[0192] Of course, the predetermined upper limit of the filter number is not limited to 2, and correspondingly, the value of alf_ctb_cc_cb_time is not limited to 0 and 1, which is not specifically limited in the present application.

[0193] For example, in some embodiments, if the current color component of the current block is the chroma C r If the current color component of the current block is the chroma C

[0194] For example, in some embodiments, assuming that the maximum filter number is set to 2, when the value of alf_ctb_cc_cr_time is 0, the execution number of the first filter filterTimes can be determined to be 1, i.e., the first filter is executed once; when the value of alf_ctb_cc_cr_time is 1, the execution number of the first filter filterTimes can be determined to be 2, i.e., the first filter is executed twice.

[0195] Of course, the predetermined upper limit of the filter number is not limited to 2, and correspondingly, the value of alf_ctb_cc_cr_time is not limited to 0 and 1, which is not specifically limited in the present application.

[0196] For example, in some embodiments, the slice header syntax element is as follows:

[0197] The coding tree unit syntax element is as follows:

[0198] When only the fixed filter is used, the syntax element encodes the fixed filter set index used by each CTU when only the fixed filter is used. When the new filter is used, the syntax element encodes the new filter category used by each CTU. alf_ctb_cc_cb_time is the number of times the CCALF fixed filter is applied to the CTU chroma U component. Since the maximum number of times is set to 2, it is a binary variable. A value of 1 indicates that the CCALF fixed filter is applied twice to the CTU chroma U component; a value of 0 indicates that the CCALF fixed filter is applied once to the CTU chroma U component. alf_ctb_cc_cr_time is the number of times the CCALF fixed filter is applied to the CTU chroma V component. Since the maximum number of times is set to 2, it is a binary variable. A value of 1 indicates that the CCALF fixed filter is applied twice to the CTU chroma V component; a value of 0 indicates that the CCALF fixed filter is applied once to the CTU chroma V component.

[0199] Further, in the embodiments of the present application, for the case of only performing the first filtering, when determining the first filtering coefficient and the number of times of performing the first filtering, the code stream can also be decoded to determine the fifth syntax element identification information and the fourth syntax element identification information; then, in the case of determining that the current block performs the first filtering based on the fifth syntax element identification information, the fixed filter index corresponding to the current block can be determined according to the fifth syntax element identification information, and the first filtering coefficient corresponding to the current block can be determined according to the fixed filter index corresponding to the current block; meanwhile, the number of times of performing the first filtering corresponding to the current block can be determined according to the fourth syntax element identification information.

[0200] It should be noted that, in the embodiments of the present application, for the case of only performing the first filtering, the fifth syntax element identification information can be used to determine the case of performing the first filtering by the current block, including whether to perform the first filtering and the fixed filter set index filterSetIdx corresponding to the first filtering coefficient, that is, the fifth syntax element identification information can be used to determine the case of using the fixed filter by the current block.

[0201] It can be understood that, in the embodiments of the present application, the value of the fifth syntax element identification information can be used to determine whether the first filtering is performed by the current block, that is, whether the fixed filter is used by the current block.

[0202] It can be understood that, in the embodiments of the present application, the value of the fifth syntax element identification information can determine whether the current block uses the fixed filter, and in the case of using, determine the fixed filter index corresponding to the current block, so that the corresponding fixed filter set can be determined from the candidate filter set according to the fixed filter index, and then the first filter coefficient can be determined based on the fixed filter set.

[0203] It should be noted that, in the embodiments of the present application, the value range of the fifth syntax element identification information can depend on the number of candidate filter sets, that is, the number of candidate filter sets can determine the value range of the fifth syntax element identification information.

[0204] Further, in the embodiments of the present application, the fifth syntax element identification information can be a flag, wherein the fifth syntax element identification information can be a block-level flag.

[0205] Exemplarily, in some embodiments, for the case of only performing the first filtering, if the current color component of the current block is the chroma C b component, then the fifth syntax element identification information can be represented by the syntax element alf_ctb_cc_cb_fixed_filter_idc, that is, the value of alf_ctb_cc_cb_fixed_filter_idc can be used to determine whether the current block uses the fixed filter, and determine the fixed filter index filterSetIdx.

[0206] Exemplarily, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include the fixed filter set 0 and the fixed filter set 1, then when the value of alf_ctb_cc_cb_fixed_filter_idc is 0, it can be determined that the current block does not perform the first filtering, that is, the current block does not use the fixed filter; when the value of alf_ctb_cc_cb_fixed_filter_idc is not 0, it can be determined that the current block uses the filter set with the fixed filter set index alf_ctb_cc_cb_fixed_filter_idc-1 for filtering. For example, when the value of alf_ctb_cc_cb_fixed_filter_idc is 1, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of alf_ctb_cc_cb_fixed_filter_idc is 2, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0207] Of course, the number of candidate filter sets is not limited to 2, and correspondingly, the value of alf_ctb_cc_cb_fixed_filter_idc is not limited to 0, 1 and 2, which is not limited in the present application.

[0208] Exemplarily, in some embodiments, if the current color component of the current block is the chroma C r component, the fifth syntax element identifying information can be represented by the syntax element alf_ctb_cc_cr_fixed_filter_idc, that is, the value of alf_ctb_cc_cr_fixed_filter_idc can be used to determine whether the current block uses a fixed filter, and to determine the fixed filter index filterSetIdx.

[0209] Exemplarily, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include fixed filter set 0 and fixed filter set 1, when the value of alf_ctb_cc_cr_fixed_filter_idc is 0, it can be determined that the current block does not perform the first filtering, that is, the current block does not use the fixed filter; when the value of alf_ctb_cc_cr_fixed_filter_idc is not 0, it can be determined that the current block uses the filter set with the fixed filter set index alf_ctb_cc_cr_fixed_filter_idc-1 for filtering. For example, when the value of alf_ctb_cc_cr_fixed_filter_idc is 1, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of alf_ctb_cc_cr_fixed_filter_idc is 2, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0210] Of course, the number of candidate filter sets is not limited to 2, and correspondingly, the value of alf_ctb_cc_cr_fixed_filter_idc is not limited to 0, 1 and 2, which is not limited in the present application.

[0211] Exemplarily, in some embodiments, the slice header syntax element is as follows:

[0212] The coding tree unit syntax element is as follows:

[0213] In the case of using only the fixed filter, fifth syntax element identification information alf_ctb_cc_cb_fixed_filter_idc and alf_ctb_cc_cr_fixed_filter_idc is used in the coding tree unit process. In the case of using only the fixed filter, the alf_ctb_cc_cb_fixed_filter_idc syntax element encodes the case of using the fixed filter for each CTU chroma U component. When alf_ctb_cc_cb_fixed_filter_idc is equal to 0, it indicates that the CTU chroma U component is not filtered using the fixed filter. Otherwise, the filter set with the filter set index of alf_ctb_cc_cb_fixed_filter_idc-1 is used for filtering. The alf_ctb_cc_cr_fixed_filter_idc syntax element encodes the case of using the fixed filter for each CTU chroma V component. When alf_ctb_cc_cr_fixed_filter_idc is equal to 0, it indicates that the CTU chroma V component is not filtered using the fixed filter. Otherwise, the filter set with the filter set index of alf_ctb_cc_cr_fixed_filter_idc-1 is used for filtering.

[0214] Further, in the embodiments of the present application, the bitstream can also be decoded to determine sixth syntax element identification information. In the case of determining, based on the sixth syntax element identification information, that the first filtering is performed on the current block, the first filtering is performed on the current block according to the first filtering coefficient and the number of times of performing the first filtering, and the first chroma sample correction value corresponding to the current block is determined.

[0215] It should be noted that, in the embodiments of the present application, for the case of performing only the first filtering, the sixth syntax element identification information can also be used to determine whether the first filtering is performed on the current block, i.e., the sixth syntax element identification information can be used to determine whether the fixed filter is used for the current block.

[0216] Further, in the embodiments of the present application, the sixth syntax element identification information can be a flag. The sixth syntax element identification information can be a block-level flag.

[0217] Exemplarily, in some embodiments, for the case of performing only the first filtering, if the current color component of the current block is the chroma C bIn the component, the sixth syntax element identification information can be represented by syntax element alf_ctb_cc_cb_fixed_filter_flag, i.e. the value of alf_ctb_cc_cb_fixed_filter_flag can be used to determine whether the first filtering is performed on the current block using the fixed filter.

[0218] For example, in some embodiments, when the value of alf_ctb_cc_cb_fixed_filter_flag is 0, it can be determined that the first filtering is not performed on the current block, i.e. the fixed filter is not used on the current block; when the value of alf_ctb_cc_cb_fixed_filter_flag is 1, it can be determined that the first filtering is performed on the current block, i.e. the fixed filter is used on the current block.

[0219] For example, in some embodiments, the slice header syntax element is as follows:

[0220] The coding tree unit syntax element is as follows:

[0221] In the coding tree unit process, the sixth syntax element identification information alf_ctb_cc_cb_fixed_filter_flag and alf_ctb_cc_cr_fixed_filter_flag are used only when the fixed filter is used. When the value of alf_ctb_cc_cb_fixed_filter_flag is 0, it indicates that the fixed filter is not used for filtering the CTU chrominance U component, otherwise the fixed filter is used for filtering. When the value of alf_ctb_cc_cr_fixed_filter_flag is 0, it indicates that the fixed filter is not used for filtering the CTU chrominance V component, otherwise the fixed filter is used for filtering.

[0222] Further, in embodiments of the present application, when performing filtering according to the first filtering identification information and the second filtering identification information, determining the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filtering identification information indicates that the first filtering is not performed, and the second filtering identification information indicates that the second filtering is performed, the second filtering coefficient is determined based on the corresponding APS; and then the second filtering is performed according to the second filtering coefficient, and the second chroma sample correction value is determined.

[0223] It should be noted that in embodiments of the present application, if it is determined based on the first filtering identification information and the second filtering identification information that only the second filtering is performed, for example, it is determined that only the CCALF new filter is used for filtering processing, then the determination of the second filtering coefficient can be performed first.

[0224] Further, in embodiments of the present application, the second filtering coefficient can be obtained by analyzing the corresponding APS. Accordingly, in the present application, the code stream can be decoded first, and the seventh syntax element identification information is determined; then the APS index corresponding to the current image can be determined according to the seventh syntax element identification information; and finally the corresponding APS can be determined according to the APS index.

[0225] That is to say, in embodiments of the present application, the second filtering coefficient used for performing the second filtering can be written in the corresponding APS. Accordingly, the APS ID (APS index) can be analyzed first to determine the corresponding APS, and then the second filtering coefficient can be determined by analyzing the APS. The APS ID can be written in the slice header or the picture header information.

[0226] It can be understood that in embodiments of the present application, the seventh syntax element identification information can be used to determine the APS index.

[0227] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C b component, the seventh syntax element identification information can be represented by the syntax element sh_alf_cc_cb_aps_id, that is, the value of sh_alf_cc_cb_aps_id can be used to determine the APS index.

[0228] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C r component, the seventh syntax element identification information can be represented by the syntax element sh_alf_cc_cr_aps_id, that is, the value of sh_alf_cc_cr_aps_id can be used to determine the APS index.

[0229] Further, in embodiments of the present application, when the second filter coefficient is determined based on the APS, the code stream can be decoded to determine eighth syntax element identification information; in a case where the eighth syntax element identification information indicates that the second filter coefficient exists in the APS, the APS is parsed to determine the second filter coefficient.

[0230] It can be understood that, in embodiments of the present application, the eighth syntax element identification information can be used to indicate whether the second filter coefficient exists in the corresponding APS.

[0231] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C b component, the eighth syntax element identification information can be represented by a syntax element alf_cc_cb_filter_signal_flag, i.e., the value of the alf_cc_cb_filter_signal_flag can be used to determine whether the second filter coefficient can be obtained from the corresponding APS. For example, if the value of the alf_cc_cb_filter_signal_flag is 0, it can be considered that the second filter coefficient does not exist in the corresponding APS; if the value of the alf_cc_cb_filter_signal_flag is 1, it can be considered that the second filter coefficient exists in the corresponding APS.

[0232] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C r component, the eighth syntax element identification information can be represented by a syntax element alf_cc_cr_filter_signal_flag, i.e., the value of the alf_cc_cr_filter_signal_flag can be used to determine whether the second filter coefficient can be obtained from the corresponding APS. For example, if the value of the alf_cc_cr_filter_signal_flag is 0, it can be considered that the second filter coefficient does not exist in the corresponding APS; if the value of the alf_cc_cr_filter_signal_flag is 1, it can be considered that the second filter coefficient exists in the corresponding APS.

[0233] Further, in embodiments of the present application, the third syntax element identification information can also be determined by decoding the code stream; then the filter index of the current block can be determined according to the third syntax element identification information, and the second filter coefficient corresponding to the current block can be determined according to the filter index of the current block.

[0234] It can be understood that in the embodiments of the present application, for the case of only performing the first filtering, syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc indicating the index of the CCALF new filter can be selected at the CTU level, that is, alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are reused in the coding tree unit process when only the fixed filter is used. In other cases, for example, the case of only performing the second filtering, or the case of performing the first filtering and the second filtering, the third syntax element identification information syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter class used by each CTU.

[0235] That is, in the embodiments of the present application, if the second filtering is performed, that is, if the CCALF new filter is used, the third syntax element identification information alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc is used to indicate the new filter class used by each CTU.

[0236] Further, in the embodiments of the present application, when filtering according to the first filtering identification information and the second filtering identification information, determining the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filtering identification information indicates that the first filtering is performed, and the second filtering identification information indicates that the second filtering is performed, the first filtering coefficient and the execution number of the first filtering are determined, and the second filtering coefficient is determined based on the corresponding APS; then the first filtering is performed according to the first filtering coefficient and the execution number of the first filtering, and the first chroma sample correction value is determined.

[0237] It should be noted that in the embodiments of the present application, if it is determined to perform the first filtering and the second filtering based on the first filtering identification information and the second filtering identification information, for example, it is determined to use the fixed filter and the CCALF new filter for filtering processing, then the determination of the first filtering coefficient and the execution number of the first filtering, and the determination of the second filtering coefficient can be performed respectively.

[0238] It can be understood that in the embodiments of the present application, for the case of using the fixed filter and the CCALF new filter at the same time, when determining the first filtering coefficient and the execution number of the first filtering, the fixed filter index can be determined by the first syntax element identification information obtained by decoding, and the first filtering coefficient can be determined according to the fixed filter index; at the same time, the execution number of the first filtering can be determined according to the second syntax element identification information.

[0239] It can be understood that, in the embodiments of the present application, for the case of simultaneously using the fixed filter and the CCALF new filter, the second filter coefficient can be obtained by parsing the corresponding APS when determining the second filter coefficient.

[0240] It can be understood that, in the embodiments of the present application, for the case of simultaneously using the fixed filter and the CCALF new filter, the second filter coefficient can be obtained by parsing the corresponding APS when determining the second filter coefficient.

[0241] Further, in the embodiments of the present application, after the first filter coefficient and the execution number of the first filter are determined, the first filter can be performed according to the first filter coefficient and the execution number of the first filter to determine the first chroma sample correction value.

[0242] It should be noted that, in the embodiments of the present application, the first chroma sample correction value obtained by performing the first filter can include but is not limited to a compensation value of a chroma sample (a compensation value offsetC of a chroma pixel) and a filtered sample of a chroma sample (a filtered pixel recC of a chroma pixel) fixed ).

[0243] Exemplarily, in some embodiments, as shown in FIG. 7, assuming that the first filter coefficient is c f , that is, the fixed filter coefficient c f , then the process of performing the first filter on the to-be-filtered pixel can be as follows:

[0244] Where recY(*) represents the reconstruction value of the luminance pixel of the SAO output, recC(*) is the reconstruction value of the chroma pixel of the SAO output. x corresponds to the position of x in the filter shape, and i is the pixel at the non-x position. is the coefficient of the fixed filter at the i position. scale is a scale factor, which is a positive integer. offsetC is the compensation value of the to-be-filtered chroma pixel, that is, the first chroma sample correction value.

[0245] Exemplarily, in some embodiments, as shown in FIG. 6, assuming that the first filter coefficient is c f , that is, the fixed filter coefficient c f , then the process of performing the first filter on the to-be-filtered pixel can be as follows:

[0246] Exemplarily, in some embodiments, as shown in FIG. 7, assuming that the first filter coefficient is c f , that is, the fixed filter coefficient c fThen, the process of performing the first filtering on the pixel to be filtered can be as follows:

[0247] recC(*) represents the first chroma sample correction value output by the CCALF. fixed

[0248] Further, in the embodiments of the present application, after the second filter coefficient is determined, the second filtering can be performed according to the second filter coefficient, and the second chroma sample correction value is determined.

[0249] Further, in the embodiments of the present application, for the case of simultaneously using the fixed filter and the CCALF new filter, the first chroma sample correction value output after obtaining the CCALF fixed filter output can be selected as the input of the CCALF new filter, so that the filtering process is more accurate.

[0250] That is, in the embodiments of the present application, the first chroma sample correction value output by the first filtering can be used as the input information of the second filtering.

[0251] Exemplarily, in some embodiments, FIG. 8 is a schematic diagram of the CCALF new filter according to the embodiments of the present application, as shown in FIG. 8, three different types of filters can be combined to form the CCALF new filter.

[0252] Exemplarily, in some embodiments, as shown in FIG. 8, for the pixel to be filtered, the filtering formula of the second filtering is as follows:

[0253] recC(*) represents the first chroma sample correction value output by the CCALF.

[0254] Exemplarily, in some embodiments, as shown in FIG. 6, for the pixel to be filtered, the filtering formula of the second filtering is as follows:

[0255] recC(*) represents the first chroma sample correction value output by the CCALF. fixed recC(*) represents the first chroma sample correction value output by the CCALF. sao recC(*) represents the first chroma sample correction value output by the CCALF.

[0256] Step 1003, determining the filtered reconstruction value according to the first chroma sample correction value and / or the second chroma sample correction value.

[0257] ​In embodiments of the present application, after the first chroma sample correction value and / or the second chroma sample correction value are determined according to the first filter identification information and the second filter identification information, the filtered reconstruction value can be determined according to the first chroma sample correction value and / or the second chroma sample correction value.

[0258] It should be noted that in embodiments of the present application, since the three filtering modes can be determined based on the first filter identification information and the second filter identification information, the corresponding obtained filtering results can be the first chroma sample correction value, the second chroma sample correction value, the first chroma sample correction value and the second chroma sample correction value. Therefore, the final loop filter result, i.e. the filtered reconstruction value, can be determined according to the first chroma sample correction value and / or the second chroma sample correction value.

[0259] Further, in embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filter identification information indicates that the first filtering is performed and the second filter identification information indicates that the second filtering is not performed, the final filtered reconstruction value can be determined according to the first chroma sample correction value obtained after the first filtering is performed, combined with the third chroma sample correction value.

[0260] It should be noted that in embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and the corresponding pre-filter sample value, the first chroma sample correction value and the corresponding pre-filter sample value can be summed, and then the filtered reconstruction value can be determined based on the sum result, or the first chroma sample correction value and the corresponding pre-filter sample value can be scaled, for example, the offset is scaled, and then the filtered reconstruction value can be determined based on the scaling result. The present application does not make specific limitations.

[0261] Further, in embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filter identification information indicates that the first filtering is not performed and the second filter identification information indicates that the second filtering is performed, the final filtered reconstruction value can be determined according to the second chroma sample correction value obtained after the second filtering is performed, combined with the third chroma sample correction value.

[0262] It should be noted that in the embodiments of the present application, when the filtered reconstruction value is determined according to the second chroma sample correction value and the corresponding pre-filtering sample value, the second chroma sample correction value and the corresponding pre-filtering sample value can be summed, and then the filtered reconstruction value can be determined based on the sum result, or the second chroma sample correction value and the corresponding pre-filtering sample value can be scaled, for example, offset is scaled, and then the filtered reconstruction value can be determined based on the scaling result. The present application does not make specific limitations.

[0263] Further, in the embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value, in the case where the first filter identification information indicates that the first filter is performed, and the second filter identification information indicates that the second filter is performed, the first chroma sample correction value output by the first filter after the first filter is performed can be used for subsequent second filter, and after the second chroma sample correction value is obtained by completing the second filter, the final filtered reconstruction value can be further determined by combining the first chroma sample correction value, the second chroma sample correction value and the third chroma sample correction value.

[0264] It should be noted that in the embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value, the second chroma sample correction value and the corresponding pre-filtering sample value, the first chroma sample correction value, the second chroma sample correction value and the corresponding pre-filtering sample value can be summed, and then the filtered reconstruction value can be determined based on the sum result, or the first chroma sample correction value, the second chroma sample correction value and the corresponding pre-filtering sample value can be scaled, for example, offset is scaled, and then the filtered reconstruction value can be determined based on the scaling result. The present application does not make specific limitations.

[0265] It can be understood that in the embodiments of the present application, the final filtered reconstruction value obtained can be understood as the final filtering result after completing the loop filtering.

[0266] Correspondingly, in the embodiments of the present application, the first chroma sample correction value obtained by performing the first filter can be used to correct the final filtered reconstruction value obtained, and the second chroma sample correction value obtained by performing the second filter can also be used to correct the final filtered reconstruction value obtained.

[0267] It should be noted that in the embodiments of the present application, the corresponding pre-filtering sample value can be the initial value before performing the filtering process, including but not limited to the reconstruction value before performing the first filter or the second filter.

[0268] Further, in the embodiments of the present application, the output of the fixed filter can only be used as the input of the CCALF new filter, and not used as the filtering result to the reconstructed image. That is, the first chroma sample correction value of the first filtering output can not be directly introduced when determining the filtered reconstructed value.

[0269] Exemplarily, in some embodiments, when determining the first filtering identification information and the second filtering identification information, the code stream can be decoded to determine the ninth syntax element identification information, and then the first filtering identification information and the second filtering identification information can be determined according to the ninth syntax element identification information.

[0270] Further, in the embodiments of the present application, when determining the first filtering identification information and the second filtering identification information according to the ninth syntax element identification information, in the case that the value of the ninth syntax element identification information is a first value, it is determined that the first filtering identification information indicates to perform the first filtering, and the second filtering identification information indicates to perform the second filtering; in the case that the value of the ninth syntax element identification information is a second value, it is determined that the first filtering identification information indicates to perform the first filtering, and the second filtering identification information indicates not to perform the second filtering.

[0271] Further, in the embodiments of the present application, the ninth syntax element identification information can be a flag, wherein the ninth syntax element identification information can be an image-level flag, or a slice-level flag. The present application does not make specific limitation.

[0272] It should be noted that, in the embodiments of the present application, the ninth syntax element identification information can be used to determine whether to perform the first filtering and the second filtering simultaneously, that is, the value of the ninth syntax element identification information can indicate whether to perform only the first filtering.

[0273] Exemplarily, in some embodiments, if the current color component of the current slice is a chroma C b component, the ninth syntax element identification information can be represented by a syntax element sh_alf_cc_cb_filter_mode_idx, that is, the value of sh_alf_cc_cb_filter_mode_idx can be used to determine the filter mode flag ccalfFilterMode. For example, when the value of sh_alf_cc_cb_filter_mode_idx is 0, it indicates to use only the fixed filter, and when the value of sh_alf_cc_cb_filter_mode_idx is 1, it indicates to use the CCALF new filter.

[0274] Of course, the value of sh_alf_cc_cb_filter_mode_idx is not limited to 0 and 1, and the application does not make specific limitations.

[0275] Further, in the embodiments of the application, when the first filter identification information and the second filter identification information are determined according to the ninth syntax element identification information, in the case where the value of the ninth syntax element identification information is a first value, it is determined that the first filter identification information indicates that the first filter is not performed, and the second filter identification information indicates that the second filter is performed; in the case where the value of the ninth syntax element identification information is a second value, it is determined that the first filter identification information indicates that the first filter is performed, and the second filter identification information indicates that the second filter is not performed.

[0276] It should be noted that in the embodiments of the application, the ninth syntax element identification information can also be used to determine whether the first filter is performed or the second filter is performed.

[0277] Exemplarily, in some embodiments, if the current color component of the current slice is a chroma C r component, the ninth syntax element identification information can be represented by a syntax element sh_alf_cc_cr_filter_mode_idx, that is, the value of sh_alf_cc_cr_filter_mode_idx can be used to determine the filter mode flag ccalfFilterMode. For example, when the value of sh_alf_cc_cr_filter_mode_idx is 0, it indicates that only a fixed filter is used, and when the value of sh_alf_cc_cr_filter_mode_idx is 1, it indicates that only a new CCALF filter is used.

[0278] Of course, the value of sh_alf_cc_cr_filter_mode_idx is not limited to 0 and 1, and the application does not make specific limitations.

[0279] That is, in the embodiments of the application, the first filter identification information for indicating whether the first filter is performed and the second filter identification information for indicating whether the second filter is performed can be determined based on one syntax element identification information.

[0280] Exemplarily, in some embodiments, when the first filter identification information and the second filter identification information are determined, the code stream can be decoded to determine a tenth syntax element identification information and an eleventh syntax element identification information; then the first filter identification information is determined according to the tenth syntax element identification information, and the second filter identification information is determined according to the eleventh syntax element identification information.

[0281] Further, in the embodiments of the present application, when the first filter identification information is determined according to the tenth syntax element identification information, and the second filter identification information is determined according to the eleventh syntax element identification information, in the case that the value of the tenth syntax element identification information is the first value, and the value of the eleventh syntax element identification information is the first value, it is determined that the first filter identification information indicates performing the first filter, and the second filter identification information indicates not performing the second filter; in the case that the value of the tenth syntax element identification information is the second value, and the value of the eleventh syntax element identification information is the first value, it is determined that the first filter identification information indicates not performing the first filter, and the second filter identification information indicates not performing the second filter; in the case that the value of the tenth syntax element identification information is the first value, and the value of the eleventh syntax element identification information is the second value, it is determined that the first filter identification information indicates performing the first filter, and the second filter identification information indicates performing the second filter; in the case that the value of the tenth syntax element identification information is the second value, and the value of the eleventh syntax element identification information is the second value, it is determined that the first filter identification information indicates not performing the first filter, and the second filter identification information indicates performing the second filter.

[0282] That is to say, in the embodiments of the present application, the first filter identification information used for indicating whether to perform the first filter, and the second filter identification information used for indicating whether to perform the second filter can be determined based on two syntax element identification information. For example, whether to perform the first filter, i.e. whether to use the fixed filter, is determined by the tenth syntax element identification information; meanwhile, whether to perform the second filter, i.e. whether to use the new filter, is determined by the eleventh syntax element identification information.

[0283] In addition, the first value and the second value are different, and the first value and the second value can be in the form of a parameter or in the form of a number. For example, the first value can be set as 0, and the second value can be set as 1; or the first value can also be set as false, and the second value can also be set as true. The first value and the second value in the embodiments of the present application are not limited in any way.

[0284] Further, in the embodiments of the present application, a code stream is decoded to determine a slice level syntax element; wherein the slice level syntax element comprises one or more of a first syntax element identification information, a second syntax element identification information, a seventh syntax element identification information, an eighth syntax element identification information, a ninth syntax element identification information, a tenth syntax element identification information and an eleventh syntax element identification information.

[0285] Further, in the embodiments of the present application, the code stream is decoded to determine image-level syntax elements; wherein the image-level syntax elements include one or more of first syntax element identification information, second syntax element identification information, seventh syntax element identification information, eighth syntax element identification information, ninth syntax element identification information, tenth syntax element identification information, and eleventh syntax element identification information.

[0286] That is, in the embodiments of the present application, any one of the first syntax element identification information, the second syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information, the ninth syntax element identification information, the tenth syntax element identification information, and the eleventh syntax element identification information described above can be an image-level syntax element, or can be a slice-level syntax element. The present application does not make specific limitations.

[0287] Further, in the embodiments of the present application, the code stream is decoded to determine block-level syntax elements; wherein the block-level syntax elements include one or more of third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, and sixth syntax element identification information.

[0288] That is, in the embodiments of the present application, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, and the sixth syntax element identification information described above are all slice-level syntax elements.

[0289] In summary, the coding method proposed in the embodiments of the present application is a CCALF filter optimization technology. The fixed filter technology is introduced into CCALF, breaking the constraint that different sequences of similar texture pixels need to be encoded with multiple filters, allowing pixels with similar textures to use the same filter for filtering, saving the bits spent on transmission, and thus enabling CCALF to achieve better performance.

[0290] That is, the coding method proposed in the embodiments of the present application includes a filter optimization method. In the CCALF filtering process, a CCALF fixed filter is introduced to filter the to-be-filtered pixels. The fixed filter can input various information to improve the filtering accuracy. In addition, the output of the fixed filter can be directly output to the reconstructed image, or can be input to a new filter, thereby improving the performance of the new filter. Better code rate and performance can be obtained.

[0291] Further, in the embodiments of the present application, the input information of the fixed filter can be one or more of the following information: prediction information of luma, residual information of luma or luma reconstruction information before de-blocking filtering, luma reconstruction information after de-blocking filtering, luma reconstruction information output by SAO, luma reconstruction information output by ALF, prediction information of chroma, residual information of chroma or chroma reconstruction information before de-blocking filtering, chroma reconstruction information after de-blocking filtering, chroma reconstruction information output by SAO, chroma reconstruction information output by ALF, luma information output by ALF fixed filter, chroma information output by ALF fixed filter, luma information or chroma information after transform processing.

[0292] Further, in the embodiments of the present application, the shape of the fixed filter is not limited, which can be diamond, cross or other shapes.

[0293] Further, in the embodiments of the present application, the number of fixed filter sets is not limited, which can be 8 sets or 16 sets.

[0294] Further, in the embodiments of the present application, the number of filters in a fixed filter set is not limited, which can be one or any number.

[0295] Further, in the embodiments of the present application, the number of chroma pixel categories is not limited, which can be one category or any number of categories.

[0296] Further, in the embodiments of the present application, the number of fixed filter sets and the number of filter filtering times used by each slice are not limited, which can be one or any number.

[0297] Further, in the embodiments of the present application, the U component and the V component can share the same filter mode, the number of fixed filter times and the number of fixed filter categories.

[0298] Further, in the embodiments of the present application, the U component and the V component use different maximum fixed filter times and different maximum fixed filter category numbers.

[0299] Further, in the embodiments of the present application, the value of scale in the fixed filter is not limited, which can be a fixed value or an adaptively selected value.

[0300] Further, in the embodiments of the present application, the form of Map(*) is not limited, which can be a lookup table or a mapping function.

[0301] Further, in the embodiments of the present application, the form of MapSet(*) is not limited, which can be a lookup table or a mapping function.

[0302] The embodiment of the present application provides a decoding method, which can introduce first filtering implemented by a fixed filter to filter pixels with similar textures, wherein a first filtering coefficient used when the first filtering is performed is a preset constant value which does not need to be coded, and thus the first filtering is performed on the pixels with similar textures by the fixed filter, so that the code word overhead can be greatly reduced while the filtering effect is ensured, and the coding performance is improved.

[0303] An embodiment of the present application provides an encoding method, which is applied to an encoder and used in a scenario of performing filtering processing by loop filtering. FIG. 9 is a schematic diagram of the encoding method provided by the embodiment of the present application. As shown in FIG. 9, the method of the encoding processing performed by the encoder can include the following steps.

[0304] In the embodiment of the present application, the first generation value corresponding to the first filtering can be determined first. The second generation value corresponding to the second filtering can be determined. The third generation value corresponding to the first filtering and the second filtering can be determined. Then, the first filtering identification information and the second filtering identification information can be determined according to the first generation value, the second generation value and the third generation value.

[0305] In the embodiment of the present application, the first filtering identification information can be used to determine whether the first filtering is performed.

[0306] In the embodiment of the present application, the first filtering identification information can be used to determine whether the first filtering is performed.

[0307] It should be noted that, in the embodiment of the present application, the first filtering identification information can be used to determine whether the first filtering is performed.

[0308] Further, in the embodiment of the present application, the first filtering can include filtering according to the first filtering coefficient. The first filtering coefficient can include a preset constant value, that is, the filtering coefficient used when the first filtering is performed is a fixed value determined in advance.

[0309] Exemplarily, in some embodiments, the first filtering includes but is not limited to filtering by a fixed filter.

[0310] It can be understood that, in the embodiments of the present application, considering that there are pixels with similar textures in different sequences, the pixels with similar textures can be selected to be filtered using the same or similar filter, so that the coding of different filters can no longer be performed, and the codeword overhead can be greatly reduced.

[0311] Further, in the embodiments of the present application, when the first filtering is performed, the corresponding input information can at least include the first reconstructed value of the luminance component, and the corresponding output information can be the first chroma sample correction value. The first chroma sample correction value can be understood as related information of the chroma component, including but not limited to chroma reconstruction information. For example, the input of the first filtering can be the luminance reconstruction information, and the output can be the chroma reconstruction information.

[0312] It can be understood that, in the embodiments of the present application, when the first filtering is performed, in addition to the luminance reconstruction information, the corresponding input information can also include chroma reconstruction information, luminance residual information and other luminance or chroma related sample information, which is not limited in the present application.

[0313] Further, in the embodiments of the present application, assuming that the first filtering is filtering using a fixed filter, the shape, type and tap number of the fixed filter can also be different corresponding to different input information of the first filtering.

[0314] Exemplarily, in some embodiments, as shown in FIG. 6, the input of the fixed filter is the reconstructed value of the luminance sample output by the SAO, x in the fixed filter represents the position of the luminance sample corresponding to the chroma sample to be filtered, and the numbers correspond to the positions of the adjacent luminance samples. Among them, 0, 1, 2, … x, … 29, 30 represent the filter coefficient indexes corresponding to 31 filter coefficients. The value at x is usually defaulted to 0.

[0315] Exemplarily, in some embodiments, as shown in FIG. 7, the input of the left filter in the fixed filter is the reconstructed value of the luminance sample output by the SAO, x represents the position of the luminance sample corresponding to the chroma sample to be filtered, and the numbers correspond to the positions of the adjacent luminance samples; the input of the right filter in the fixed filter is the reconstructed value of the chroma sample output by the SAO, x represents the chroma sample to be filtered, and the numbers correspond to the positions of the adjacent chroma samples. Among them, 0, 1, 2, … x, … 29, 30, 31, 32, … x, … 41, 42 represent the filter coefficient indexes corresponding to 45 filter coefficients. The value at x is usually defaulted to 0.

[0316] Further, in the embodiments of the present application, the filter coefficients of the fixed filter are extracted from the video data set. There are various ways to obtain the filter coefficients of the fixed filter, including but not limited to using the Wiener filtering method to calculate the filter coefficients, using the least square method to calculate the filter coefficients, using the neural network to learn the filter coefficients, which are not specifically limited in the present application.

[0317] It should be noted that in the embodiments of the present application, the filter coefficients of the fixed filter can be integer numbers or floating point numbers, which are not specifically limited in the present application.

[0318] It should be noted that in the embodiments of the present application, the second filter identification information can be used to determine whether to perform the second filtering.

[0319] Further, in the embodiments of the present application, the second filtering can include filtering according to the second filter coefficients. The second filter coefficients can be determined based on the APS. The second filter coefficients can be determined by analyzing the APS corresponding to the current image, or can be determined by analyzing the APS corresponding to other images, which are not specifically limited in the present application.

[0320] For example, in some embodiments, the second filtering includes but is not limited to filtering by the CCALF. For example, the second filtering can be filtering by the CCALF new filter.

[0321] Further, in the embodiments of the present application, when performing the second filtering, the corresponding input information can at least include the second reconstructed value of the luminance component, and the corresponding output information can be the second chroma sample correction value. The second chroma sample correction value can be understood as the related information of the chroma component, including but not limited to the chroma reconstructed information. For example, the input of the second filtering can be the luminance reconstructed information, and the output can be the chroma reconstructed information.

[0322] It can be understood that in the embodiments of the present application, when performing the second filtering, in addition to the luminance reconstructed information, the corresponding input information can also include the chroma reconstructed information, the luminance residual information and other luminance or chroma related sample information, which are not specifically limited in the present application.

[0323] Further, in the embodiments of the present application, the filtering result output after performing the first filtering can also be used as the input information of the second filtering for the second filtering. For example, after the first filtering by the fixed filter outputs the first chroma sample correction value, the first chroma sample correction value can be input into the subsequent CCALF new filter for the second filtering, and then the second chroma sample correction value is output.

[0324] Further, in the embodiments of the present application, when the first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value, in the case that the first generation value is greater than the second generation value and the first generation value is greater than the third generation value, it is determined that the first filter identification information indicates that the first filter is performed and the second filter identification information indicates that the second filter is not performed; in the case that the second generation value is greater than the first generation value and the second generation value is greater than the first generation value, it is determined that the first filter identification information indicates that the first filter is not performed and the second filter identification information indicates that the second filter is performed; in the case that the third generation value is greater than the first generation value and the third generation value is greater than the second generation value, it is determined that the first filter identification information indicates that the first filter is performed and the second filter identification information indicates that the second filter is performed.

[0325] Further, in the embodiments of the present application, when the first filter coefficient and the execution times of the first filter are determined, the pixel category of the pixel to be filtered is determined, and the filter category corresponding to the pixel category of the pixel to be filtered is determined; according to the filter category and the preset filter times, the filter coefficients in the candidate filter group are traversed to determine the generation values of the filter coefficients in the candidate filter group under different filter times; according to the generation values of the filter coefficients in the candidate filter group under different filter times, the first filter coefficient and the execution times of the first filter are determined.

[0326] Further, in the embodiments of the present application, according to the fixed filter group corresponding to the first filter coefficient and the candidate filter group, the fixed filter index is determined; according to the fixed filter index, the first syntax element identification information is determined, and the first syntax element identification information is written into the bitstream; according to the execution times of the first filter, the second syntax element identification information is determined, and the second syntax element identification information is written into the bitstream.

[0327] It should be noted that, in the embodiments of the present application, the first syntax element identification information can be used to determine the fixed filter group index filterSetIdx corresponding to the first filter coefficient, that is, to determine the fixed filter index.

[0328] It can be understood that, in the embodiments of the present application, the fixed filter index can be determined through the value of the first syntax element identification information, so that the corresponding fixed filter group can be determined from the candidate filter group according to the fixed filter index, and then the first filter coefficient can be determined based on the fixed filter group.

[0329] It should be noted that in the embodiments of the present application, the value range of the first syntax element identification information can depend on the number of candidate filter sets, that is, the number of candidate filter sets can determine the value range of the first syntax element identification information.

[0330] Further, in the embodiments of the present application, the first syntax element identification information can be a flag, wherein the first syntax element identification information can be an image-level flag or a slice-level flag. The present application does not make specific limitations.

[0331] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C b component, the first syntax element identification information can be represented by the syntax element sh_alf_cc_cb_fixed_filter_set_idx, that is, the value of sh_alf_cc_cb_fixed_filter_set_idx can be used to determine the fixed filter index filterSetIdx.

[0332] Exemplarily, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include fixed filter set 0 and fixed filter set 1, when the value of sh_alf_cc_cb_fixed_filter_set_idx is 0, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of sh_alf_cc_cb_fixed_filter_set_idx is 1, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0333] Of course, the number of candidate filter sets is not limited to 2, and correspondingly, the value of sh_alf_cc_cb_fixed_filter_set_idx is not limited to 0 and 1, and the present application does not make specific limitations.

[0334] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C r component, the first syntax element identification information can be represented by the syntax element sh_alf_cc_cr_fixed_filter_set_idx, that is, the value of sh_alf_cc_cr_fixed_filter_set_idx can be used to determine the fixed filter index filterSetIdx.

[0335] Exemplarily, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include fixed filter set 0 and fixed filter set 1, when the value of sh_alf_cc_cr_fixed_filter_set_idx is 0, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of sh_alf_cc_cr_fixed_filter_set_idx is 1, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0336] Of course, the number of candidate filter sets is not limited to 2, and correspondingly, the value of sh_alf_cc_cr_fixed_filter_set_idx is not limited to 0 and 1, which is not specifically limited in the present application.

[0337] It should be noted that in the embodiments of the present application, the second syntax element identification information can be used to determine the number of times of filtering corresponding to the first filtering, that is, to determine the execution times filterTimes of the first filtering.

[0338] It can be understood that in the embodiments of the present application, the execution times of the corresponding first filtering can be determined through the value of the second syntax element identification information.

[0339] It should be noted that in the embodiments of the present application, the value range of the second syntax element identification information can depend on the pre-determined upper limit value of the number of times of filtering, that is, the pre-determined upper limit value of the number of times of filtering can determine the value range of the second syntax element identification information.

[0340] Further, in the embodiments of the present application, the second syntax element identification information can be a flag, wherein the second syntax element identification information can be an image-level flag or a slice-level flag. The present application does not make specific limitation.

[0341] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C b component, the second syntax element identification information can be represented by the syntax element sh_alf_cc_cb_fixed_filter_time_idx, that is, the value of sh_alf_cc_cb_fixed_filter_time_idx can be used to determine the execution times filterTimes of the first filtering.

[0342] Exemplarily, in some embodiments, assuming that the maximum filter times is set to be 2, when the value of sh_alf_cc_cb_fixed_filter_time_idx is 0, the execution times filterTimes of the first filter can be determined to be 1, i.e. the first filter is executed once; when the value of sh_alf_cc_cb_fixed_filter_time_idx is 1, the execution times filterTimes of the first filter can be determined to be 2, i.e. the first filter is executed twice.

[0343] Of course, the pre-determined upper limit of the filter times is not limited to 2, and correspondingly, the value of sh_alf_cc_cb_fixed_filter_time_idx is not limited to 0 and 1, which is not specifically limited in the present application.

[0344] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C r component, the second syntax element identification information can be represented by the syntax element sh_alf_cc_cr_fixed_filter_time_idx, i.e. the value of sh_alf_cc_cr_fixed_filter_time_idx can be used to determine the execution times filterTimes of the first filter.

[0345] Exemplarily, in some embodiments, assuming that the maximum filter times is set to be 2, when the value of sh_alf_cc_cr_fixed_filter_time_idx is 0, the execution times filterTimes of the first filter can be determined to be 1, i.e. the first filter is executed once; when the value of sh_alf_cc_cr_fixed_filter_time_idx is 1, the execution times filterTimes of the first filter can be determined to be 2, i.e. the first filter is executed twice.

[0346] Of course, the pre-determined upper limit of the filter times is not limited to 2, and correspondingly, the value of sh_alf_cc_cr_fixed_filter_time_idx is not limited to 0 and 1, which is not specifically limited in the present application.

[0347] Further, in the embodiments of the present application, when the first filter coefficient and the execution number of the first filtering are determined, the pixel category of the pixel to be filtered in the current block is determined, and the filter category corresponding to the pixel category of the pixel to be filtered is determined; the filter coefficients in the candidate filter group are traversed according to the filter category and the preset filter number to determine the generation value of the filter coefficients in the candidate filter group under different filter numbers; and the first filter coefficient corresponding to the current block and the execution number of the first filtering corresponding to the current block are determined according to the generation value of the filter coefficients in the candidate filter group under different filter numbers.

[0348] Further, in the embodiments of the present application, the fixed filter index corresponding to the current block is determined according to the fixed filter group corresponding to the first filter coefficient corresponding to the current block and the candidate filter group; the third syntax element identification information is determined according to the fixed filter index corresponding to the current block, and the third syntax element identification information is written into the bitstream; and the fourth syntax element identification information is determined according to the execution number of the first filtering corresponding to the current block, and the fourth syntax element identification information is written into the bitstream.

[0349] It should be noted that, in the embodiments of the present application, for the case of only performing the first filtering, the syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc indicating the index of the CCALF new filter can be selected at the CTU level, that is, alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are reused in the coding tree unit process when only the fixed filter is used.

[0350] When the CCALF new filter is used, the syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter category used by each CTU.

[0351] When the fixed filter and the CCALF new filter are used at the same time, the syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter category used by each CTU.

[0352] For example, in some embodiments, when only the fixed filter is used, if the current color component of the current block is the chroma C b component, the third syntax element identification information can be represented by the syntax element alf_ctb_cc_cr_idc, that is, the value of alf_ctb_cc_cr_idc can be used to determine the fixed filter index filterSetIdx.

[0353] Exemplarily, in some embodiments, if the current color component of the current block is the chroma C r component, the third syntax element identification information can be represented by a syntax element alf_ctb_cc_cr_idc, i.e., the value of alf_ctb_cc_cr_idc can be used to determine the fixed filter index filterSetIdx.

[0354] That is, in the embodiments of the present application, the third syntax element identification information can be a flag, wherein the third syntax element identification information can be a block-level flag.

[0355] Further, in the embodiments of the present application, the fourth syntax element identification information can be a flag, wherein the fourth syntax element identification information can be a block-level flag.

[0356] Exemplarily, in some embodiments, if the current color component of the current block is the chroma C b component, the fourth syntax element identification information can be represented by a syntax element alf_ctb_cc_cb_time, i.e., the value of alf_ctb_cc_cb_time can be used to determine the execution times filterTimes of the first filter.

[0357] Exemplarily, in some embodiments, assuming that the maximum filter times is set to 2, when the value of alf_ctb_cc_cb_time is 0, the execution times filterTimes of the first filter can be determined to be 1, i.e., the first filter is executed once; when the value of alf_ctb_cc_cb_time is 1, the execution times filterTimes of the first filter can be determined to be 2, i.e., the first filter is executed twice.

[0358] Of course, the pre-determined upper limit of the filter times is not limited to 2, and correspondingly, the value of alf_ctb_cc_cb_time is not limited to 0 and 1, which is not specifically limited in the present application.

[0359] Exemplarily, in some embodiments, if the current color component of the current block is the chroma C r component, the fourth syntax element identification information can be represented by a syntax element alf_ctb_cc_cr_time, i.e., the value of alf_ctb_cc_cr_time can be used to determine the execution times filterTimes of the first filter.

[0360] Exemplarily, in some embodiments, assuming that the maximum filtering times is set to be 2, when the value of alf_ctb_cc_cr_time is 0, it can be determined that the execution times of the first filtering filterTimes is 1, i.e. the first filtering is performed once; when the value of alf_ctb_cc_cr_time is 1, it can be determined that the execution times of the first filtering filterTimes is 2, i.e. the first filtering is performed twice.

[0361] Of course, the upper limit of the predetermined filtering times is not limited to 2, and correspondingly, the value of alf_ctb_cc_cr_time is not limited to 0 and 1, which is not limited in the present application.

[0362] Further, in the embodiments of the present application, the fixed filtering index corresponding to the current block is determined according to the fixed filtering group corresponding to the first filtering coefficient corresponding to the current block and the candidate filtering group; the fifth syntax element identification information is determined according to the fixed filtering index corresponding to the current block, and the fifth syntax element identification information is written into the bitstream; the fourth syntax element identification information is determined according to the execution times of the first filtering corresponding to the current block, and the fourth syntax element identification information is written into the bitstream.

[0363] It should be noted that, in the embodiments of the present application, for the case of only performing the first filtering, the fifth syntax element identification information can be used to determine the case of performing the first filtering by the current block, including whether to perform the first filtering and the fixed filter group index filterSetIdx corresponding to the first filtering coefficient, i.e. the fifth syntax element identification information can be used to determine the case of using the fixed filter by the current block.

[0364] It can be understood that, in the embodiments of the present application, the value of the fifth syntax element identification information can be used to determine whether the first filtering is performed by the current block, i.e. whether the fixed filter is used by the current block.

[0365] It can be understood that, in the embodiments of the present application, the value of the fifth syntax element identification information can be used to determine whether the fixed filter is used by the current block, and in the case of using, the fixed filtering index corresponding to the current block is determined, so that the corresponding fixed filtering group can be determined from the candidate filtering group according to the fixed filtering index, and then the first filtering coefficient can be determined based on the fixed filtering group.

[0366] It should be noted that, in the embodiments of the present application, the value range of the fifth syntax element identification information can depend on the number of candidate filtering groups, i.e. the number of candidate filtering groups can determine the value range of the fifth syntax element identification information.

[0367] Further, in embodiments of the present application, the fifth syntax element identification information can be a flag, wherein the fifth syntax element identification information can be a block-level flag.

[0368] For example, in some embodiments, for the case of performing only the first filtering, if the current color component of the current block is a chroma C b component, then the fifth syntax element identification information can be represented by syntax element alf_ctb_cc_cb_fixed_filter_idc, i.e., the value of alf_ctb_cc_cb_fixed_filter_idc can be used to determine whether the current block uses a fixed filter, and to determine the fixed filter index filterSetIdx.

[0369] For example, in some embodiments, assuming that the number of candidate filter sets is 2, and the candidate filter sets respectively include fixed filter set 0 and fixed filter set 1, then when the value of alf_ctb_cc_cb_fixed_filter_idc is 0, it can be determined that the current block does not perform the first filtering, i.e., the current block does not use a fixed filter; when the value of alf_ctb_cc_cb_fixed_filter_idc is not 0, it can be determined that the current block uses the filter set with fixed filter set index alf_ctb_cc_cb_fixed_filter_idc-1 for filtering. For example, when the value of alf_ctb_cc_cb_fixed_filter_idc is 1, it can be determined that the fixed filter index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter set can be determined as the selected fixed filter set. When the value of alf_ctb_cc_cb_fixed_filter_idc is 2, it can be determined that the fixed filter index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter set can be determined as the selected fixed filter set.

[0370] Of course, the number of candidate filter sets is not limited to 2, and correspondingly, the value of alf_ctb_cc_cb_fixed_filter_idc is not limited to 0, 1 and 2, which is not specifically limited in the present application.

[0371] For example, in some embodiments, if the current color component of the current block is a chroma C rIn the case that the number of the candidate filter sets is 2, the candidate filter sets respectively include a fixed filter set 0 and a fixed filter set 1, and the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is 0, it can be determined that the current block does not perform the first filtering, i.e., the current block does not use the fixed filter. In the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is not 0, it can be determined that the current block uses the filter set with the fixed filter set index of alf_ctb_cc_cr_fixed_filter_idc-1. For example, in the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is 1, it can be determined that the fixed filter set index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter sets can be determined as the selected fixed filter set. In the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is 2, it can be determined that the fixed filter set index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter sets can be determined as the selected fixed filter set.

[0372] In some embodiments, it is exemplarily assumed that the number of the candidate filter sets is 2, the candidate filter sets respectively include a fixed filter set 0 and a fixed filter set 1, and in the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is 0, it can be determined that the current block does not perform the first filtering, i.e., the current block does not use the fixed filter. In the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is not 0, it can be determined that the current block uses the filter set with the fixed filter set index of alf_ctb_cc_cr_fixed_filter_idc-1. For example, in the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is 1, it can be determined that the fixed filter set index filterSetIdx is 0, and correspondingly, the fixed filter set 0 in the candidate filter sets can be determined as the selected fixed filter set. In the case that the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is 2, it can be determined that the fixed filter set index filterSetIdx is 1, and correspondingly, the fixed filter set 1 in the candidate filter sets can be determined as the selected fixed filter set.

[0373] Of course, the number of the candidate filter sets is not limited to 2, and correspondingly, the value of the syntax element alf_ctb_cc_cr_fixed_filter_idc is not limited to 0, 1 and 2, which is not limited in the present application.

[0374] Further, in the embodiments of the present application, a fourth cost value is determined in the case that the current block performs the first filtering, a fifth cost value is determined in the case that the current block does not perform the first filtering, a sixth syntax element identification information is determined according to the fourth cost value and the fifth cost value, and the sixth syntax element identification information is written into the bitstream, wherein the sixth syntax element identification information is used to determine whether the first filtering is performed on the current block.

[0375] It should be noted that in the embodiments of the present application, for the case of only performing the first filtering, the sixth syntax element identification information can also be used to determine whether the current block performs the first filtering, i.e., the sixth syntax element identification information can be used to determine whether the current block uses the fixed filter.

[0376] Further, in embodiments of the present application, the sixth syntax element identification information can be a flag, wherein the sixth syntax element identification information can be a block-level flag.

[0377] Exemplarily, in some embodiments, for the case of performing only the first filtering, if the current color component of the current block is a chroma C b component, then the sixth syntax element identification information can be represented by a syntax element alf_ctb_cc_cb_fixed_filter_flag, i.e., the value of alf_ctb_cc_cb_fixed_filter_flag can be used to determine whether the current block uses a fixed filter to perform the first filtering.

[0378] Exemplarily, in some embodiments, when the value of alf_ctb_cc_cb_fixed_filter_flag is 0, it can be determined that the current block does not perform the first filtering, i.e., the current block does not use a fixed filter; when the value of alf_ctb_cc_cb_fixed_filter_flag is 1, it can be determined that the current block performs the first filtering, i.e., the current block uses a fixed filter.

[0379] Further, in embodiments of the present application, when determining the pixel category of the to-be-filtered pixel, the horizontal direction index, the vertical direction index and the direction activity index corresponding to the to-be-filtered pixel can be determined according to the gradient parameter of the to-be-filtered pixel first, and then the variance division index of the to-be-filtered pixel is determined; and then the pixel category of the to-be-filtered pixel is determined according to the horizontal direction index, the vertical direction index, the direction activity index and the variance division index.

[0380] It can be understood that, in embodiments of the present application, the image sample blocks of the same size can be obtained based on the current image component (luminance component or chroma component) of the current image, so that the pixels in the image sample blocks obtained by division can be determined as to-be-filtered samples.

[0381] Exemplarily, in some embodiments, the component can be divided into a plurality of N x N pixel blocks. For a CTU with a size of M x M, it will be divided into ceil(M / N) x ceil(M / N) pixel blocks.

[0382] It can be understood that, in embodiments of the present application, the gradient parameter of the to-be-filtered pixel can include one or more gradient values of the to-be-filtered pixel in one or more directions, for example, the gradient parameter of the to-be-filtered pixel can include but is not limited to gradient values of the to-be-filtered pixel in horizontal, vertical, 45° and 135° directions.

[0383] Exemplarily, in some embodiments, the calculation of the gradient values can be performed in any manner, including but not limited to, calculating the gradient values by using a Laplacian operator, calculating the gradient values by using a Sobel operator.

[0384] Further, in embodiments of the present disclosure, after the gradient parameters corresponding to the pixel to be filtered are calculated, the horizontal direction index H i , the vertical direction index V i and the direction activity index A i corresponding to the pixel to be filtered can be determined by using the gradient parameters including one or more gradient values.

[0385] Further, in embodiments of the present disclosure, the variance value corresponding to the pixel to be filtered can also be determined, and then the variance division index D i corresponding to the pixel to be filtered can be further determined according to the variance value corresponding to the pixel to be filtered.

[0386] Further, in embodiments of the present disclosure, when the variance division index of the sample to be filtered is determined, the variance value corresponding to the sample to be filtered can be determined, and then the variance division index D i corresponding to the sample to be filtered can be further determined according to the variance value corresponding to the sample to be filtered.

[0387] Further, in embodiments of the present disclosure, when the pixel class of the sample to be filtered is determined according to the horizontal direction index, the vertical direction index, the direction activity index and the variance division index, the pixel class classIdx of each sample to be filtered in the image sample block can be calculated by using a class calculation formula based on the horizontal direction index H i , the vertical direction index V i , the direction activity index A i and the variance division index D i .

[0388] Exemplarily, in some embodiments, the class calculation formula is as formula (7).

[0389] Correspondingly, in some embodiments, the number totalClassNum of the pixel classes corresponding to the current image component can be determined by using formula (8), where D is the variance division number.

[0390] Further, in embodiments of the present disclosure, when the pixel class of the sample to be filtered is determined, the pixel class of the sample to be filtered can also be determined according to the position information of the sample to be filtered.

[0391] That is, in the embodiments of the present application, the division of the pixel classes in the fixed filter can also take other forms other than gradient calculation, for example, it can be determined according to the position of the pixel or the position of the CTU.

[0392] Exemplarily, in some embodiments, the current image component can be divided into a plurality of N×N pixel blocks. For a CTU with a size of M×M, it will be divided into ceil(M / N)×ceil(M / N) pixel blocks. Then, the class of each pixel block can be obtained according to the position (x, y) of each pixel block, where classIdx=F((x, y)), and F(*) is a mapping function of the pixel block position.

[0393] Further, in the embodiments of the present application, after determining the pixel class corresponding to the to-be-filtered pixel, the filter class corresponding to the pixel class of the to-be-filtered pixel can be further determined. The filter class can be understood as the fixed filter class.

[0394] Exemplarily, in some embodiments, the fixed filter class used can be determined according to the pixel class, that is, the corresponding filter class is determined. For example, the pixel class classIdx is denoted as cIdx, and the filter class that can be used is filterIdx=Map(cIdx), where Map(*) is a mapping table.

[0395] Further, in the embodiments of the present application, the construction of the candidate filter set can be performed first. The candidate filter set can be understood as one or more fixed filter sets allowed to be used, and the number of the candidate filter set is not limited in the present application.

[0396] Exemplarily, in some embodiments, when constructing the candidate filter set, the quantization parameter can be determined first; and then the candidate filter set is determined according to the quantization parameter.

[0397] It can be understood that, in the embodiments of the present application, the quantization parameter can be the quantization parameter of the current image, the quantization parameter of the current block, or the quantization parameter of the current slice, which is not limited in the present application.

[0398] Exemplarily, in some embodiments, the fixed filter set (candidate filter set) allowed to be used can be determined according to the quantization parameter of the current frame image. Assuming that the quantization parameter of the current frame image is qp, the filter set class that can be used is filterSetIdxVec=MapSet(qp), where MapSet(*) is a mapping table. It should be noted that filterSetIdxVec is a vector, indicating the fixed filter set available for the frame image, that is, the candidate filter set can be represented as filterSetIdxVec.

[0399] Exemplarily, in some embodiments, when constructing the candidate filter set, the quantization parameter and the slice type of the current slice can be determined first; wherein the slice type comprises I slice, B slice and P slice; and then the candidate filter set can be determined according to the quantization parameter and the slice type.

[0400] It can be understood that in the embodiments of the present application, the calculation of the fixed filter set index is not only related to the quantization parameter, but also related to the type of the current frame image. For example, the frame type, i.e. the slice type, can be introduced in the process of constructing the candidate filter set.

[0401] Exemplarily, in some embodiments, the fixed filter set used can be determined according to the quantization parameter and the slice type of the current frame image. Assuming that the quantization parameter of the current frame image is qp and the slice type is type, the filter set class that can be used is filterSetIdxVec=MapSet(qp, type), wherein MapSet(*) is a mapping table. It should be noted that filterSetIdxVec is a vector, which represents the fixed filter set available for the frame image, i.e. the candidate filter set can be represented as filterSetIdxVec.

[0402] Further, in the embodiments of the present application, the filtering index of the current block corresponding to the second filter coefficient is determined; the third syntax element identification information is determined according to the filtering index of the current block, and the third syntax element identification information is written into the bitstream.

[0403] It can be understood that in the embodiments of the present application, for the case of only performing the first filtering, the syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc indicating the index of the new filter of CCALF can be selected at the CTU level, i.e. alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are reused in the coding tree unit process when only the fixed filter is used. In other cases, for example, the case of only performing the second filtering, or the case of performing the first filtering and the second filtering, the third syntax element identification information syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter class used by each CTU.

[0404] That is to say, in the embodiments of the present application, if the second filtering is performed, i.e. if the new filter of CCALF is used, the third syntax element identification information alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are used to indicate the new filter class used by each CTU.

[0405] Further, in embodiments of the present application, according to the first filter identification information and the second filter identification information, a ninth syntax element identification information is determined, and the ninth syntax element identification information is written into a bitstream.

[0406] Further, in embodiments of the present application, the ninth syntax element identification information can be a flag, wherein the ninth syntax element identification information can be a picture-level flag or a slice-level flag. The present application does not make specific limitations.

[0407] It should be noted that, in embodiments of the present application, the ninth syntax element identification information can be used to determine whether to simultaneously perform the first filter and the second filter, that is, the value of the ninth syntax element identification information can indicate whether to only perform the first filter.

[0408] Exemplarily, in some embodiments, if the current color component of the current slice is a chroma C b component, the ninth syntax element identification information can be represented by a syntax element sh_alf_cc_cb_filter_mode_idx, that is, the value of sh_alf_cc_cb_filter_mode_idx can be used to determine a filter mode flag ccalfFilterMode. For example, when the value of sh_alf_cc_cb_filter_mode_idx is 0, it indicates that only a fixed filter is used, and when the value of sh_alf_cc_cb_filter_mode_idx is 1, it indicates that a CCALF new filter is used.

[0409] Of course, the value of sh_alf_cc_cb_filter_mode_idx is not limited to 0 and 1, and the present application does not make specific limitations.

[0410] It should be noted that, in embodiments of the present application, the ninth syntax element identification information can also be used to determine whether to perform the first filter or the second filter.

[0411] Exemplarily, in some embodiments, if the current color component of the current slice is a chroma C rIf the component is CC, the ninth syntax element identification information can be represented by syntax element sh alf cc cr filter mode idx, i.e. the value of sh alf cc cr filter mode idx can be used to determine filter mode flag ccalfFilterMode. For example, if the value of sh alf cc cr filter mode idx is 0, it means that only fixed filter is used, and if the value of sh alf cc cr filter mode idx is 1, it means that only new CCALF filter is used.

[0412] Of course, the value of sh alf cc cr filter mode idx is not limited to 0 and 1, and the present application does not make specific limitation.

[0413] That is to say, in the embodiments of the present application, the first filter identification information for indicating whether the first filter is performed and the second filter identification information for indicating whether the second filter is performed can be determined based on one syntax element identification information.

[0414] Further, in the embodiments of the present application, the tenth syntax element identification information is determined according to the first filter identification information, and the eleventh syntax element identification information is determined according to the second filter identification information; the tenth syntax element identification information and the eleventh syntax element identification information are written into the bitstream.

[0415] That is to say, in the embodiments of the present application, the first filter identification information for indicating whether the first filter is performed and the second filter identification information for indicating whether the second filter is performed can be determined based on two syntax element identification information. For example, the tenth syntax element identification information is used to determine whether the first filter is performed, i.e. whether the fixed filter is used; at the same time, the eleventh syntax element identification information is used to determine whether the second filter is performed, i.e. whether the new filter is used.

[0416] Step 2003, filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value.

[0417] In the embodiments of the present application, after the first filter identification information and the second filter identification information are determined, filtering can be further performed according to the first filter identification information and the second filter identification information, so as to determine the first chroma sample correction value through the first filter, and / or determine the second chroma sample correction value through the second filter.

[0418] Further, in embodiments of the present application, based on the first filter identification information and the second filter identification information, it can be determined that the following three filters are included: only performing the first filter, only performing the second filter, and simultaneously performing the first filter and the second filter.

[0419] Correspondingly, in embodiments of the present application, if only the first filter is performed, the obtained filter result is the first chroma sample correction value, if only the second filter is performed, the obtained filter result is the second chroma sample correction value, and if the first filter and the second filter are simultaneously performed, the obtained filter result is the first chroma sample correction value and the second chroma sample correction value.

[0420] Further, in embodiments of the present application, when filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value, in a case where the first filter identification information indicates that the first filter is performed and the second filter identification information indicates that the second filter is not performed, the first filter coefficient and the number of times of performing the first filter are determined; then the first filter is performed according to the first filter coefficient and the number of times of performing the first filter, and the first chroma sample correction value is determined.

[0421] It should be noted that in embodiments of the present application, if it is determined based on the first filter identification information and the second filter identification information that only the first filter is performed, for example, it is determined that only a fixed filter is used for filter processing, then the determination of the first filter coefficient and the number of times of performing the first filter can be performed first.

[0422] Further, in embodiments of the present application, when filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value, in a case where the first filter identification information indicates that the first filter is not performed and the second filter identification information indicates that the second filter is performed, the second filter coefficient is determined based on the corresponding APS; then the second filter is performed according to the second filter coefficient, and the second chroma sample correction value is determined.

[0423] It should be noted that in embodiments of the present application, if it is determined based on the first filter identification information and the second filter identification information that only the second filter is performed, for example, it is determined that only a CCALF new filter is used for filter processing, then the determination of the second filter coefficient can be performed first.

[0424] Further, in embodiments of the present application, the APS index corresponding to the current image can be determined according to the seventh syntax element identification information; finally, the corresponding APS can be determined according to the APS index.

[0425] That is, in embodiments of the present application, the second filter coefficients performing the second filtering can be written in the corresponding APS, and the APS ID can be written in the slice header or the picture header information.

[0426] It can be understood that in embodiments of the present application, the seventh syntax element identification information can be used to determine the APS index.

[0427] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C b component, the seventh syntax element identification information can be represented by the syntax element sh_alf_cc_cb_aps_id, i.e., the value of sh_alf_cc_cb_aps_id can be used to determine the APS index.

[0428] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C r component, the seventh syntax element identification information can be represented by the syntax element sh_alf_cc_cr_aps_id, i.e., the value of sh_alf_cc_cr_aps_id can be used to determine the APS index.

[0429] Further, in embodiments of the present application, the eighth syntax element identification information can be used to indicate whether the second filter coefficients exist in the corresponding APS.

[0430] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C b component, the eighth syntax element identification information can be represented by the syntax element alf_cc_cb_filter_signal_flag, i.e., the value of alf_cc_cb_filter_signal_flag can be used to determine whether the second filter coefficients can be obtained from the corresponding APS. For example, if the value of alf_cc_cb_filter_signal_flag is 0, it can be considered that the second filter coefficients do not exist in the corresponding APS; if the value of alf_cc_cb_filter_signal_flag is 1, it can be considered that the second filter coefficients exist in the corresponding APS.

[0431] Exemplarily, in some embodiments, if the current color component of the current slice is the chroma C rIf the component is not present, the eighth syntax element identifying information can be represented by a syntax element alf_cc_cr_filter_signal_flag, i.e. the value of alf_cc_cr_filter_signal_flag can be used to determine whether the second filter coefficient can be obtained from the corresponding APS. For example, if the value of alf_cc_cr_filter_signal_flag is 0, it can be considered that the second filter coefficient does not exist in the corresponding APS; if the value of alf_cc_cr_filter_signal_flag is 1, it can be considered that the second filter coefficient exists in the corresponding APS.

[0432] Further, in the embodiments of the present application, when filtering according to the first filter identifying information and the second filter identifying information, determining the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filter identifying information indicates to perform the first filter and the second filter identifying information indicates to perform the second filter, the first filter coefficient and the execution number of the first filter are determined, and the second filter coefficient is determined based on the corresponding APS; then the first filter is performed according to the first filter coefficient and the execution number of the first filter, and the first chroma sample correction value is determined.

[0433] It should be noted that in the embodiments of the present application, if it is determined to perform the first filter and the second filter based on the first filter identifying information and the second filter identifying information, for example, it is determined to perform filtering processing using the fixed filter and the CCALF new filter, the determination of the first filter coefficient and the execution number of the first filter, and the determination of the second filter coefficient can be performed respectively.

[0434] Further, in the embodiments of the present application, after the first filter coefficient and the execution number of the first filter are determined, the first filter can be performed according to the first filter coefficient and the execution number of the first filter, and the first chroma sample correction value is determined.

[0435] It should be noted that in the embodiments of the present application, the first chroma sample correction value obtained by performing the first filter can include but is not limited to the compensation value of the chroma sample (the compensation value offsetC of the chroma pixel) and the filtered sample of the chroma sample (the filtered pixel recC of the chroma pixel) fixed ).

[0436] Exemplarily, in some embodiments, assuming that the first filter coefficient is c f , i.e. the fixed filter coefficient c f , the process of performing the first filter on the to-be-filtered pixel can be as formula (9).

[0437] Exemplarily, in some embodiments, it is assumed that the first filter coefficient c f i.e. the fixed filter coefficient c f Then, the process of performing the first filter on the pixel to be filtered can be as formula (10).

[0438] Exemplarily, in some embodiments, it is assumed that the first filter coefficient c f i.e. the fixed filter coefficient c f Then, the process of performing the first filter on the pixel to be filtered can be as formula (11).

[0439] Further, in the embodiments of the present application, after the second filter coefficient is determined, the second filter can be performed according to the second filter coefficient, and the second chroma sample correction value is determined.

[0440] Further, in the embodiments of the present application, for the case of using the fixed filter and the CCALF new filter at the same time, the output of the first chroma sample correction value can be selected as the input of the CCALF new filter after the output of the CCALF fixed filter, so that the filtering process is more accurate.

[0441] That is, in the embodiments of the present application, the first chroma sample correction value output by the first filter can be used as the input information of the second filter.

[0442] Exemplarily, in some embodiments, as shown in FIG. 8, three different types of filter combinations can be used as the CCALF new filter.

[0443] Exemplarily, in some embodiments, for the pixel to be filtered, the filter formula of performing the second filter is as formula (12).

[0444] Exemplarily, in some embodiments, for the pixel to be filtered, the filter formula of performing the second filter is as formula (13).

[0445] Step 2004, determining the filtered reconstruction value according to the first chroma sample correction value and / or the second chroma sample correction value.

[0446] In the embodiments of the present application, after the first chroma sample correction value and / or the second chroma sample correction value is determined according to the filtering according to the first filter identification information and the second filter identification information, the filtered reconstruction value can be determined according to the first chroma sample correction value and / or the second chroma sample correction value.

[0447] It should be noted that in the embodiments of the present application, since the three filtering modes can be determined based on the first filtering identification information and the second filtering identification information, the corresponding obtained filtering results can be the first chroma sample correction value, the second chroma sample correction value, the first chroma sample correction value and the second chroma sample correction value. Therefore, the final loop filtering result, i.e., the filtered reconstruction value, can be determined according to the first chroma sample correction value and / or the second chroma sample correction value.

[0448] Further, in the embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filtering identification information indicates that the first filtering is performed and the second filtering identification information indicates that the second filtering is not performed, the final filtered reconstruction value can be determined according to the first chroma sample correction value obtained after the first filtering is performed, in combination with the third chroma sample correction value.

[0449] It should be noted that in the embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and the corresponding pre-filtering sample value, the first chroma sample correction value and the corresponding pre-filtering sample value can be summed, and then the filtered reconstruction value can be determined based on the sum result, or the first chroma sample correction value and the corresponding pre-filtering sample value can be scaled, for example, offset is scaled, and then the filtered reconstruction value can be determined based on the scaling result. The present application does not make specific limitation.

[0450] Further, in the embodiments of the present application, when the filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filtering identification information indicates that the first filtering is not performed and the second filtering identification information indicates that the second filtering is performed, the final filtered reconstruction value can be determined according to the second chroma sample correction value obtained after the second filtering is performed, in combination with the third chroma sample correction value.

[0451] It should be noted that in the embodiments of the present application, when the filtered reconstruction value is determined according to the second chroma sample correction value and the corresponding pre-filtering sample value, the second chroma sample correction value and the corresponding pre-filtering sample value can be summed, and then the filtered reconstruction value can be determined based on the sum result, or the second chroma sample correction value and the corresponding pre-filtering sample value can be scaled, for example, offset is scaled, and then the filtered reconstruction value can be determined based on the scaling result. The present application does not make specific limitation.

[0452] Further, in the embodiments of the present application, when the post-filtered reconstruction value is determined according to the first chroma sample correction value and / or the second chroma sample correction value, in the case that the first filter identification information indicates that the first filter is performed and the second filter identification information indicates that the second filter is performed, the first chroma sample correction value outputted after the first filter is performed can be used for the subsequent second filter, and after the second chroma sample correction value is obtained by completing the second filter, the final post-filtered reconstruction value can be further determined by combining the first chroma sample correction value, the second chroma sample correction value and the third chroma sample correction value.

[0453] It should be noted that in the embodiments of the present application, when the post-filtered reconstruction value is determined according to the first chroma sample correction value, the second chroma sample correction value and the corresponding pre-filter sample value, the first chroma sample correction value, the second chroma sample correction value and the corresponding pre-filter sample value can be summed, and then the post-filtered reconstruction value can be determined based on the sum result, or the first chroma sample correction value, the second chroma sample correction value and the corresponding pre-filter sample value can be scaled, for example, the offset is scaled, and then the post-filtered reconstruction value can be determined based on the scaling result. The present application does not make specific limitations.

[0454] It can be understood that in the embodiments of the present application, the final post-filtered reconstruction value can be understood as the final filtering result after completing the loop filtering.

[0455] Correspondingly, in the embodiments of the present application, the first chroma sample correction value obtained by performing the first filter can be used to correct the final post-filtered reconstruction value, and the second chroma sample correction value obtained by performing the second filter can also be used to correct the final post-filtered reconstruction value.

[0456] It should be noted that in the embodiments of the present application, the corresponding pre-filter sample value can be an initial value before performing the filtering process, including but not limited to the reconstruction value before performing the first filter or the second filter.

[0457] Further, in the embodiments of the present application, the output of the fixed filter can only be used as the input of the new CCALF filter, and not as the filtering result acting on the reconstructed image. That is, when the post-filtered reconstruction value is determined, the first chroma sample correction value outputted by the first filter can no longer be directly introduced.

[0458] In summary, the coding and decoding method proposed in the embodiments of the present application is a CCALF filter optimization technology. The fixed filter technology is introduced into the CCALF, breaking the constraint that similar texture pixels in different sequences need to be coded with multiple filters, so that the pixels with similar texture can use the same filter for filtering, saving the bits spent on transmission, and thus enabling the CCALF to achieve better performance.

[0459] That is, the coding and decoding method proposed in the embodiments of the present application includes a filter optimization method. In the CCALF filtering process, a CCALF fixed filter is introduced to filter the to-be-filtered pixels. The fixed filter can input various information to improve the filtering accuracy. In addition, the output of the fixed filter can be directly output to the reconstructed image or input to a new filter, thereby improving the performance of the new filter. Better code rate and performance can be obtained.

[0460] The embodiments of the present application provide an encoding method. The first filtering implemented by a fixed filter can be introduced to filter pixels with similar texture. The first filtering coefficient used when the first filtering is performed is a preset constant value that does not need to be coded and decoded. Therefore, the first filtering performed on the pixels with similar texture by the fixed filter can greatly reduce the code word overhead while ensuring the filtering effect, and improve the coding and decoding performance.

[0461] Based on the above embodiments, another embodiment of the present application proposes a coding and decoding method. When there are similar textures between images in multiple sequences, multiple similar filters are still coded and decoded, which consumes more bits and increases the code word overhead. To solve this problem, a CCALF filter optimization technology is introduced. The fixed filter technology is introduced into the CCALF, breaking the constraint that similar texture pixels in different sequences need to be coded with multiple filters, so that the pixels with similar texture can use the same filter for filtering, thereby enabling the CCALF to achieve better performance.

[0462] It should be noted that for each chroma component, the information filtered by the same-component CCALF fixed filter can be used as the input of the new filter. For example, when the U component is filtered by the CCALF new filter, the result filtered by the U component CCALF fixed filter is used as the input; when the V component is filtered by the CCALF new filter, the result filtered by the V component CCALF fixed filter is used as the input. The filtering process of each chroma component (U / V component) is processed separately. Only one component is introduced in the following implementation example, and the other component is the same process.

[0463] Implementation mode one

[0464] At the encoding end:

[0465] First, the class information of all pixels of the component before ALF filtering is calculated. It is to be noted that there are totally H*V*A*D=totalClassNum classes. Where H is the number of horizontal partitions, V is the number of vertical partitions, A is the number of direction activity partitions, and D is the number of variance partitions.

[0466] 1. The component is divided into several N*N pixel blocks. For a CTU with size M*M, it will be divided into ceil(M / N)*ceil(M / N) pixel blocks.

[0467] 2. The gradient values in horizontal, vertical, 45° and 135° directions of each pixel block are calculated. Here the gradient values can be calculated by Laplacian operator or Sobel operator. According to the four gradient values, the horizontal index H i , the vertical index V i and the direction activity index A i of each pixel in the pixel block are calculated.

[0468] 3. The variance value of each pixel block is calculated. According to the variance value, the variance partition index D i of each pixel in the pixel block is calculated.

[0469] 4. The class of each pixel in the pixel block is calculated according to the horizontal index H i , the vertical index V i , the direction activity index A i and the variance partition index D i . The calculation formula is: classIdx=D i *H*V*A+A i *H*V+H i *V+V i

[0470] Second, according to the class information of each pixel and the quantization parameter, the corresponding filter coefficient is selected, and each pixel of the component before ALF filtering is filtered. It is to be noted that there are totally totalFilterSetNum filter sets, and each filter set has totalFilterNum fixed filters, where totalFilterNum≤totalClassNum. The filtering times of the fixed filter is filterTimes.

[0471] 1. The class of each pixel in the pixel block is determined according to the class of each pixel. It is to be noted that there are totalFilterSetNum filter sets, and each filter set has totalFilterNum fixed filters, where totalFilterNum≤totalClassNum. The filtering times of the fixed filter is filterTimes.

[0472] 2. Determine the used fixed filter set according to the quantization parameter of the current frame image. Let the quantization parameter of the current frame image be qp, then the filter set class that can be used is filterSetIdxVec = MapSet(qp), where MapSet(*) is a mapping table. It should be noted that filterSetIdxVec is a vector, indicating the fixed filter set available for the frame.

[0473] 3. Filter each pixel. In the fixed filter set filterSetIdx of the available fixed filter set vector filterSetIdxVec, according to the used fixed filter class filterIdx of each pixel, the corresponding fixed filter coefficient is selected, each pixel is filtered filterTimes times according to the fixed filter filtering times filterTimes, the compensation value of each pixel of each filtering is obtained, and is stored in the corresponding storage space.

[0474] Third step, obtain the best fixed filter set index and filtering times of the current frame image. Calculate the CCALF fixed filter output to calculate the corresponding rate distortion cost (RDCost), select the minimum cost of the fixed filter filtering rate distortion cost, mark the cost as cost1, and record the corresponding fixed filter set index filterSetIdx0 and fixed filtering times filterTimeIdx0.

[0475] Fourth step, calculate the covariance matrix and error vector of each pixel. Here, the covariance matrix A is a 32x32 square matrix, and each element of the matrix A is denoted as a i,j , i, j ∈ [0, 1, 2, …, 28, 29, 30, 31], for a i,j , the value is: a i,j = R(i) * R(j)

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

[0477] Where recY(*), resiY(*) and offsetC(*) have been introduced before, and will not be repeated here. x corresponds to the position of x in the filter shape, and i is the pixel at the non-x position.

[0478] For the error vector B, it is a 32x1 vector. The obtaining method is similar to that in ECM.

[0479] Step 5, calculate the new filter coefficients of the current frame image. According to the calculated covariance matrix and error vector, construct the Wiener-Hopf equation and solve the filter coefficients. It should be noted that the number of new filter coefficients solved for each category is related to filterSetIdxVec and filterTimes, and each filterSetIdx in filterSetIdxVec will calculate a set of new filters. Each time filtering will also calculate a set of new filters.

[0480] Step 6, obtain the best new filter filtering of the component of the current frame image and the corresponding filterSetIdx1 and filterTimeIdx1. According to the new filter calculated in step 5, calculate the rate-distortion cost under each set of new filters, and select the set of new filters with the minimum rate-distortion cost as the filter coefficients of the new filter of the current frame image, and record its rate-distortion cost as cost2. And record the corresponding fixed filter set index filterSetIdx1 and fixed filter time filterTimeIdx1.

[0481] Step 7, calculate the best filtering cost cost3 when the component uses the new filter trained by the same chroma component of the previous frame image, and record the corresponding fixed filter set index filterSetIdx2 and fixed filter time filterTimeIdx2. If cost2<cost3, the component of the current frame image uses the new filter trained by the current frame image using CCALF; otherwise, the component of the current frame image uses the new filter trained by the same chroma component of the previous frame image using CCALF. Record the smaller value of cost2 and cost3 as cost4. And record the corresponding fixed filter set index filterSetIdx3 and fixed filter time filterTimeIdx3.

[0482] Step 8, compare cost1 and cost4, if cost1<cost4, the component of the current frame image only uses the fixed filter of CCALF for filtering, and sets the filter mode flag ccalfFilterMode to 0; otherwise, use the new filter trained by the current frame image or the new filter trained by the previous frame image for filtering, and set the filter mode flag ccalfFilterMode to 1. Record the smaller value of cost1 and cost4 as cost5. And record the corresponding fixed filter set index filterSetIdx4 and fixed filter time filterTimeIdx4.

[0483] In the ninth step, the rate-distortion cost cost6 of the component without using the CCALF filter is calculated. If cost5<cost6, the component of the current frame image is filtered using the CCALF filter (fixed filter or new filter). The CCALF filter flag is set to 1. Otherwise, the component of the current frame image is not filtered using the CCALF filter, and the CCALF filter flag is set to 0.

[0484] In the tenth step, if the chroma component of the current frame image needs to be filtered, and the chroma component of the current frame image is filtered using only the CCALF fixed filter, the corresponding fixed filter is used to filter the component according to the corresponding fixed filter set index and fixed filter number. If the chroma component of the current frame image needs to be filtered using the new filter trained in the current frame image or the new filter trained in the previous frame image, the corresponding fixed filter is used to filter the component according to the corresponding fixed filter set index and fixed filter number, and then the corresponding new filter coefficient is selected to filter the component of the current frame image for the second time. After filtering the pixel that needs to be filtered, it is written into the reconstructed image. For the pixel that does not need to be filtered, it is directly written into the reconstructed image.

[0485] In the eleventh step, if the chroma component of the current frame image is filtered using the CCALF filter, the filter mode flag ccalfFilterMode, the fixed filter set index filterSetIdx4, and the fixed filter number filterTimeIdx4 are written into the bitstream. If the chroma component of the current frame image is filtered using the new filter trained in the current frame image or the new filter trained in the same chroma component of the previous frame image, information such as whether each CTU uses the CCALF filter and the filter category used by the CTU is written into the bitstream. If the chroma component of the current frame image is filtered using the new filter trained in the current frame image, the filter set number and filter coefficient are written into the bitstream. Finally, the bitstream is transmitted to the decoding end.

[0486] In terms of the syntax semantic layer in the ECM, in the embodiment of the present application, the maximum filter number is 2, and the fixed filter set number of a frame image is 2.

[0487] slice header

[0488] coding tree unit

[0489] alf_data

[0490] wherein,

[0491] sh_alf_cc_cb_filter_mode_idx indicates the filter mode of CCALF for chroma U component, binary variable. When it is equal to 0, it means that the chroma U component is filtered only by CCALF fixed filter; when it is equal to 1, it means that the chroma U component is filtered by new filter of current frame image or previous frame image of current frame image.

[0492] sh_alf_cc_cr_filter_mode_idx indicates the filter mode of CCALF for chroma V component, binary variable. When it is equal to 0, it means that the chroma V component is filtered only by CCALF fixed filter; when it is equal to 1, it means that the chroma V component is filtered by new filter of current frame image or previous frame image of current frame image.

[0493] sh_alf_cc_cb_fixed_filter_set_idx indicates the index of CCALF fixed filter set for chroma U component. Because there are 2 sets of filter available, it is a binary variable. When it is equal to 1, it means that the chroma U component is filtered by CCALF fixed filter set 1; when it is equal to 0, it means that the chroma U component is filtered by CCALF fixed filter set 0.

[0494] sh_alf_cc_cr_fixed_filter_set_idx indicates the index of CCALF fixed filter set for chroma V component. Because there are 2 sets of filter available, it is a binary variable. When it is equal to 1, it means that the chroma V component is filtered by CCALF fixed filter set 1; when it is equal to 0, it means that the chroma V component is filtered by CCALF fixed filter set 0.

[0495] sh_alf_cc_cb_fixed_filter_time_idx indicates the number of times of using CCALF fixed filter for chroma U component. Because the maximum number of times is set to 2, it is a binary variable. When it is equal to 1, it means that the chroma U component is filtered by CCALF fixed filter twice; when it is equal to 0, it means that the chroma U component is filtered by CCALF fixed filter once.

[0496] sh_alf_cc_cr_fixed_filter_time_idx indicates the number of times of using CCALF fixed filter for chroma V component. Because the maximum number of times is set to 2, it is a binary variable. When it is equal to 1, it means that the chroma V component is filtered by CCALF fixed filter twice; when it is equal to 0, it means that the chroma V component is filtered by CCALF fixed filter once.

[0497] At the decoding side:

[0498] For parsing process:

[0499] • Parse slice header information

[0500] 1. Parse the syntax element sh_alf_cc_cb_enabled_flag. If the value of the syntax element sh_alf_cc_cb_enabled_flag is 1, it means that the CCALF filter is used for the chroma U component of the current slice. If the value of the syntax element sh_alf_cc_cb_enabled_flag is 0, it means that the CCALF filter is not used for the chroma U component of the current slice, and then other CCALF syntax elements related to the chroma U component are not parsed.

[0501] 2. If the value of the syntax element sh_alf_cc_cb_enabled_flag is 1, parse the syntax elements sh_alf_cc_cb_filter_mode_idx, sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx. If the value of the syntax element sh_alf_cc_cb_filter_mode_idx is 1, it means that the new CCALF filter is used for the chroma U component of the current slice. If the value of the syntax element sh_alf_cc_cb_filter_mode_idx is 0, it means that the fixed CCALF filter is used for the chroma U component of the current slice. If the value of the syntax element sh_alf_cc_cb_fixed_filter_set_idx is 1, it means that the fixed CCALF filter set 1 is used for the chroma U component of the current slice. If the value of the syntax element sh_alf_cc_cb_fixed_filter_set_idx is 0, it means that the fixed CCALF filter set 0 is used for the chroma U component of the current slice. If the value of the syntax element sh_alf_cc_cb_fixed_filter_time_idx is 1, it means that the fixed CCALF filter is used for the chroma U component of the current slice twice. If the value of the syntax element sh_alf_cc_cb_fixed_filter_time_idx is 0, it means that the fixed CCALF filter is used for the chroma U component of the current slice once.

[0502] 3. If the value of the syntax element sh_alf_cc_cb_filter_mode_idx is 1, parse the syntax element sh_alf_cc_cb_aps_id. The syntax element sh_alf_cc_cb_aps_id represents the index of the APS unit used for the chroma U component of the current slice.

[0503] 4. Parse the syntax element sh_alf_cc_cr_enabled_flag. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, it means that the current slice uses the CCALF filter for the chroma V component. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 0, it means that the current slice does not use the CCALF filter for the chroma V component, and then no other syntax elements related to the CCALF for the chroma V component are parsed.

[0504] 5. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, parse the syntax elements sh_alf_cc_cr_filter_mode_idx, sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it means that the current slice uses the new CCALF filter for the chroma V component. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, it means that the current slice uses the fixed CCALF filter for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_set_idx is equal to 1, it means that the current slice uses the fixed CCALF filter set 1 for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_set_idx is equal to 0, it means that the current slice uses the fixed CCALF filter set 0 for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_time_idx is equal to 1, it means that the current slice uses the fixed CCALF filter twice for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_time_idx is equal to 0, it means that the current slice uses the fixed CCALF filter once for the chroma V component.

[0505] 6. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, parse the syntax element sh_alf_cc_cr_aps_id. The syntax element sh_alf_cc_cr_aps_id indicates the APS unit index used by the current slice for the chroma V component.

[0506] • Parse APS information

[0507] 1. Parse the syntax element alf_cc_cb_filter_signal_flag. If the syntax element takes the value 1, it means that the parsed APS contains new filter coefficients for the CCALF of the chroma U component; if it takes the value 0, it means that the parsed APS does not contain new filter coefficients for the CCALF of the chroma U component, and then the information related to the new filter coefficients for the CCALF of the chroma U component is not parsed.

[0508] 2. If the syntax element alf_cc_cb_filter_signal_flag takes the value 1, the new filter coefficients for the CCALF of the chroma U component are parsed. At this time, 32 filter coefficients are parsed for each new filter.

[0509] 3. Parse the syntax element alf_cc_cr_filter_signal_flag. If the syntax element takes the value 1, it means that the parsed APS contains new filter coefficients for the CCALF of the chroma V component; if it takes the value 0, it means that the parsed APS does not contain new filter coefficients for the CCALF of the chroma V component, and then the information related to the new filter coefficients for the CCALF of the chroma V component is not parsed.

[0510] 4. If the syntax element alf_cc_cr_filter_signal_flag takes the value 1, the new filter coefficients for the CCALF of the chroma V component are parsed. At this time, 32 filter coefficients are parsed for each new filter.

[0511] • Parse the CTU information

[0512] 1. If the syntax element sh_alf_cc_cb_enabled_flag and the syntax element sh_alf_cc_cb_filter_mode_idx both take the value 1, parse the syntax element alf_ctb_cc_cb_idc. The syntax element alf_ctb_cc_cb_idc represents the category of the new filter used for filtering the chroma U component of each ctu.

[0513] 2. If the syntax element sh_alf_cc_cr_enabled_flag and the syntax element sh_alf_cc_cr_filter_mode_idx both take the value 1, parse the syntax element alf_ctb_cc_cr_idc. The syntax element alf_ctb_cc_cr_idc represents the category of the new filter used for filtering the chroma V component of each ctu.

[0514] For the decoding process:

[0515] • If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, the current slice chroma U component is filtered using CCALF.

[0516] ■The category information of each pixel to be filtered in the current slice chroma U component is calculated. The calculation process is described in the above implementation.

[0517] ■The fixed filter set index filterSetIdx and the filter time filterTimeIdx used by the current slice chroma U component are determined according to the syntax elements sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx.

[0518] ■According to the category of each pixel in the current slice chroma U component, the corresponding fixed filter index in the filterSetIdx fixed filter set is selected, the filterTimeIdx fixed filter is filtered, and the output result is stored in the corresponding storage space.

[0519] ■If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0, it means that the current slice chroma U component is only filtered using the fixed filter. At this time, the filtered result of the fixed filter is processed and output to the reconstructed image.

[0520] ■If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, it means that the current slice chroma U component is filtered using the new filter.

[0521] ◆The APS unit used by the current slice chroma U component is selected according to the syntax element sh_alf_cc_cb_aps_id, and the CCALF new filter coefficients of the U component in the APS unit are obtained.

[0522] ◆The new filter filter index used by each ctb chroma U component is determined according to the syntax element alf_ctb_cc_cb_idc, and the corresponding new filter coefficients are selected.

[0523] ◆The output information of the fixed filter is input into the new filter, the pixel to be filtered is filtered, and the filtered result output by the new filter is output to the reconstructed image.

[0524] • If the syntax element sh_alf_cc_cb_enabled_flag is equal to 0, the current slice chroma U component is not filtered using CCALF.

[0525] If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, the current slice chroma V component is filtered using CCALF.

[0526] ■The category information of each pixel to be filtered in the current slice chroma V component is calculated. The calculation process is described in the above implementation mode.

[0527] ■The fixed filter set index filterSetIdx and the filter time filterTimeIdx used by the current slice chroma V component are determined according to the syntax elements sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx.

[0528] ■According to the category of each pixel in the current slice chroma V component, the corresponding fixed filter index in the filterSetIdx fixed filter set is selected, the filterTimeIdx fixed filter is filtered, and the output result is stored in the corresponding storage space.

[0529] ■If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, it means that the current slice chroma V component is only filtered using the fixed filter. At this time, the filtered result output by the fixed filter is processed and output to the reconstructed image.

[0530] ■If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it means that the current slice chroma V component is filtered using a new filter.

[0531] ◆The APS unit used by the current slice chroma V component is selected according to the syntax element sh_alf_cc_cr_aps_id, and the CCALF new filter coefficients of the V component in the APS unit are obtained.

[0532] ◆The new filter filter index used by each ctb chroma V component is determined according to the syntax element alf_ctb_cc_cr_idc, and the corresponding new filter coefficients are selected.

[0533] ◆The output information of the fixed filter is input into the new filter, the pixel to be filtered is filtered, and the filtered result output by the new filter is output to the reconstructed image.

[0534] If the syntax element sh_alf_cc_cr_enabled_flag is equal to 0, the current slice chroma V component is not filtered using CCALF.

[0535] Implementation mode two

[0536] At the encoding end:

[0537] In the cost calculation of the third step, each CTU can select a fixed filter set in filterSetIdxVec for filtering, or can select no filtering. Compared with implementation mode one, the cost of calculating the fixed filter at the CTU level here is more accurate.

[0538] In the tenth step, if the color component of the current frame image is filtered using the CCALF filter, the filter mode flag ccalfFilterMode is written into the code stream. If the color component of the current frame image is filtered using the new filter trained from the current frame image or the same color component of the previous frame image, the fixed filter set index filterSetIdx4, the fixed filter time filterTimeIdx4, whether each CTU uses the CCALF filter, and the filter category used by the CTU are written into the code stream. If the color component of the current frame image is filtered using only the fixed filter, whether each CTU uses the CCALF fixed filter, the fixed filter set filterSetIdx4, and the fixed filter time filterTimeIdx4 are written into the code stream. If the color component of the current frame image is filtered using the new filter trained from the current frame image, the filter set number and the filter coefficient are written into the code stream. Finally, the code stream is transmitted to the decoding end.

[0539] For the syntax semantic level in the ECM, in the embodiment of the present application, the maximum filter time is 2, and the fixed filter set number is 16 for one frame image.

[0540] slice header

[0541] coding tree unit

[0542] alf_data

[0543] When only the fixed filter is used, alf_ctb_cc_cb_idc and alf_ctb_cc_cr_idc are reused in the coding tree unit process, and when only the fixed filter is used, the syntax element encodes the fixed filter set index used by each CTU. When the new filter is used, the syntax element encodes the new filter category used by each CTU.

[0544] alf_ctb_cc_cb_time is the number of times CCALF fixed filter is applied to CTU chroma U component. Since the maximum number of times is set to 2, it is a binary variable. Value 1 means that CCALF fixed filter is applied twice to CTU chroma U component; value 0 means that CCALF fixed filter is applied once to CTU chroma U component.

[0545] alf_ctb_cc_cr_time is the number of times CCALF fixed filter is applied to CTU chroma V component. Since the maximum number of times is set to 2, it is a binary variable. Value 1 means that CCALF fixed filter is applied twice to CTU chroma V component; value 0 means that CCALF fixed filter is applied once to CTU chroma V component.

[0546] At the decoding side:

[0547] For the parsing process:

[0548] • Parse slice header information

[0549] 1. Parse syntax element sh_alf_cc_cb_enabled_flag. If the value of this syntax element is 1, it means that CCALF filter is applied to the chroma U component of the current slice. If the value is 0, it means that CCALF filter is not applied to the chroma U component of the current slice, and then no other CCALF syntax elements related to the chroma U component are parsed.

[0550] 2. If the value of syntax element sh_alf_cc_cb_enabled_flag is 1, parse syntax element sh_alf_cc_cb_filter_mode_idx. If the value of syntax element sh_alf_cc_cb_filter_mode_idx is 1, it means that the new CCALF filter is applied to the chroma U component of the current slice. If the value is 0, it means that the CCALF fixed filter is applied to the chroma U component of the current slice.

[0551] 3. If sh_alf_cc_cb_filter_mode_idx is equal to 1, parse syntax elements sh_alf_cc_cb_aps_id, sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx. Syntax element sh_alf_cc_cb_aps_id indicates the APS entry index used by the current slice for the chroma U component. If sh_alf_cc_cb_fixed_filter_set_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter set 1 for the chroma U component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter set 0 for the chroma U component. If sh_alf_cc_cb_fixed_filter_time_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter for 2 times filtering for the chroma U component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter for 1 time filtering for the chroma U component.

[0552] 4. Parse syntax element sh_alf_cc_cr_enabled_flag. If it is equal to 1, it indicates that the current slice uses CCALF filter for the chroma V component. If it is equal to 0, it indicates that the current slice does not use CCALF filter for the chroma V component, and then no other chroma V component related CCALF syntax elements are parsed.

[0553] 5. If sh_alf_cc_cr_enabled_flag is equal to 1, parse syntax element sh_alf_cc_cr_filter_mode_idx. If sh_alf_cc_cr_filter_mode_idx is equal to 1, it indicates that the current slice uses CCALF new filter for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter for the chroma V component.

[0554] 6. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, parse the syntax elements sh_alf_cc_cr_aps_id, sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx. The syntax element sh_alf_cc_cr_aps_id indicates the APS entry index used by the current slice for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_set_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter set 1 for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter set 0 for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_time_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter for 2 times for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter for 1 time for the chroma V component.

[0555] • Parse APS information

[0556] 1. Parse the syntax element alf_cc_cb_filter_signal_flag. If the syntax element is equal to 1, it indicates that the parsed APS contains new CCALF filter coefficients for the chroma U component. If it is equal to 0, it indicates that the parsed APS does not contain new CCALF filter coefficients for the chroma U component, and no further information related to new CCALF filter coefficients for the chroma U component is parsed.

[0557] 2. If the syntax element alf_cc_cb_filter_signal_flag is equal to 1, new CCALF filter coefficients for the chroma U component are parsed. 32 filter coefficients are parsed for each new filter.

[0558] 3. Parse the syntax element alf_cc_cr_filter_signal_flag. If the syntax element is equal to 1, it indicates that the parsed APS contains new CCALF filter coefficients for the chroma V component. If it is equal to 0, it indicates that the parsed APS does not contain new CCALF filter coefficients for the chroma V component, and no further information related to new CCALF filter coefficients for the chroma V component is parsed.

[0559] 4. If the syntax element alf_cc_cr_filter_signal_flag is equal to 1, the chroma V component CCALF new filter coefficients will be parsed. Each new filter needs to parse 32 filter coefficients.

[0560] • Parse CTU information

[0561] 1. If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, the syntax element alf_ctb_cc_cb_idc is parsed. When the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, the syntax element alf_ctb_cc_cb_idc indicates the category of new filter used for each CTU chroma U component. When the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0, the syntax element alf_ctb_cc_cb_idc indicates the index of fixed filter group used for each CTU chroma U component. If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0 and the current slice current CTU chroma U component alf_ctb_cc_cb_idc is not equal to 0, the syntax element alf_ctb_cc_cb_time is parsed. If the syntax alf_ctb_cc_cb_time is equal to 1, it indicates that the current slice chroma U component is filtered twice using CCALF fixed filter. If it is equal to 0, it indicates that the current slice chroma U component is filtered once using CCALF fixed filter.

[0562] 2. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, parse the syntax element alf_ctb_cc_cr_idc. When the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, the syntax element alf_ctb_cc_cr_idc indicates the category of each CTU chroma V component using new filter filtering. When the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, the syntax element alf_ctb_cc_cr_idc indicates the index of each CTU chroma V component using fixed filter filtering group. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, and the current slice current CTU chroma V component alf_ctb_cc_cr_idc is not equal to 0, parse the syntax element alf_ctb_cc_cr_time. If the syntax element alf_ctb_cc_cr_time is equal to 1, it indicates that the current slice the chroma V component uses CCALF fixed filter for 2 times filtering. If it is equal to 0, it indicates that the current slice the chroma V component uses CCALF fixed filter for 1 time filtering.

[0563] For decoding process:

[0564] If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, the current slice chroma U component uses CCALF filtering.

[0565] Calculate the category information of each pixel to be filtered of the current slice chroma U component. The calculation process is described in the above implementation.

[0566] If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0, it indicates that the current slice chroma U component only uses fixed filter for filtering.

[0567] Determine the index of fixed filter group filterSetIdx (when the filterSetIdx of CTU is equal to 0, the CTU chroma U component is not filtered) and the number of filtering filterTimeIdx of each CTU chroma U component of the current slice according to the syntax elements alf_ctb_cc_cb_idc and sh_alf_cc_cb_fixed_filter_time_idx.

[0568] According to the category of each pixel of the current slice chroma U component, the corresponding fixed filter index in the filterSetIdx fixed filter set is selected, filterTimeIdx fixed filter filtering is performed, and the output result is processed and output to the reconstructed image.

[0569] ■If the syntax element sh_alf_cc_cb_filter_mode_idx takes the value 1, it indicates that the current slice chroma U component uses the new filter for filtering.

[0570] According to the syntax elements sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx, the fixed filter set index filterSetIdx and the filtering number filterTimeIdx used by the current slice chroma U component are determined.

[0571] According to the category of each pixel of the current slice chroma U component, the corresponding fixed filter index in the filterSetIdx fixed filter set is selected, filterTimeIdx fixed filter filtering is performed, and the output result is stored in the corresponding storage space.

[0572] According to the syntax element sh_alf_cc_cb_aps_id, the APS unit used by the current slice chroma U component is selected, and the CCALF new filter coefficients of the U component in the APS unit are obtained.

[0573] According to the syntax element alf_ctb_cc_cb_idc, the new filter filtering index used by each ctb chroma U component is determined, and the corresponding new filter coefficients are selected.

[0574] The output information of the fixed filter is input into the new filter, the to-be-filtered pixel is filtered, and the filtering result output by the new filter is output to the reconstructed image.

[0575] If the syntax element sh_alf_cc_cb_enabled_flag takes the value 0, the current slice chroma U component does not use CCALF for filtering.

[0576] If the syntax element sh_alf_cc_cr_enabled_flag takes the value 1, the current slice chroma V component will use CCALF filtering.

[0577] The category information of each to-be-filtered pixel of the current slice chroma V component is calculated. The calculation process has been described in the above implementation manner.

[0578] ■ If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, it means that the current slice chroma V component is filtered only by fixed filter.

[0579] ◆ The fixed filter set index filterSetIdx and the filter time filterTimeIdx used by each CTU chroma V component in the current slice are determined according to the syntax elements alf_ctb_cc_cr_idc and sh_alf_cc_cr_fixed_filter_time_idx. (When the filterSetIdx of a CTU is equal to 0, the chroma V component of the CTU is not filtered.)

[0580] ◆ The corresponding fixed filter index in the filterSetIdx fixed filter set is selected according to the category of each pixel of the chroma V component of each CTU in the current slice, and the filterTimeIdx fixed filter is filtered. The output result is processed and output to the reconstructed image.

[0581] ■ If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it means that the current slice chroma V component is filtered by new filter.

[0582] ◆ The fixed filter set index filterSetIdx and the filter time filterTimeIdx used by the chroma V component in the current slice are determined according to the syntax elements sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx.

[0583] ◆ The corresponding fixed filter index in the filterSetIdx fixed filter set is selected according to the category of each pixel of the chroma V component in the current slice, and the filterTimeIdx fixed filter is filtered. The output result is stored in the corresponding storage space.

[0584] ◆ The APS unit used by the chroma V component in the current slice is selected according to the syntax element sh_alf_cc_cr_aps_id, and the CCALF new filter coefficients of the V component in the APS unit are obtained.

[0585] ◆ The new filter filter index used by each CTU chroma V component is determined according to the syntax element alf_ctb_cc_cr_idc, and the corresponding new filter coefficients are selected.

[0586] ◆ The output information of the fixed filter is input into the new filter to filter the to-be-filtered pixels, and the filtering result output by the new filter is output to the reconstructed image.

[0587] If the syntax element sh alf cc cr enabled flag is equal to 0, the current slice chroma V component is not filtered using CCALF.

[0588] Implementation mode three

[0589] Compared with the implementation mode one, the steps are changed from the third step as follows:

[0590] Third step, the optimal fixed filter set index and filtering times of each CTU are obtained. In the CTU unit, the rate-distortion cost when the CTU is not filtered and the rate-distortion cost when the CTU is filtered by the fixed filter set in filterSetIdxVec and filterTimes times are compared to determine whether the CTU is filtered by the fixed filter and the corresponding fixed filter set filterSetIdx and filtering times filterTimeIdx. Then the rate-distortion cost (RDCost) after the CCALF fixed filter filtering is calculated, and the cost of the minimum rate-distortion cost after the fixed filter filtering is recorded as cost1.

[0591] Fourth step, the covariance matrix and error vector of each pixel are calculated. Here, the covariance matrix A is a 27x27 square matrix, and each element of the matrix A is denoted as a i,j , i, j ∈ [0, 1, 2, …, 25, 26], and for a i,j , the value is: a i,j = R(i) * R(j)

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

[0593] Wherein, recY(*) and resiY(*) have been introduced before, and will not be repeated here. x corresponds to the position of x in the filter shape, and i is the pixel at the non-x position.

[0594] For the error vector B, it is a 27x1 vector. The obtaining method is similar to that in the ECM.

[0595] Fifth step, the new filter coefficient of the current frame image is calculated. The Wiener-Hopf equation is constructed according to the calculated covariance matrix and error vector, and the filtering coefficient is solved.

[0596] Step 6, obtain the best new filter of the component of the current frame image. According to the new filter calculated in step 5, calculate the rate-distortion cost of each new filter, select the new filter group with the minimum rate-distortion cost as the filter coefficient of the new filter of the current frame image, and record its rate-distortion cost as cost2.

[0597] Step 7, calculate the best filtering cost cost3 when the component is filtered using the new filter trained by the same chroma component of the previous frame image. If cost2<cost3, the component of the current frame image is filtered using the new filter trained by the current frame image of CCALF; otherwise, the component of the current frame image is filtered using the new filter trained by the same chroma component of the previous frame image of CCALF. Record the smaller value of cost2 and cost3 as cost4.

[0598] Step 8, compare cost1 and cost4. If cost1<cost4, the component of the current frame image is filtered only using the fixed filter of CCALF, and the filter mode flag ccalfFilterMode is set to 0; otherwise, the component is filtered using the new filter trained by the current frame image or the new filter trained by the previous frame image, and the filter mode flag ccalfFilterMode is set to 1. Record the smaller value of cost1 and cost4 as cost5.

[0599] Step 9, calculate the rate-distortion cost cost6 of the component without using the CCALF filter. If cost5<cost6, the component of the current frame image is filtered using the CCALF filter (fixed filter or new filter); the CCALF filter flag is set to 1; otherwise, the component of the current frame image is not filtered using the CCALF filter, and the CCALF filter flag is set to 0.

[0600] Step 10, if the chroma component of the current frame image needs to be filtered, and the chroma component of the current frame image is filtered only using the fixed filter of CCALF, filter the component using the corresponding fixed filter according to the corresponding fixed filter group index and the fixed filter number. If the chroma component of the current frame image needs to be filtered using the new filter trained by the current frame image or the new filter trained by the previous frame image, filter the component of the current frame image according to the corresponding new filter coefficient. After filtering the pixels that need to be filtered, write them into the reconstructed image. For the pixels that do not need to be filtered, directly write them into the reconstructed image.

[0601] In the tenth step, if the chroma component of the current frame image is filtered by the CCALF filter, the filter mode flag ccalfFilterMode is written into the bitstream. If the chroma component of the current frame image is filtered by the new filter trained by the current frame image or the same chroma component of the previous frame image, information such as whether each CTU uses the CCALF filter and the filter category used by the CTU is written into the bitstream. If the chroma component of the current frame image is filtered by the new filter trained by the current frame image, the filter set number and filter coefficients are written into the bitstream. If the current frame image is filtered only by the CCALF fixed filter, the fixed filter set index filterSetIdx and the fixed filter time filterTimeIdx used by each CTU are written into the bitstream. Finally, the bitstream is transmitted to the decoding end.

[0602] In terms of the syntax semantic level in the ECM, in the embodiments of the present application, the maximum filter time is 2, and the fixed filter set number is 16 for a frame image.

[0603] slice header

[0604] coding tree unit

[0605] At the decoding end:

[0606] For the parsing process:

[0607] Parsing the slice header information

[0608] 1. Parsing the syntax element sh alf cc cb enabled flag. If the syntax element sh alf cc cb enabled flag takes the value 1, it indicates that the chroma U component of the current slice is filtered by the CCALF filter. If the value is 0, it indicates that the chroma U component of the current slice is not filtered by the CCALF filter, and other chroma U component related CCALF syntax elements are not parsed.

[0609] 2. If the syntax element sh alf cc cb enabled flag takes the value 1, the syntax element sh alf cc cb filter mode idx is parsed. If the syntax element sh alf cc cb filter mode idx takes the value 1, it indicates that the chroma U component of the current slice is filtered by the CCALF new filter. If the value is 0, it indicates that the chroma U component of the current slice is filtered by the CCALF fixed filter.

[0610] 3. If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, parse the syntax element sh_alf_cc_cb_aps_id. The syntax element sh_alf_cc_cb_aps_id indicates the APS entry index used by the current slice for the chroma U component.

[0611] 4. Parse the syntax element sh_alf_cc_cr_enabled_flag. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, it indicates that the current slice uses the CCALF filter for the chroma V component. If it is equal to 0, it indicates that the current slice does not use the CCALF filter for the chroma V component, and no other chroma V component related CCALF syntax elements are parsed.

[0612] 5. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, parse the syntax element sh_alf_cc_cr_filter_mode_idx. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it indicates that the current slice uses the new CCALF filter for the chroma V component. If it is equal to 0, it indicates that the current slice uses the fixed CCALF filter for the chroma V component.

[0613] 6. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, parse the syntax element sh_alf_cc_cr_aps_id. The syntax element sh_alf_cc_cr_aps_id indicates the APS entry index used by the current slice for the chroma V component.

[0614] • Parse the CTU information

[0615] ■If the syntax element sh_alf_cc_cb_enabled_flag has the value of 1, the syntax element alf_ctb_cc_cb_idc is parsed. When the syntax element sh_alf_cc_cb_filter_mode_idx has the value of 1, the syntax element alf_ctb_cc_cb_idc indicates the category of the new filter used for each ctu chroma U component. When the syntax element sh_alf_cc_cb_filter_mode_idx has the value of 0, the syntax element alf_ctb_cc_cb_idc indicates the index of the fixed filter filter set used for each CTU chroma U component. If the syntax element sh_alf_cc_cb_filter_mode_idx has the value of 0, and the current slice current CTU chroma U component alf_ctb_cc_cb_idc has the value of not 0, the syntax element alf_ctb_cc_cb_time is parsed. If the syntax element alf_ctb_cc_cb_time has the value of 1, it indicates that the current slice said chroma U component is filtered twice using the CCALF fixed filter. If it has the value of 0, it indicates that the current slice said chroma U component is filtered once using the CCALF fixed filter.

[0616] ■If the syntax element sh_alf_cc_cr_enabled_flag has the value of 1, the syntax element alf_ctb_cc_cr_idc is parsed. When the syntax element sh_alf_cc_cr_filter_mode_idx has the value of 1, the syntax element alf_ctb_cc_cr_idc indicates the category of the new filter used for each ctu chroma V component. When the syntax element sh_alf_cc_cr_filter_mode_idx has the value of 0, the syntax element alf_ctb_cc_cr_idc indicates the index of the fixed filter filter set used for each ctu chroma V component. If the syntax element sh_alf_cc_cr_filter_mode_idx has the value of 0, and the current slice current CTU chroma V component alf_ctb_cc_cr_idc has the value of not 0, the syntax element alf_ctb_cc_cr_time is parsed. If the syntax element alf_ctb_cc_cr_time has the value of 1, it indicates that the current slice said chroma V component is filtered twice using the CCALF fixed filter. If it has the value of 0, it indicates that the current slice said chroma V component is filtered once using the CCALF fixed filter.

[0617] For the decoding process:

[0618] If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, the current slice chroma U component is filtered using CCALF.

[0619] If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0, it means that the current slice chroma U component is filtered using only fixed filters.

[0620] The category information of each pixel to be filtered in the current slice chroma U component is calculated. The calculation process is described in the above implementation mode.

[0621] The fixed filter set index filterSetIdx (when filterSetIdx of the CTU is equal to 0, the CTU chroma U component is not filtered) and the filter time filterTimeIdx used by the current slice chroma U component of each CTU are determined according to the syntax elements alf_ctb_cc_cb_idc and alf_ctb_cc_cb_time.

[0622] According to the category of each pixel in the current slice chroma U component of each CTU, the corresponding fixed filter index in the filterSetIdx fixed filter set is selected, and the filterTimeIdx fixed filter is filtered. The output result is processed and output to the reconstructed image.

[0623] If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, it means that the current slice chroma U component is filtered using a new filter.

[0624] The APS unit used by the current slice chroma U component is selected according to the syntax element sh_alf_cc_cb_aps_id, and the CCALF new filter coefficients of the U component in the APS unit are obtained.

[0625] The new filter filter index used by each CTU chroma U component is determined according to the syntax element alf_ctb_cc_cb_idc, and the corresponding new filter coefficients are selected.

[0626] The pixels to be filtered are filtered, and the filtered results output by the new filter are output to the reconstructed image.

[0627] If the syntax element sh_alf_cc_cb_enabled_flag is equal to 0, the current slice chroma U component is not filtered using CCALF.

[0628] If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, the current slice chroma V component is filtered using CCALF.

[0629] If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, it means that the current slice chroma V component is filtered using only fixed filters.

[0630] The category information of each pixel to be filtered in the current slice chroma V component is calculated. The calculation process is described in the above implementation manner.

[0631] The fixed filter set index filterSetIdx (when filterSetIdx of a CTU is equal to 0, the CTU chroma V component is not filtered) and the filter time filterTimeIdx used by the current slice chroma V component of each CTU are determined according to the syntax elements alf_ctb_cc_cr_idc and alf_ctb_cc_cr_time.

[0632] The corresponding fixed filter index in the filterSetIdx fixed filter set is selected according to the category of each pixel in the current slice chroma V component of each CTU, and the filterTimeIdx fixed filter is filtered, and the output result is processed and output to the reconstructed image.

[0633] If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it means that the current slice chroma V component is filtered using a new filter.

[0634] The APS unit used by the current slice chroma V component is selected according to the syntax element sh_alf_cc_cr_aps_id, and the CCALF new filter coefficients of the V component in the APS unit are obtained.

[0635] The new filter filter index used by each CTU chroma V component is determined according to the syntax element alf_ctb_cc_cr_idc, and the corresponding new filter coefficients are selected.

[0636] The filtered pixels are filtered, and the filtered results output by the new filter are output to the reconstructed image.

[0637] If the syntax element sh_alf_cc_cr_enabled_flag is equal to 0, the current slice chroma V component is not filtered using CCALF.

[0638] Implementation manner four

[0639] At the encoding end:

[0640] The fixed filter class division does not use the form of gradient calculation, but is determined according to the position of the pixel or the position of the CTU. The first step in the corresponding implementation mode one becomes:

[0641] First, the class information of all pixels of the component before ALF filtering is calculated. There are totalClassNum classes in total.

[0642] 1. The component is divided into a plurality of N×N pixel blocks. For a CTU with a size of M×M, it will be divided into ceil(M / N)×ceil(M / N) pixel blocks

[0643] 2. According to the position (x, y) of each pixel block, the class classIdx of each pixel block is obtained, where classIdx=F((x, y)), F(*) is a mapping function of the pixel block position.

[0644] Implementation mode five

[0645] At the encoding end:

[0646] The output of the fixed filter is only used as the input of the new filter, and is not output to the reconstructed image as the CCALF filtering result. Then the difference from the implementation mode one is:

[0647] Since the fixed filter output does not need to be output to the reconstructed image, the third step and the eighth step are not needed.

[0648] Step ten, if the color component of the current frame image needs to be filtered, the corresponding fixed filter set index and the fixed filter number are used to filter the component using the corresponding fixed filter, and then the corresponding new filter coefficient is selected to filter the component of the current frame image. After filtering the pixels that need to be filtered, they are written into the reconstructed image. For pixels that do not need to be filtered, they are directly written into the reconstructed image.

[0649] Step eleven, if the color component of the current frame image is filtered using the CCALF filter, the fixed filter set index filterSetIdx and the fixed filter number filterTimeIdx are written into the bitstream, and information such as whether each CTU uses the CCALF filter and the filter class used by the CTU. If the color component of the current frame image is filtered using the new filter trained by the current frame image, the filter set number and the filter coefficient information need to be written into the bitstream. Finally, the bitstream is transmitted to the decoding end.

[0650] For the syntax semantic layer in the ECM, in the embodiments of the present application, the maximum filter number is 2, and the fixed filter set of a frame image is taken as an example.

[0651] slice header

[0652] alf_data

[0653] At the decoding side:

[0654] For the parsing process:

[0655] • Parse the slice header information

[0656] 1. Parse the syntax element sh_alf_cc_cb_enabled_flag. If the syntax element takes the value of 1, it means that the chroma U component of the current slice uses the CCALF filter for filtering. If the value is 0, it means that the chroma U component of the current slice does not use the CCALF filter for filtering, and then other chroma U component related CCALF syntax elements are not parsed.

[0657] 2. If the syntax element sh_alf_cc_cb_enabled_flag takes the value of 1, parse the syntax elements sh_alf_cc_cb_aps_id, sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx. The syntax element sh_alf_cc_cb_aps_id represents the APS unit index used by the chroma U component of the current slice. If the syntax element sh_alf_cc_cb_fixed_filter_set_idx takes the value of 1, it means that the chroma U component of the current slice uses the CCALF fixed filter set 1 for filtering. If the value is 0, it means that the chroma U component of the current slice uses the CCALF fixed filter set 0 for filtering. If the syntax element sh_alf_cc_cb_fixed_filter_time_idx takes the value of 1, it means that the chroma U component of the current slice uses the CCALF fixed filter for 2 times of filtering. If the value is 0, it means that the chroma U component of the current slice uses the CCALF fixed filter for 1 time of filtering.

[0658] 3. Parse the syntax element sh_alf_cc_cr_enabled_flag. If the syntax element takes the value of 1, it means that the chroma V component of the current slice uses the CCALF filter for filtering. If the value is 0, it means that the chroma V component of the current slice does not use the CCALF filter for filtering, and then other chroma V component related CCALF syntax elements are not parsed.

[0659] 4. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, parse the syntax elements sh_alf_cc_cr_aps_id, sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx. The syntax element sh_alf_cc_cr_aps_id indicates the APS unit index used by the current slice for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_set_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter set 1 for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter set 0 for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_time_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter for 2 times for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter for 1 time for the chroma V component.

[0660] • Parse APS information

[0661] 1. Parse the syntax element alf_cc_cb_filter_signal_flag. If it is equal to 1, it indicates that the parsed APS contains new filter coefficients for the chroma U component. If it is equal to 0, it indicates that the parsed APS does not contain new filter coefficients for the chroma U component, and no further information for the chroma U component is parsed.

[0662] 2. If the syntax element alf_cc_cb_filter_signal_flag is equal to 1, the parsing of new filter coefficients for the chroma U component continues. 32 filter coefficients are parsed for each new filter.

[0663] 3. Parse the syntax element alf_cc_cr_filter_signal_flag. If it is equal to 1, it indicates that the parsed APS contains new filter coefficients for the chroma V component. If it is equal to 0, it indicates that the parsed APS does not contain new filter coefficients for the chroma V component, and no further information for the chroma V component is parsed.

[0664] 4. If the syntax element alf_cc_cr_filter_signal_flag is equal to 1, the chroma V component CCALF new filter coefficients will be parsed. Each new filter needs to parse 32 filter coefficients.

[0665] For decoding process:

[0666] • If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, the current slice chroma U component will be filtered using CCALF.

[0667] Calculate the category information of each pixel to be filtered in the current slice chroma U component. The calculation process has been described in the above implementation.

[0668] Determine the fixed filter set index filterSetIdx and the filter time filterTimeIdx to be used in the current slice chroma U component according to the syntax elements sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx.

[0669] Select the corresponding fixed filter index in the filterSetIdx fixed filter set according to the category of each pixel in the current slice chroma U component, perform filterTimeIdx fixed filter filtering, and store the output result in the corresponding storage space.

[0670] Select the APS unit used in the current slice chroma U component according to the syntax element sh_alf_cc_cb_aps_id, and obtain the CCALF new filter coefficients of the U component in the APS unit.

[0671] Determine the new filter filtering index used in each ctb chroma U component according to the syntax element alf_ctb_cc_cb_idc, and select the corresponding new filter coefficients.

[0672] Input the output information of the fixed filter into the new filter, filter the pixel to be filtered, and output the filtering result of the new filter to the reconstructed image.

[0673] • If the syntax element sh_alf_cc_cb_enabled_flag is equal to 0, the current slice chroma U component will not be filtered using CCALF.

[0674] • If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, the current slice chroma V component will be filtered using CCALF.

[0675] ■Calculate the category information of each pixel to be filtered in the current slice chroma V component. The calculation process has been described in the above implementation mode.

[0676] ■Determine the fixed filter set index filterSetIdx and the filter time filterTimeIdx to be used by the current slice chroma V component according to the syntax elements sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx.

[0677] ■Select the corresponding fixed filter index in the filterSetIdx fixed filter set according to the category of each pixel in the current slice chroma V component, perform filterTimeIdx fixed filter filtering, and store the output result in the corresponding storage space.

[0678] ■Select the APS unit used by the current slice chroma V component according to the syntax element sh_alf_cc_cr_aps_id, and obtain the new filter coefficients of the V component in the APS unit.

[0679] ■Determine the new filter filtering index used by each ctb chroma V component according to the syntax element alf_ctb_cc_cr_idc, and select the corresponding new filter coefficients.

[0680] ■Input the output information of the fixed filter into the new filter, filter the pixel to be filtered, and output the filtering result output by the new filter to the reconstructed image.

[0681] If the syntax element sh_alf_cc_cr_enabled_flag takes the value 0, the current slice chroma V component does not use CCALF for filtering.

[0682] Implementation mode six

[0683] At the encoding end:

[0684] In the third step of cost calculation, each CTU can select the fixed filter set in filterSetIdxVec for filtering, or can select not to filter. Compared with the first implementation mode, the cost of the fixed filter is calculated at the CTU level here, which is more accurate.

[0685] The tenth step corresponds to the following: if the chroma component of the current frame image is filtered using the CCALF filter, the filter mode flag ccalfFilterMode is written into the bitstream. If the chroma component of the current frame image is filtered using the new filter trained from the current frame image or the same chroma component of the previous frame image, the fixed filter set index filterSetIdx4, the fixed filter time filterTimeIdx4, whether each CTU uses the CCALF filter, and the filter category used by the CTU are written into the bitstream. If the chroma component of the current frame image is filtered using only the fixed filter, the information such as whether each CTU uses the CCALF fixed filter, the fixed filter set filterSetIdx4, and the fixed filter time filterTimeIdx4 is written into the bitstream. If the chroma component of the current frame image is filtered using the new filter trained from the current frame image, the filter set number and the filter coefficient are written into the bitstream. Finally, the bitstream is transmitted to the decoding end.

[0686] For the syntax semantic level in the ECM, in the embodiments of the present application, the maximum filter time is 2, and the fixed filter set number is 16 for a frame image.

[0687] slice header

[0688] coding tree unit

[0689] alf_data

[0690] When only the fixed filter is used, the new syntax elements alf_ctb_cc_cb_fixed_filter_idc and alf_ctb_cc_cr_fixed_filter_idc are used in the coding tree unit process,

[0691] When only fixed filter is used, the alf_ctb_cc_cb_fixed_filter_idc syntax element encodes the case that the fixed filter used by each CTU chroma U component, alf_ctb_cc_cb_fixed_filter_idc equal to 0 means that the CTU chroma U component is not filtered by fixed filter, otherwise the filter set with index alf_ctb_cc_cb_fixed_filter_idc-1 is used to filter the CTU chroma U component; the alf_ctb_cc_cr_fixed_filter_idc syntax element encodes the case that the fixed filter used by each CTU chroma V component, alf_ctb_cc_cr_fixed_filter_idc equal to 0 means that the CTU chroma V component is not filtered by fixed filter, otherwise the filter set with index alf_ctb_cc_cr_fixed_filter_idc-1 is used to filter the CTU chroma V component.

[0692] At the decoding side:

[0693] For parsing process:

[0694] • Parse slice header information

[0695] 1. Parse the syntax element sh_alf_cc_cb_enabled_flag, if the syntax element takes value 1, it means that the CCALF filter is used for the chroma U component of the current slice. If the value is 0, it means that the CCALF filter is not used for the chroma U component of the current slice, then other chroma U component related CCALF syntax elements are not parsed.

[0696] 2. If the syntax element sh_alf_cc_cb_enabled_flag takes value 1, parse the syntax element sh_alf_cc_cb_filter_mode_idx. If the syntax element sh_alf_cc_cb_filter_mode_idx takes value 1, it means that the new CCALF filter is used for the chroma U component of the current slice. If the value is 0, it means that the fixed CCALF filter is used for the chroma U component of the current slice.

[0697] 3. If sh_alf_cc_cb_filter_mode_idx is equal to 1, parse syntax elements sh_alf_cc_cb_aps_id, sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx. sh_alf_cc_cb_aps_id specifies the APS entry index used by the current slice for the chroma U component. If sh_alf_cc_cb_fixed_filter_set_idx is equal to 1, it specifies that the current slice uses CCALF fixed filter set 1 for the chroma U component. If it is equal to 0, it specifies that the current slice uses CCALF fixed filter set 0 for the chroma U component. If sh_alf_cc_cb_fixed_filter_time_idx is equal to 1, it specifies that the current slice uses CCALF fixed filter for 2 times for the chroma U component. If it is equal to 0, it specifies that the current slice uses CCALF fixed filter for 1 time for the chroma U component.

[0698] 4. Parse sh_alf_cc_cr_enabled_flag. If sh_alf_cc_cr_enabled_flag is equal to 1, it specifies that the current slice uses CCALF filter for the chroma V component. If it is equal to 0, it specifies that the current slice does not use CCALF filter for the chroma V component. Then, no other chroma V component related CCALF syntax elements are parsed.

[0699] 5. If sh_alf_cc_cr_enabled_flag is equal to 1, parse sh_alf_cc_cr_filter_mode_idx. If sh_alf_cc_cr_filter_mode_idx is equal to 1, it specifies that the current slice uses CCALF new filter for the chroma V component. If it is equal to 0, it specifies that the current slice uses CCALF fixed filter for the chroma V component.

[0700] 6. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, parse the syntax elements sh_alf_cc_cr_aps_id, sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx. The syntax element sh_alf_cc_cr_aps_id indicates the APS entry index used by the current slice for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_set_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter set 1 for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter set 0 for the chroma V component. If the syntax element sh_alf_cc_cr_fixed_filter_time_idx is equal to 1, it indicates that the current slice uses CCALF fixed filter for 2 times for the chroma V component. If it is equal to 0, it indicates that the current slice uses CCALF fixed filter for 1 time for the chroma V component.

[0701] • Parse APS information

[0702] 1. Parse the syntax element alf_cc_cb_filter_signal_flag. If it is equal to 1, it indicates that the parsed APS contains new CCALF filter coefficients for the chroma U component. If it is equal to 0, it indicates that the parsed APS does not contain new CCALF filter coefficients for the chroma U component, and no further information for new CCALF filter coefficients for the chroma U component is parsed.

[0703] 2. If the syntax element alf_cc_cb_filter_signal_flag is equal to 1, new CCALF filter coefficients for the chroma U component are parsed. 32 filter coefficients are parsed for each new filter.

[0704] 3. Parse the syntax element alf_cc_cr_filter_signal_flag. If it is equal to 1, it indicates that the parsed APS contains new CCALF filter coefficients for the chroma V component. If it is equal to 0, it indicates that the parsed APS does not contain new CCALF filter coefficients for the chroma V component, and no further information for new CCALF filter coefficients for the chroma V component is parsed.

[0705] 4. If the syntax element alf_cc_cr_filter_signal_flag is equal to 1, the chroma V component CCALF new filter coefficients will be parsed. Each new filter needs to parse 32 filter coefficients.

[0706] • Parsing CTU information

[0707] 1. When the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, if the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, the syntax element alf_ctb_cc_cb_idc is parsed. The syntax element alf_ctb_cc_cb_idc indicates the category of the new filter used for each CTU chroma U component. When the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0, the syntax element alf_ctb_cc_cb_fixed_filter_idc is parsed. The syntax element alf_ctb_cc_cb_fixed_filter_idc indicates the index of the fixed filter set used for each CTU chroma U component. If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0 and the current slice current CTU chroma U component alf_ctb_cc_cb_fixed_filter_idc is not equal to 0, the syntax element alf_ctb_cc_cb_time is parsed. If the syntax alf_ctb_cc_cb_time is equal to 1, it indicates that the current slice the chroma U component is filtered twice using the CCALF fixed filter. If it is equal to 0, it indicates that the current slice the chroma U component is filtered once using the CCALF fixed filter.

[0708] 2. When sh_alf_cc_cr_enabled_flag is equal to 1, if sh_alf_cc_cr_filter_mode_idx is equal to 1, then alf_ctb_cc_cr_idc is parsed. alf_ctb_cc_cr_idc indicates the category of each CTU chroma V component using new filter. When sh_alf_cc_cr_filter_mode_idx is equal to 0, then alf_ctb_cc_cr_fixed_filter_idc is parsed. alf_ctb_cc_cr_fixed_filter_idc indicates the index of each CTU chroma V component using fixed filter set. If sh_alf_cc_cr_filter_mode_idx is equal to 0, and alf_ctb_cc_cr_fixed_filter_idc is not equal to 0 for the current slice and the current CTU chroma V component, then alf_ctb_cc_cr_time is parsed. If alf_ctb_cc_cr_time is equal to 1, then it indicates that the current slice chroma V component is filtered twice using CCALF fixed filter. If it is equal to 0, then it indicates that the current slice chroma V component is filtered once using CCALF fixed filter.

[0709] For decoding process:

[0710] If sh_alf_cc_cb_enabled_flag is equal to 1, then the current slice chroma U component is filtered using CCALF.

[0711] The category information of each pixel to be filtered for the current slice chroma U component is calculated. The calculation process is described in the above implementation.

[0712] If sh_alf_cc_cb_filter_mode_idx is equal to 0, then it indicates that the current slice chroma U component is filtered using only fixed filter.

[0713] The index of fixed filter set filterSetIdx (when filterSetIdx = 0 for a CTU, then the CTU chroma U component is not filtered) and the number of filtering filterTimeIdx for each CTU chroma U component of the current slice are determined according to alf_ctb_cc_cb_fixed_filter_idc and sh_alf_cc_cb_fixed_filter_time_idx.

[0714] ◆According to the category of each pixel of the current slice chroma U component, select the corresponding fixed filter index in the filterSetIdx fixed filter set, perform filterTimeIdx fixed filter filtering, and output the output result to the reconstructed image after processing.

[0715] ■If the syntax element sh_alf_cc_cb_filter_mode_idx takes the value 1, it means that the current slice chroma U component uses a new filter for filtering.

[0716] ◆Determine the fixed filter set index filterSetIdx and the number of filters filterTimeIdx that the current slice chroma U component needs to use according to the syntax elements sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx.

[0717] ◆According to the category of each pixel of the current slice chroma U component, select the corresponding fixed filter index in the filterSetIdx fixed filter set, perform filterTimeIdx fixed filter filtering, and store the output result in the corresponding storage space.

[0718] ◆Select the APS unit used by the current slice chroma U component according to the syntax element sh_alf_cc_cb_aps_id, and obtain the CCALF new filter coefficients of the U component in the APS unit.

[0719] ◆Determine the new filter filtering index used by each ctb chroma U component according to the syntax element alf_ctb_cc_cb_idc, and select the corresponding new filter coefficients.

[0720] ◆Input the output information of the fixed filter into the new filter, filter the pixel to be filtered, and output the filtering result of the new filter to the reconstructed image.

[0721] ●If the syntax element sh_alf_cc_cb_enabled_flag takes the value 0, the current slice chroma U component does not use CCALF for filtering.

[0722] ●If the syntax element sh_alf_cc_cr_enabled_flag takes the value 1, the current slice chroma V component will use CCALF filtering.

[0723] ■Calculate the category information of each pixel to be filtered in the current slice chroma V component. The calculation process has been described in the above implementation mode.

[0724] ■If the syntax element sh_alf_cc_cr_filter_mode_idx takes the value of 0, it means that the current slice chroma V component is only filtered using the fixed filter.

[0725] ◆Determine the fixed filter set index filterSetIdx (when the filterSetIdx of the CTU is 0, then the CTU chroma V component is not filtered) and the filtering times filterTimeIdx to be used for each CTU chroma V component of the current slice according to the syntax elements alf_ctb_cc_cr_fixed_filter_idc and sh_alf_cc_cr_fixed_filter_time_idx.

[0726] ◆Select the corresponding fixed filter index in the filterSetIdx fixed filter set according to the category of each pixel of each CTU chroma V component of the current slice, perform filterTimeIdx fixed filter filtering, and output the output results to the reconstructed image after processing.

[0727] ■If the syntax element sh_alf_cc_cr_filter_mode_idx takes the value of 1, it means that the current slice chroma V component is filtered using the new filter.

[0728] ◆Determine the fixed filter set index filterSetIdx and the filtering times filterTimeIdx to be used for the current slice chroma V component according to the syntax elements sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx.

[0729] ◆Select the corresponding fixed filter index in the filterSetIdx fixed filter set according to the category of each pixel of the current slice chroma V component, perform filterTimeIdx fixed filter filtering, and store the output results in the corresponding storage space.

[0730] ◆Select the APS unit to be used for the current slice chroma V component according to the syntax element sh_alf_cc_cr_aps_id, and obtain the CCALF new filter coefficients of the V component in the APS unit.

[0731] ◆ The syntax element alf_ctb_cc_cr_idc is used to determine the new filter filter index used by each CTU chroma V component, and the corresponding new filter coefficient is selected.

[0732] ◆ The output information of the fixed filter is input into the new filter, and the to-be-filtered pixel is filtered, and the filtering result output by the new filter is output to the reconstructed image.

[0733] If the syntax element sh_alf_cc_cr_enabled_flag is 0, the current slice chroma V component is not filtered using CCALF.

[0734] Implementation seven

[0735] At the encoding end:

[0736] The tenth step becomes: if the current frame image chroma component is filtered using the CCALF filter, the filter mode flag ccalfFilterMode is written into the code stream. If the current frame image chroma component is filtered using the new filter trained by the current frame image or the same chroma component of the previous frame image, the fixed filter set index filterSetIdx4 and the fixed filter time filterTimeIdx4, whether each CTU uses the CCALF filter, and the filter type used by the CTU are written into the code stream. If the current frame image chroma component is only filtered using the fixed filter, the fixed filter set filterSetIdx4 and the fixed filter time filterTimeIdx4 used by the current frame image component, and whether each CTU uses the CCALF fixed filter are written into the code stream. If the current frame image chroma component is filtered using the new filter trained by the current frame image, the filter set number and filter coefficient information are written into the code stream. Finally, the code stream is transmitted to the decoding end.

[0737] If the maximum size of filterSetIdxVec is set to 1, filterSetIdx can not be written into the code stream; if the maximum value of filterTimes is set to 1, filterTimeIdx can not be written into the code stream.

[0738] Taking the syntax semantic level in the ECM as an example, in the embodiments of the present application, the maximum filter time is 2, and the fixed filter set available for a frame image is 16.

[0739] slice header

[0740] coding tree unit

[0741] alf_data

[0742] Wherein, only using fixed filter, in the coding tree unit process will use new syntax element alf_ctb_cc_cb_fixed_filter_flag and alf_ctb_cc_cr_fixed_filter_flag,

[0743] When only using fixed filter, alf_ctb_cc_cb_fixed_filter_flag syntax element encodes the case of using fixed filter for each CTU chroma U component, when alf_ctb_cc_cb_fixed_filter_flag is equal to 0, it indicates that the CTU chroma U component does not use fixed filter filtering, otherwise, it uses fixed filter filtering; alf_ctb_cc_cr_fixed_filter_flag syntax element encodes the case of using fixed filter for each CTU chroma V component, when alf_ctb_cc_cr_fixed_filter_idc is equal to 0, it indicates that the CTU chroma V component does not use fixed filter filtering, otherwise, it uses fixed filter filtering.

[0744] At the decoding end:

[0745] For parsing process:

[0746] Parsing slice header information

[0747] 1. Parsing syntax element sh_alf_cc_cb_enabled_flag, if the syntax element takes value 1, it indicates that the current slice chroma U component uses CCALF filter for filtering. If the value is 0, it indicates that the current slice chroma U component does not use CCALF filter for filtering, then other chroma U component related CCALF syntax elements are not parsed.

[0748] 2. If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, parse the syntax elements sh_alf_cc_cb_filter_mode_idx, sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx. If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, it means that the chroma U component of the current slice is filtered using the CCALF new filter. If it is equal to 0, it means that the chroma U component of the current slice is filtered using the CCALF fixed filter. If the syntax element sh_alf_cc_cb_fixed_filter_set_idx is equal to 1, it means that the chroma U component of the current slice is filtered using the CCALF fixed filter set 1. If it is equal to 0, it means that the chroma U component of the current slice is filtered using the CCALF fixed filter set 0. If the syntax element sh_alf_cc_cb_fixed_filter_time_idx is equal to 1, it means that the chroma U component of the current slice is filtered twice using the CCALF fixed filter. If it is equal to 0, it means that the chroma U component of the current slice is filtered once using the CCALF fixed filter.

[0749] 3. If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, parse the syntax element sh_alf_cc_cb_aps_id. The syntax element sh_alf_cc_cb_aps_id indicates the APS unit index used by the chroma U component of the current slice.

[0750] 4. Parse the syntax element sh_alf_cc_cr_enabled_flag. If it is equal to 1, it means that the chroma V component of the current slice is filtered using the CCALF filter. If it is equal to 0, it means that the chroma V component of the current slice is not filtered using the CCALF filter, then no other chroma V component related CCALF syntax elements are parsed.

[0751] 5. If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, parse the syntax elements sh_alf_cc_cr_filter_mode_idx, sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it means that the chroma V component of the current slice is filtered using the CCALF new filter. If it is equal to 0, it means that the chroma V component of the current slice is filtered using the CCALF fixed filter. If the syntax element sh_alf_cc_cr_fixed_filter_set_idx is equal to 1, it means that the chroma V component of the current slice is filtered using the CCALF fixed filter set 1. If it is equal to 0, it means that the chroma V component of the current slice is filtered using the CCALF fixed filter set 0. If the syntax element sh_alf_cc_cr_fixed_filter_time_idx is equal to 1, it means that the chroma V component of the current slice is filtered twice using the CCALF fixed filter. If it is equal to 0, it means that the chroma V component of the current slice is filtered once using the CCALF fixed filter.

[0752] 6. If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, parse the syntax element sh_alf_cc_cr_aps_id.

[0753] The syntax element sh_alf_cc_cr_aps_id indicates the APS unit index used by the chroma V component of the current slice.

[0754] • Parse APS information

[0755] 1. Parse the syntax element alf_cc_cb_filter_signal_flag. If the syntax element is equal to 1, it means that the parsed APS contains the CCALF new filter coefficients for the chroma U component. If it is equal to 0, it means that the parsed APS does not contain the CCALF new filter coefficients for the chroma U component, and no further information related to the CCALF new filter coefficients for the chroma U component is parsed.

[0756] 2. If the syntax element alf_cc_cb_filter_signal_flag is equal to 1, the parsing of the CCALF new filter coefficients for the chroma U component continues. At this time, 32 filter coefficients are parsed for each new filter.

[0757] 3. Parse the syntax element alf_cc_cr_filter_signal_flag. If the syntax element takes the value of 1, it means that the parsed APS contains new filter coefficients for CCALF of the chroma V component; if the syntax element takes the value of 0, it means that the parsed APS does not contain new filter coefficients for CCALF of the chroma V component, and then the information related to new filter coefficients for CCALF of the chroma V component is not parsed.

[0758] 4. If the syntax element alf_cc_cr_filter_signal_flag takes the value of 1, the new filter coefficients for CCALF of the chroma V component are parsed. At this time, 32 filter coefficients are parsed for each new filter.

[0759] • Parse the CTU information

[0760] 1. When the syntax element sh_alf_cc_cb_enabled_flag takes the value of 1, if the syntax element sh_alf_cc_cb_filter_mode_idx takes the value of 1, the syntax element alf_ctb_cc_cb_idc is parsed. The syntax element alf_ctb_cc_cb_idc represents the category of the new filter used for filtering of each ctu chroma U component; if the syntax element sh_alf_cc_cb_filter_mode_idx takes the value of 0, the syntax element alf_ctb_cc_cb_fixed_filter_flag is parsed. The syntax element alf_ctb_cc_cb_fixed_filter_flag represents whether the fixed filter is used for filtering of each ctu chroma U component.

[0761] 2. When the syntax element sh_alf_cc_cr_enabled_flag takes the value of 1, if the syntax element sh_alf_cc_cr_filter_mode_idx takes the value of 1, the syntax element alf_ctb_cc_cr_idc is parsed. The syntax element alf_ctb_cc_cr_idc represents the category of the new filter used for filtering of each ctu chroma V component; if the syntax element sh_alf_cc_cr_filter_mode_idx takes the value of 0, the syntax element alf_ctb_cc_cr_fixed_filter_flag is parsed. The syntax element alf_ctb_cc_cr_fixed_filter_flag represents whether the fixed filter is used for filtering of each ctu chroma V component.

[0762] For the decoding process:

[0763] If the syntax element sh_alf_cc_cb_enabled_flag is equal to 1, the current slice chroma U component is filtered using CCALF.

[0764] ■The category information of each pixel to be filtered in the current slice chroma U component is calculated. The calculation process is described in the above implementation mode.

[0765] ■The fixed filter set index filterSetIdx and the filter time filterTimeIdx used by the current slice chroma U component are determined according to the syntax elements sh_alf_cc_cb_fixed_filter_set_idx and sh_alf_cc_cb_fixed_filter_time_idx.

[0766] ■If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 0, the current slice chroma U component is filtered only using the fixed filter.

[0767] According to the syntax element alf_ctb_cc_cb_fixed_filter_flag, each ctu chroma U component is filtered using the fixed filter, and the corresponding fixed filter set is selected according to the fixed filter set index filterSetIdx and the filter time filterTimeIdx. The filtered results output by the fixed filter are processed and then output to the reconstructed image.

[0768] ■If the syntax element sh_alf_cc_cb_filter_mode_idx is equal to 1, the current slice chroma U component is filtered using the new filter.

[0769] According to the syntax element sh_alf_cc_cb_aps_id, the APS unit used by the current slice chroma U component is selected, and the CCALF new filter coefficients of the U component in the APS unit are obtained.

[0770] According to the syntax element alf_ctb_cc_cb_idc, the new filter filter index used by each ctu chroma U component is determined, and the corresponding new filter coefficients are selected.

[0771] The output information of the fixed filter is input into the new filter, the pixel to be filtered is filtered, and the filtered results output by the new filter are output to the reconstructed image.

[0772] If the syntax element sh_alf_cc_cb_enabled_flag is equal to 0, the current slice chroma U component is not filtered using CCALF.

[0773] If the syntax element sh_alf_cc_cr_enabled_flag is equal to 1, the current slice chroma V component is filtered using CCALF.

[0774] Calculate the category information of each pixel to be filtered in the current slice chroma V component. The calculation process has been described in the above implementation mode.

[0775] Determine the fixed filter set index filterSetIdx and the filter time filterTimeIdx used by the current slice chroma V component according to the syntax elements sh_alf_cc_cr_fixed_filter_set_idx and sh_alf_cc_cr_fixed_filter_time_idx.

[0776] Select the corresponding fixed filter index in the filterSetIdx fixed filter set according to the category of each pixel in the current slice chroma V component, perform filterTimeIdx fixed filter filtering, and store the output result in the corresponding storage space.

[0777] If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 0, it means that the current slice chroma V component is only filtered using a fixed filter.

[0778] According to the syntax element alf_ctb_cc_cr_fixed_filter_flag, each ctb chroma V component is filtered using a fixed filter, and the corresponding fixed filter set is selected according to the fixed filter set index filterSetIdx and the filter time filterTimeIdx. The filtered result output by the fixed filter is processed and then output to the reconstructed image.

[0779] If the syntax element sh_alf_cc_cr_filter_mode_idx is equal to 1, it means that the current slice chroma V component is filtered using a new filter.

[0780] According to the syntax element sh_alf_cc_cr_aps_id, the APS unit used by the current slice chroma V component is selected, and the CCALF new filter coefficients of the V component in the APS unit are obtained.

[0781] According to the syntax element alf_ctb_cc_cr_idc, the new filter filtering index of each ctb chroma V component is determined, and the corresponding new filter coefficients are selected.

[0782] The output information of the fixed filter is input into a new filter, and the pixels to be filtered are filtered, and the filtering result output by the new filter is output to the reconstructed image.

[0783] If the syntax element sh alf cc cr enabled flag is 0, the current slice chroma V component is not filtered using CCALF

[0784] In summary, the coding method proposed in the embodiments of the present application is a CCALF filter optimization technology. The fixed filter technology is introduced for CCALF, which breaks the constraint that different sequences of similar texture pixels need to be encoded with multiple filters, so that the pixels with similar texture can use the same filter for filtering, saving the bits spent on transmission, so that the CCALF can achieve better performance.

[0785] That is, the coding method proposed in the embodiments of the present application includes a filter optimization method. In the CCALF filtering process, a CCALF fixed filter is introduced to filter the pixels to be filtered. The fixed filter can input multiple information to improve the filtering accuracy. In addition, the output of the fixed filter can be directly output to the reconstructed image, or can be input to a new filter, thereby improving the performance of the new filter. Better code rate and performance can be obtained.

[0786] The embodiments of the present application provide a coding method, which can introduce a first filtering implemented by a fixed filter to filter pixels with similar texture. The first filtering coefficient used when the first filtering is performed is a preset constant value that does not need to be coded, so that the first filtering performed on the pixels with similar texture by the fixed filter can greatly reduce the code word cost while ensuring the filtering effect, thereby improving the coding performance.

[0787] In another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, referring to FIG. 10, a constituent structure diagram of an encoder 210 proposed in the embodiments of the present application is shown. As shown in FIG. 10, the encoder 210 can include a first determination unit 2101; wherein,

[0788] The first determination unit 2101 is configured to determine a first generation value corresponding to execution of first filtering, determine a second generation value corresponding to execution of second filtering, and determine a third generation value corresponding to execution of the first filtering and the second filtering; wherein the first filtering is used to determine a first chroma sample correction value according to a first reconstructed value of a luminance component and a first filtering coefficient, the second filtering is used to determine a second chroma sample correction value according to a second reconstructed value of the luminance component and a second filtering coefficient, the first filtering coefficient includes a preset constant value, and the second filtering coefficient is determined based on APS; first filtering identification information and second filtering identification information are determined according to the first generation value, the second generation value, and the third generation value; wherein the first filtering identification information is used to determine whether to execute the first filtering, and the second filtering identification is used to determine whether to execute the second filtering; the first chroma sample correction value and / or the second chroma sample correction value are determined by filtering according to the first filtering identification information and the second filtering identification information; and a reconstructed value after filtering is determined according to the first chroma sample correction value and / or the second chroma sample correction value.

[0789] It should be noted that in the embodiments of the present application, the encoder 210 can also be regarded as a data processing mode (or "entropy encoder") for encoding processing the values of the syntax elements to be encoded.

[0790] It can be understood that in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in a processing unit, or can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0791] The integrated unit, if realized in the form of a software function module and not sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0792] Therefore, the embodiment of the present application provides a computer readable storage medium applied to the encoder 210, the computer readable storage medium stores a computer program, and the computer program is executed by the first processor to implement the encoding method in any one of the foregoing embodiments.

[0793] Based on the composition of the encoder 210 and the computer readable storage medium, referring to FIG. 11, a specific hardware structure schematic diagram of the encoder 210 provided by the embodiment of the present application is shown. As shown in FIG. 11, the encoder 210 can include a first communication interface 2102, a first memory 2103 and a first processor 2104; and the various components are coupled together through a first bus system 2105. It can be understood that the first bus system 2105 is used to realize the connection communication between the components. The first bus system 2105 includes not only a data bus, but also a power supply bus, a control bus and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the first bus system 2105 in the figure. Among them,

[0794] The first communication interface 2102 is configured to receive and send signals in the information transceiving process between the other external network elements;

[0795] The first memory 2103 is configured to store a computer program capable of running on the first processor 2104;

[0796] The first processor 2104 is configured to, when running the computer program, perform the following steps: determining a first generation value corresponding to the execution of the first filtering; determining a second generation value corresponding to the execution of the second filtering; determining a third generation value corresponding to the execution of the first filtering and the second filtering; wherein the first filtering is configured to determine a first chroma sample correction value according to a first reconstructed value of a luminance component and a first filtering coefficient, the second filtering is configured to determine a second chroma sample correction value according to a second reconstructed value of the luminance component and a second filtering coefficient, the first filtering coefficient includes a preset constant value, and the second filtering coefficient is determined based on APS; determining first filtering identification information and second filtering identification information according to the first generation value, the second generation value and the third generation value; wherein the first filtering identification information is configured to determine whether to execute the first filtering, and the second filtering identification is configured to determine whether to execute the second filtering; performing filtering according to the first filtering identification information and the second filtering identification information to determine the first chroma sample correction value and / or the second chroma sample correction value; and determining a reconstructed value after filtering according to the first chroma sample correction value and / or the second chroma sample correction value.

[0797] It is to be appreciated that the first memory 2103 in the embodiments of the application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Where the nonvolatile memory is a Read-Only Memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically EPROM (EEPROM), or flash memory. The volatile memory can be a Random Access Memory (RAM), which is used as an external cache. By way of example, and not limitation, many forms of RAM are available, for example, Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 2103 of the system and method described herein are intended to include, without being limited to, these and any other suitable types of memory.

[0798] The first processor 2104 can be an integrated circuit chip, which has the processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the first processor 2104. The first processor 2104 described above can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as hardware code processor execution completion, or executed by hardware and software module combination in code processor. The software module can be located in random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, register and other mature storage medium in the art. The storage medium is located in the first memory 2103, and the first processor 2104 reads the information in the first memory 2103, and combines the hardware to complete the steps of the above method.

[0799] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or their combination. For hardware implementation, the processing unit can be realized in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for executing functions described in the present application or their combination. For software implementation, the technology described in the present application can be realized by modules (such as processes, functions, etc.) for executing functions described in the present application. The software code can be stored in the memory and executed by the processor. The memory can be implemented in the processor or outside the processor.

[0800] Optionally, as another embodiment, the first processor 2104 is further configured to, when running the computer program, perform the encoding method in any one of the preceding embodiments.

[0801] The embodiment provides an encoder, and a first filtering implemented through a fixed filter can be introduced to filter pixels with similar textures, wherein a first filtering coefficient used when the first filtering is performed is a preset constant value which does not need to be coded, and therefore, the first filtering performed through the fixed filter on the pixels with similar textures can greatly reduce code word overhead while guaranteeing filtering effect, and improves coding performance.

[0802] In another embodiment of the present application, based on the same inventive concept of the preceding embodiments, referring to FIG. 12, a structural diagram of a decoder 230 proposed in the embodiment of the present application is shown. As shown in FIG. 12, the decoder 230 can include a second determining unit 2301; wherein,

[0803] The second determining unit 2301 is configured to determine first filtering identification information and second filtering identification information; wherein the first filtering identification information is used to determine whether the first filtering is performed, and the second filtering identification is used to determine whether the second filtering is performed; the first filtering is used to determine a first chroma sample correction value according to at least a first reconstructed value of a luminance component and a first filtering coefficient, and the second filtering is used to determine a second chroma sample correction value according to at least a second reconstructed value of the luminance component and a second filtering coefficient; the first filtering coefficient includes a preset constant value, and the second filtering coefficient is determined based on APS; filtering is performed according to the first filtering identification information and the second filtering identification information, to determine the first chroma sample correction value and / or the second chroma sample correction value; and a reconstructed value after filtering is determined according to the first chroma sample correction value and / or the second chroma sample correction value.

[0804] It should be noted that in the embodiment of the present application, the decoder 230 can also be regarded as a data processing mode (or an "entropy decoder") for decoding processing the value of a to-be-decoded syntax element.

[0805] It can be understood that in the embodiment, the "unit" can be a part of circuit, a part of processor, a part of program or software, and of course can be a module, and can also be non-modular. Moreover, the components in the embodiment can be integrated in a processing unit, or can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0806] The integrated unit, if implemented in the form of a software function module and not sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the embodiment provides a computer readable storage medium applied to the decoder 230, the computer readable storage medium stores a computer program, and the computer program is executed by the second processor to implement the method in any one of the preceding embodiments.

[0807] Based on the composition of the decoder 230 and the computer readable storage medium, referring to FIG. 13, a specific hardware structure schematic diagram of the decoder 230 provided by the embodiment of the application is shown. As shown in FIG. 13, the decoder 230 can include a second communication interface 2302, a second memory 2303 and a second processor 2304; each component is coupled together through a second bus system 2305. It can be understood that the second bus system ...

Claims

1. A decoding method applied to a decoder, the method comprising: determining first filter identification information and second filter identification information; wherein the first filter identification information is used to determine whether to perform first filtering, and the second filter identification information is used to determine whether to perform second filtering; the first filtering is used to determine first chroma sample correction values according to at least first reconstructed values of a luma component and first filter coefficients, and the second filtering is used to determine second chroma sample correction values according to at least second reconstructed values of the luma component and second filter coefficients; the first filter coefficients comprise preset constant values, and the second filter coefficients are determined based on an adaptive parameter set (APS); performing filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction values and / or the second chroma sample correction values; and determining filtered reconstructed values according to the first chroma sample correction values and / or the second chroma sample correction values. The performing filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction values and / or the second chroma sample correction values comprises: in a case where the first filter identification information indicates to perform the first filtering and the second filter identification information indicates not to perform the second filtering, determining the first filter coefficients and a number of times of performing the first filtering; performing the first filtering according to the first filter coefficients and the number of times of performing the first filtering to determine the first chroma sample correction values. The determining filtered reconstructed values according to the first chroma sample correction values and / or the second chroma sample correction values comprises: determining the filtered reconstructed values according to the first chroma sample correction values and corresponding pre-filter sample values. The performing filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction values and / or the second chroma sample correction values comprises: in a case where the first filter identification information indicates not to perform the first filtering and the second filter identification information indicates to perform the second filtering, determining the second filter coefficients based on a corresponding APS; performing the second filtering according to the second filter coefficients to determine the second chroma sample correction values.

2. The method of claim 1, wherein, The determining filtered reconstructed values according to the first chroma sample correction values and / or the second chroma sample correction values comprises: determining the filtered reconstructed values according to the second chroma sample correction values and corresponding pre-filter sample values. The performing filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction values and / or the second chroma sample correction values comprises: in a case where the first filter identification information indicates to perform the first filtering and the second filter identification information indicates to perform the second filtering, determining the first filter coefficients and a number of times of performing the first filtering, and determining the second filter coefficients based on a corresponding APS; performing the first filtering according to the first filter coefficients and the number of times of performing the first filtering to determine the first chroma sample correction values; and performing the second filtering according to the second filter coefficients to determine the second chroma sample correction values. ​ ​ ​ 3. The method of claim 1, wherein, ​ ​ ​ ​ ​ 4. The method of claim 1, wherein, ​ ​ ​ determining the second chroma sample correction value according to the first chroma sample correction value and / or the second chroma sample correction value, and determining the filtered reconstruction value, comprises: determining the filtered reconstruction value according to the first chroma sample correction value, the second chroma sample correction value and the sample value before filtering. determining the first filter coefficient and the execution number of the first filter, comprises:

5. The method of claim 2 or 4, wherein, decoding the code stream to determine first syntax element identification information and second syntax element identification information; determining the fixed filter index according to the first syntax element identification information, and determining the first filter coefficient according to the fixed filter index; determining the execution number of the first filter according to the second syntax element identification information. determining the first filter coefficient according to the fixed filter index, comprises:

6. The method of claim 5, wherein, determining the fixed filter group in the candidate filter group according to the fixed filter index; determining the pixel category of the pixel to be filtered, and determining the filter category corresponding to the pixel category of the pixel to be filtered; determining the first filter coefficient corresponding to the pixel to be filtered in the fixed filter group according to the filter category. determining the first filter coefficient and the execution number of the first filter, comprises:

7. The method of claim 2, wherein, decoding the code stream to determine third syntax element identification information and fourth syntax element identification information; determining the fixed filter index corresponding to the current block according to the third syntax element identification information, and determining the first filter coefficient corresponding to the current block according to the fixed filter index corresponding to the current block; determining the execution number of the first filter corresponding to the current block according to the fourth syntax element identification information. determining the first filter coefficient and the execution number of the first filter, comprises: decoding the code stream to determine fifth syntax element identification information and fourth syntax element identification information; 8. The method of claim 2, wherein, in the case of determining that the current block performs the first filter based on the fifth syntax element identification information, determining the fixed filter index corresponding to the current block according to the fifth syntax element identification information, and determining the first filter coefficient corresponding to the current block according to the fixed filter index corresponding to the current block; determining the execution number of the first filter corresponding to the current block according to the fourth syntax element identification information. The method further comprises: decoding the code stream to determine sixth syntax element identification information; 9. The method of claim 2, wherein, in the case of determining that the current block performs the first filter based on the sixth syntax element identification information, performing the first filter on the current block according to the first filter coefficient and the execution number of the first filter, and determining the first chroma sample correction value corresponding to the current block. determining the pixel category of the pixel to be filtered, comprises: determining the horizontal direction index, the vertical direction index and the direction activity index corresponding to the pixel to be filtered according to the gradient parameter of the pixel to be filtered, and determining the variance division index of the pixel to be filtered; 10. The method of claim 6, wherein, determining the pixel category of the pixel to be filtered according to the horizontal direction index, the vertical direction index, the direction activity index and the variance division index. determining the pixel category of the pixel to be filtered, comprises: ​ 11. The method of claim 6, wherein, ​ According to the position information of the to-be-filtered pixel, a pixel category of the to-be-filtered pixel is determined.

12. The method of any one of claims 6, 10, 11, wherein, The method further comprises: determining a quantization parameter; determining the candidate filter set according to the quantization parameter.

13. The method of any one of claims 6, 10, 11, wherein, The method further comprises: determining a quantization parameter and a slice type of a current slice; wherein the slice type comprises an I slice, a B slice, and a P slice; determining the candidate filter set according to the quantization parameter and the slice type.

14. The method of claim 3 or 4, wherein, The method further comprises: decoding a bitstream to determine seventh syntax element identification information; determining an APS index corresponding to the current image according to the seventh syntax element identification information; determining a corresponding APS according to the APS index.

15. The method of claim 14, wherein, The determining of the second filter coefficient based on the APS comprises: decoding a bitstream to determine eighth syntax element identification information; in a case where the eighth syntax element identification information indicates that the second filter coefficient exists in the APS, parsing the APS to determine the second filter coefficient.

16. The method of claim 3 or 4, wherein, The method further comprises: decoding a bitstream to determine third syntax element identification information; determining a filter index of a current block according to the third syntax element identification information, and determining the second filter coefficient corresponding to the current block according to the filter index of the current block.

17. The method of claim 1, wherein, The determining of the first filter identification information and the second filter identification information comprises: decoding a bitstream to determine ninth syntax element identification information; determining the first filter identification information and the second filter identification information according to the ninth syntax element identification information.

18. The method of claim 1, wherein, The determining of the first filter identification information and the second filter identification information comprises: decoding a bitstream to determine tenth syntax element identification information and eleventh syntax element identification information; determining the first filter identification information according to the tenth syntax element identification information, and determining the second filter identification information according to the eleventh syntax element identification information.

19. The method of claim 17, wherein, The determining of the first filter identification information and the second filter identification information according to the ninth syntax element identification information comprises: in a case where the ninth syntax element identification information has a first value, determining that the first filter identification information indicates that first filtering is performed, and determining that the second filter identification information indicates that second filtering is performed; in a case where the ninth syntax element identification information has a second value, determining that the first filter identification information indicates that first filtering is performed, and determining that the second filter identification information indicates that second filtering is not performed. The determining of the first filter identification information and the second filter identification information according to the ninth syntax element identification information comprises:

20. The method of claim 17, wherein, in a case where the ninth syntax element identification information has a first value, determining that the first filter identification information indicates that first filtering is not performed, and determining that the second filter identification information indicates that second filtering is performed; in a case where the ninth syntax element identification information has a second value, determining that the first filter identification information indicates that first filtering is performed, and determining that the second filter identification information indicates that second filtering is not performed. The determining of the first filter identification information according to the tenth syntax element identification information, and the determining of the second filter identification information according to the eleventh syntax element identification information comprise:

21. The method of claim 18, wherein, in a case where the tenth syntax element identification information has a first value, determining that the first filter identification information indicates that first filtering is performed, and determining that the second filter identification information indicates that second filtering is not performed; in a case where the tenth syntax element identification information has a second value, determining that the first filter identification information indicates that first filtering is not performed, and determining that the second filter identification information indicates that second filtering is performed. in a case where the tenth syntax element identification information has a first value and the eleventh syntax element identification information has a first value, it is determined that the first filter identification information indicates performing first filtering and the second filter identification information indicates not performing second filtering; in a case where the tenth syntax element identification information has a second value and the eleventh syntax element identification information has a first value, it is determined that the first filter identification information indicates not performing first filtering and the second filter identification information indicates not performing second filtering; in a case where the tenth syntax element identification information has a first value and the eleventh syntax element identification information has a second value, it is determined that the first filter identification information indicates performing first filtering and the second filter identification information indicates performing second filtering; in a case where the tenth syntax element identification information has a second value and the eleventh syntax element identification information has a second value, it is determined that the first filter identification information indicates not performing first filtering and the second filter identification information indicates performing second filtering.

22. The method of claim 1, wherein, The method further comprises: decoding a bitstream to determine a slice-level syntax element; wherein the slice-level syntax element comprises one or more of the first syntax element identification information, the second syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information, the ninth syntax element identification information, the tenth syntax element identification information and the eleventh syntax element identification information.

23. The method of claim 1, wherein, The method further comprises: decoding a bitstream to determine a picture-level syntax element; wherein the picture-level syntax element comprises one or more of the first syntax element identification information, the second syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information, the ninth syntax element identification information, the tenth syntax element identification information and the eleventh syntax element identification information.

24. The method of claim 1, wherein, The method further comprises: decoding a bitstream to determine a block-level syntax element; wherein the block-level syntax element comprises one or more of the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information and the sixth syntax element identification information.

25. The method of claim 1, wherein the input information of the first filtering further comprises a reconstructed value of a chroma component of the current picture; the input information of the second filtering further comprises a residual value of a luma component of the current picture.

26. An encoding method applied to an encoder, the method comprising: determining a first generation value corresponding to performing first filtering; determining a second generation value corresponding to performing second filtering; determining a third generation value corresponding to performing the first filtering and the second filtering; wherein the first filtering is used to determine a first chroma sample correction value according to a first reconstructed value of a luma component and a first filter coefficient, the second filtering is used to determine a second chroma sample correction value according to a second reconstructed value of the luma component and a second filter coefficient, the first filter coefficient comprises a preset constant value, and the second filter coefficient is determined based on an APS. According to the first generation value, the second generation value and the third generation value, first filter identification information and second filter identification information are determined; wherein the first filter identification information is used to determine whether to perform first filtering, and the second filter identification is used to determine whether to perform second filtering; According to the first filter identification information and the second filter identification information, filtering is performed to determine the first chroma sample correction value and / or the second chroma sample correction value; According to the first chroma sample correction value and / or the second chroma sample correction value, a post-filtering reconstruction value is determined.

27. The method of claim 26, wherein, The first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value, comprising: In the case that the first generation value is greater than the second generation value, and the first generation value is greater than the third generation value, it is determined that the first filter identification information indicates to perform first filtering, and it is determined that the second filter identification information indicates not to perform second filtering; In the case that the second generation value is greater than the first generation value, and the second generation value is greater than the first generation value, it is determined that the first filter identification information indicates not to perform first filtering, and it is determined that the second filter identification information indicates to perform second filtering; In the case that the third generation value is greater than the first generation value, and the third generation value is greater than the second generation value, it is determined that the first filter identification information indicates to perform first filtering, and it is determined that the second filter identification information indicates to perform second filtering.

28. The method of claim 27, wherein, The first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value, comprising: In the case that the first filter identification information indicates to perform first filtering, and the second filter identification information indicates not to perform second filtering, the first filter coefficient and the execution number of first filtering are determined; First filtering is performed according to the first filter coefficient and the execution number of first filtering to determine the first chroma sample correction value; The first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value, comprising: The post-filtering reconstruction value is determined according to the first chroma sample correction value and the corresponding pre-filtering sample value.

29. The method of claim 27, wherein, The first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value, comprising: In the case that the first filter identification information indicates not to perform first filtering, and the second filter identification information indicates to perform second filtering, the second filter coefficient is determined based on APS; Second filtering is performed according to the second filter coefficient to determine the second chroma sample correction value; The first filter identification information and the second filter identification information are determined according to the first generation value, the second generation value and the third generation value, comprising: The post-filtering reconstruction value is determined according to the second chroma sample correction value and the corresponding pre-filtering sample value.

30. The method of claim 27, wherein, The filtering according to the first filter identification information and the second filter identification information, determining the first chroma sample correction value and / or the second chroma sample correction value, comprises: In a case where the first filter identification information indicates performing first filtering and the second filter identification information indicates performing second filtering, determining the first filter coefficient and the execution number of the first filtering, and determining the second filter coefficient based on the APS; Performing first filtering according to the first filter coefficient and the execution number of the first filtering, and determining the first chroma sample correction value; Performing second filtering according to the second filter coefficient based on the first chroma sample correction value, and determining the second chroma sample correction value; The determining the filtered reconstruction value according to the first chroma sample correction value and / or the second chroma sample correction value, comprises: Determining the filtered reconstruction value according to the first chroma sample correction value, the second chroma sample correction value and the sample value before filtering.

31. The method of claim 28 or 30, wherein, The determining the first filter coefficient and the execution number of the first filtering, comprises: Determining the pixel category of the pixel to be filtered, and determining the filter category corresponding to the pixel category of the pixel to be filtered; According to the filter category and the preset filter number, the filter coefficients in the candidate filter group are traversed to determine the generation value of the filter coefficients in the candidate filter group under different filter numbers; According to the generation value of the filter coefficients in the candidate filter group under different filter numbers, the first filter coefficient and the execution number of the first filtering are determined.

32. The method of claim 31, wherein, The method further comprises: According to the fixed filter group corresponding to the first filter coefficient and the candidate filter group, a fixed filter index is determined; According to the fixed filter index, first syntax element identification information is determined, and the first syntax element identification information is written into the code stream; According to the execution number of the first filtering, second syntax element identification information is determined, and the second syntax element identification information is written into the code stream.

33. The method of claim 28, wherein, The determining the first filter coefficient and the execution number of the first filtering, comprises: Determining the pixel category of the pixel to be filtered in the current block, and determining the filter category corresponding to the pixel category of the pixel to be filtered; According to the filter category and the preset filter number, the filter coefficients in the candidate filter group are traversed to determine the generation value of the filter coefficients in the candidate filter group under different filter numbers; According to the generation value of the filter coefficients in the candidate filter group under different filter numbers, the first filter coefficient corresponding to the current block and the execution number of the first filtering corresponding to the current block are determined.

34. The method of claim 33, wherein, The method further comprises: According to the fixed filter group corresponding to the first filter coefficient corresponding to the current block and the candidate filter group, the fixed filter index corresponding to the current block is determined; According to the fixed filter index corresponding to the current block, third syntax element identification information is determined, and the third syntax element identification information is written into the code stream; According to the execution number of the first filtering corresponding to the current block, fourth syntax element identification information is determined, and the fourth syntax element identification information is written into the code stream.

35. The method of claim 33, wherein, The method further comprises: determine a fixed filter index corresponding to the current block according to a fixed filter group corresponding to the first filter coefficient corresponding to the current block and the candidate filter group; determine fifth syntax element identification information according to the fixed filter index corresponding to the current block, and write the fifth syntax element identification information into a bitstream; determine fourth syntax element identification information according to the number of times of execution of the first filter corresponding to the current block, and write the fourth syntax element identification information into the bitstream.

36. The method of claim 28, wherein, The method further comprises: determine a fourth generation value when the current block executes the first filter, and determine a fifth generation value when the current block does not execute the first filter; determine sixth syntax element identification information according to the fourth generation value and the fifth generation value, and write the sixth syntax element identification information into the bitstream; wherein the sixth syntax element identification information is used to determine whether to execute the first filter on the current block.

37. The method of any one of claims 6-10, wherein, The method further comprises: determine a horizontal direction index, a vertical direction index and a direction activity index corresponding to the to-be-filtered pixel according to the gradient parameter of the to-be-filtered pixel, and determine a variance division index of the to-be-filtered pixel; determine a pixel category of the to-be-filtered pixel according to the horizontal direction index, the vertical direction index, the direction activity index and the variance division index.

38. The method of any one of claims 6-10, wherein, The method further comprises: determine a pixel category of the to-be-filtered pixel according to position information of the to-be-filtered pixel.

39. The method of any one of claims 31-35, wherein, The method further comprises: determine a quantization parameter; determine the candidate filter group according to the quantization parameter.

40. The method of any one of claims 6-10, wherein, The method further comprises: determine the quantization parameter and a slice type of the current slice; determine the candidate filter group according to the quantization parameter and the slice type.

41. The method of claim 29 or 30, wherein, The method further comprises: determine a filter index of the current block corresponding to the second filter coefficient; determine third syntax element identification information according to the filter index of the current block, and write the third syntax element identification information into the bitstream.

42. The method of claim 26, wherein, The method further comprises: determine ninth syntax element identification information according to the first filter identification information and the second filter identification information, and write the ninth syntax element identification information into the bitstream.

43. The method of claim 26, wherein, The determination of the first filter identification information and the second filter identification information comprises: determine tenth syntax element identification information according to the first filter identification information, and determine eleventh syntax element identification information according to the second filter identification information; write the tenth syntax element identification information and the eleventh syntax element identification information into the bitstream.

44. A code stream, wherein the code stream is generated by bit-encoding information to be encoded; and wherein, The to-be-encoded information at least comprises one or more of first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, eighth syntax element identification information, ninth syntax element identification information, tenth syntax element identification information and eleventh syntax element identification information.

45. An encoder, comprising a first determination unit; wherein the first determination unit is configured to determine a first generation value corresponding to execution of a first filter, and determine a second generation value corresponding to execution of a second filter. determine a third generation value corresponding to performing the first filtering and the second filtering; wherein the first filtering is used to determine a first chroma sample correction value according to a first reconstructed value of the luma component and a first filter coefficient, the second filtering is used to determine a second chroma sample correction value according to a second reconstructed value of the luma component and a second filter coefficient, the first filter coefficient comprises a preset constant value, and the second filter coefficient is determined based on the APS; determine first filter identification information and second filter identification information according to the first generation value, the second generation value and the third generation value; wherein the first filter identification information is used to determine whether to perform the first filtering, and the second filter identification is used to determine whether to perform the second filtering; perform filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value; and determine a filtered reconstructed value according to the first chroma sample correction value and / or the second chroma sample correction value.

46. An encoder, comprising a first memory and a first processor; wherein the first memory is configured to store a computer program capable of running on the first processor; and the first processor is configured to execute the method in any one of claims 26 to 43 when running the computer program.

47. A decoder, comprising a second determining unit; wherein the second determining unit is configured to determine first filter identification information and second filter identification information; wherein the first filter identification information is used to determine whether to perform first filtering, and the second filter identification is used to determine whether to perform second filtering; the first filtering is used to determine a first chroma sample correction value according to at least a first reconstructed value of the luma component and a first filter coefficient, the second filtering is used to determine a second chroma sample correction value according to at least a second reconstructed value of the luma component and a second filter coefficient, the first filter coefficient comprises a preset constant value, and the second filter coefficient is determined based on the APS; perform filtering according to the first filter identification information and the second filter identification information to determine the first chroma sample correction value and / or the second chroma sample correction value; and determine a filtered reconstructed value according to the first chroma sample correction value and / or the second chroma sample correction value.

48. A decoder, comprising a second memory and a second processor; wherein the second memory is configured to store a computer program capable of running on the second processor; and the second processor is configured to execute the method in any one of claims 1 to 25 when running the computer program.

49. A computer readable storage medium, storing a computer program, which is executed to implement the method in any one of claims 1 to 25, or to implement the method in any one of claims 26 to 43. ​ ​ ​ ​ ​ ​ 50. A computer readable storage medium, the computer readable storage medium being configured to store a bitstream generated by the method of encoding according to any one of claims 26 to 43.

Citation Information

Patent Citations

  • Filter information sharing among color components

    CN110463202A

  • Video coding device and method based on in-loop filtering

    CN114556957A

  • Image compiling device and method based on adaptive loop filtering

    CN114586351A