Encoding method, decoding method, bit stream, encoder, decoder and storage medium

AU2024416840A1Pending Publication Date: 2026-08-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
AU · AU
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2026-08-13

AI Technical Summary

Technical Problem

In the prior art, there are problems such as poor flexibility or large bit overhead in the scale factor usage process of cross-component adaptive loop filters, resulting in degradation of encoding performance.

Method used

The scale factor and filter coefficient of the current color component are adaptively determined at the encoding and decoding ends, and the optimal scale factor is selected through the rate distortion optimization function, and transmitted in the code stream to ensure that each color component uses the same scale factor for filtering.

Benefits of technology

Improves encoding performance, obtains a more ideal filtering effect, and reduces bit overhead and improves encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000096_0000
    Figure 00000096_0000
  • Figure 00000097_0000
    Figure 00000097_0000
  • Figure 00000097_0001
    Figure 00000097_0001
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are an encoding method, a decoding method, a bit stream, an encoder, a decoder and a storage medium. The decoding method comprises: at a decoding end, decoding a bit stream to determine first identification information; when, on the basis of the first identification information, it is determined to use a CCALF to perform filtering processing on a current color component of a current image, determining a scale factor and a filtering coefficient corresponding to the current color component; and on the basis of the scale factor and the filtering coefficient, determining a reconstructed block of a current block. The encoding method comprises: at an encoding end, determining a scale factor corresponding to a current color component of a current image; and on the basis of a rate distortion cost corresponding to the scale factor, determining first identification information, and writing the first identification information into a bit stream, wherein the first identification information is used for indicating whether to use a CCALF to perform filtering processing on the current color component of the current image.
Need to check novelty before this filing date? Find Prior Art

Description

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

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

[0002] The Cross Component Adaptive Loop Filter (CCALF) is a filter designed to use luminance information to minimize the mean square error between the chrominance reconstructed image and the original image. The CCALF processes the color components U and V separately, with each component having its own filter.

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

[0004] However, the use of scale factors in common technologies either has problems of poor flexibility or high bit overhead, and thus cannot achieve a relatively ideal filtering effect, thereby reducing coding performance.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can achieve a more ideal filtering effect and improve coding performance.

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

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

[0009] Decoding the code stream to determine the first identification information;

[0010] In a case where it is determined based on the first identification information that a CCALF filtering process is performed on a current color component of the current image, determining a scale factor and a filtering coefficient corresponding to the current color component;

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

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

[0013] Determine the scale factor corresponding to the current color component of the current image;

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

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

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

[0017] The first determination unit is configured to determine a scale factor corresponding to a current color component of a current image; determine first identification information based on a rate-distortion cost corresponding to the scale factor, and write the first identification information into a bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

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

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

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

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

[0022] The second determination unit is configured to decode the code stream and determine the first identification information; when it is determined based on the first identification information that the current color component of the current image is to be filtered using CCALF, determine a scale factor and a filter coefficient corresponding to the current color component; and determine a reconstructed block of the current block based on the scale factor and the filter coefficient.

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

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

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

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

[0027] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. At a decoding end, the bitstream is decoded and first identification information is determined. If, based on the first identification information, CCALF is determined to be used for filtering the current color component of the current image, a scale factor and filter coefficient corresponding to the current color component are determined. A reconstructed block of the current block is determined based on the scale factor and filter coefficient. At an encoding end, a scale factor corresponding to the current color component of the current image is determined. First identification information is determined based on the rate-distortion cost corresponding to the scale factor and written into the bitstream. The first identification information indicates whether CCALF is used for filtering the current color component of the current image. In other words, in embodiments of the present application, the encoding end can adaptively determine a corresponding scale factor for the current color component of the current image. At a decoding end, if CCALF is determined to be used for filtering the current color component of the current image, the scale factor corresponding to the current color component of the current image can be used to perform CCALF filtering on the current color component. Each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0049] In Versatile Video Coding (VVC), in-loop filters primarily include luma mapping and chroma scaling, a deblocking filter (DBF), sample adaptive offset (SAO), an adaptive loop filter (ALF), and a cross-component adaptive loop filter (CCALF). The cross-component adaptive loop filter (CCALF) utilizes luma information to minimize the mean square error between the chroma reconstructed image and the original image.

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

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

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

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

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

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

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

[0057] The error vector B is a 7x1 vector. Each element in vector B is b i , where i∈[0,1,2,3,4,5,6], for b i , whose 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] Wherein, recC is the reconstructed pixel value of the pixel to be filtered, and orgC is the original pixel value of the pixel to be filtered.

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

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

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

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

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

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

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

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

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

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

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

[0071] It can be seen that the use of scale factors in common technologies either has problems of poor flexibility or high bit overhead, and thus cannot achieve a relatively ideal filtering effect, thereby reducing coding performance.

[0072] To address the above-mentioned issues, embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the decoding end, the bitstream is decoded and first identification information is determined. If, based on the first identification information, CCALF is determined to be used for filtering the current color component of the current image, a scale factor and filter coefficient corresponding to the current color component are determined. A reconstructed block of the current block is determined based on the scale factor and filter coefficient. At the encoding end, a scale factor corresponding to the current color component of the current image is determined. First identification information is determined based on the rate-distortion cost corresponding to the scale factor and written into the bitstream. The first identification information indicates whether CCALF is used for filtering the current color component of the current image. In other words, in embodiments of the present application, the encoding end can adaptively determine a corresponding scale factor for the current color component of the current image. If, at the decoding end, CCALF filtering is determined to be used for filtering the current color component of the current image, the scale factor corresponding to the current color component of the current image can be used to perform CCALF filtering on the current color component. Each filter for the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0094] Step 101: Decode the code stream and determine first identification information.

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

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

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

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

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

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

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

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

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

[0104] Step 102: When it is determined based on the first identification information that the current color component of the current image is to be filtered using CCALF, a scale factor and a filter coefficient corresponding to the current color component are determined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0126] Table 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0142] Exemplarily, in some embodiments, when the value of the second identification information is the third value, it can be determined that the current color component of the current block is not filtered using CCALF.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0158] Step 103: Determine a reconstructed block of the current block according to the scale factor and the filter coefficient.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0173] Another embodiment of the present application provides a decoding method, which is applied to a decoder and is used to perform filtering processing through an adaptive loop filter (ALF). The decoding method performed by the decoder may include the following steps:

[0174] Step 201: Decode the code stream and determine first identification information.

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

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

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

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

[0179] Step 202: When it is determined based on the first identification information that the current color component of the current image is to be filtered using the ALF, third identification information is determined.

[0180] In an embodiment of the present application, after decoding the code stream and determining the first identification information, when it is determined based on the first identification information to use ALF to perform filtering processing on the current color component of the current image, third identification information may be further determined.

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

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

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

[0184] It should be noted that, in an embodiment of the present application, the third identification information can be used to indicate whether the current color component of the current image is filtered using the non-fixed filter parameters in the ALF. In addition, the fifth value and the sixth value are different, and the fifth value and the sixth value can be in parameter form or in digital form. Generally, the third identification information can be a parameter written in the PPS or a parameter written in the SPS. The third identification information can also be a flag, and no limitation is made here.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0220] It should be noted that, in embodiments of the present application, the ALF parameter information may include second identification information. Specifically, the APS unit may include second identification information indicating whether the current color component of the current block is filtered using the ALF. The second identification information corresponding to the current block can be determined by parsing the APS unit.

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

[0222] Exemplarily, in some embodiments, when the value of the second identification information is the third value, it can be determined that the current color component of the current block is not filtered using the ALF.

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

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

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

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

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

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

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

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

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

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

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

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

[0235] That is, in an embodiment of the present application, when it is determined based on the first identification information that the current color component of the current image is to be filtered using ALF, the ALF parameter information determined by parsing the APS unit corresponding to the current image may include at least the second identification information, the first scale factor information, the filtering coefficient, and the cropping information.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0286] Where λ is the Lagrangian factor.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0309] Table 2

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

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

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

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

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

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

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

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

[0318] Step 302: Determine first identification information according to the rate-distortion cost corresponding to the scale factor, and write the first identification information into the bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

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

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

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

[0322] Furthermore, in an embodiment of the present application, when the current color component of the current image is not filtered using CCALF, a third generation value can be determined. The third generation value is the rate-distortion cost corresponding to not performing CCALF filtering on the current color component of the current image.

[0323] Further, in an embodiment of the present application, when the third generation value is less than the first generation value and the second generation value, the value of the first identification information is set to the first value, so that the first identification information indicates that CCALF is not used to filter the current color component of the current image; when the third generation value is greater than the first generation value or the second generation value, the value of the first identification information is set to the second value, so that the first identification information indicates that CCALF is used to filter the current color component of the current image.

[0324] It is understood that in the embodiments of the present application, if the first generation value, the second generation value, and the third generation value are all equal, then the value of the first identification information can be set to either the first value or the second value, and this application does not specifically limit this. For example, the value of the first identification information can be set to the first value so that the first identification information indicates that CCALF filtering is not performed on the current color component of the current image.

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

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

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

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

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

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

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

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

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

[0334] It is understood that in the embodiments of the present application, if the fourth generation value, the fifth generation value, and the sixth generation value are all equal, then the value of the second identification information can be set to either the third value or the fourth value, and this application does not specifically limit this. For example, the value of the second identification information can be set to the third value so that the second identification information indicates that CCALF filtering is not performed on the current color component of the current block.

[0335] It is understood that in an embodiment of the present application, for the current block, the rate-distortion cost under the optimal scale factor, the distortion when no filtering is performed, and the rate-distortion cost when the filter of the same color component of the frame previously filtered using CCALF is reused can be compared to determine the second identification information. If the rate-distortion cost under the optimal scale factor is the smallest, then the current color component of the current block uses the new filter, and the value of the second identification information is set to a fourth value, so that the second identification information indicates that the current color component of the current block is filtered using CCALF; if the distortion when no filtering is performed is the smallest, then the current color component of the current block is not filtered using CCALF, and the value of the second identification information is set to a third value, so that the second identification information indicates that the current color component of the current block is not filtered using CCALF; if the rate-distortion cost when filtering using the scale factor and filter of the same color component of the frame previously filtered using CCALF is the smallest, then the value of the second identification information can be set to a fourth value, so that the second identification information indicates that the current color component of the current block is filtered using CCALF.

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

[0337] Exemplarily, in some embodiments, when the value of the second identification information is the third value, it can be determined that the current color component of the current block is not filtered using CCALF.

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

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

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

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

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

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

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

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

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

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

[0348] In summary, the encoding method proposed in steps 301 and 302 above has designed a filter precision adaptive method. In CCALF technology, the optimal scaling factor is adaptively selected for the color components within a frame of an image. All filters for the same color component within the same frame use the same scaling factor, which can reduce bit costs. Furthermore, within the CCALF algorithm framework, a global optimal solution can be more closely approached, improving encoding performance.

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

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

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

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

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

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

[0355] Another embodiment of the present application provides an encoding method, which is applied to an encoder and is used to perform filtering processing through an ALF. The encoding method performed by the encoder may include the following steps:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0391] Where λ is the Lagrangian factor.

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

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

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

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

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

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

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

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

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

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

[0402] That is, in the embodiments of the present application, it is also possible not to perform rate-distortion optimization (RDO) to select the optimal scale factor. Instead, the scale factor corresponding to the current color component is directly specified, and the corresponding ALF parameter information is obtained under the scale factor. Then, the scale factor and the corresponding ALF parameter information are written into the bitstream.

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

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

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

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

[0407] That is, in an embodiment of the present application, when it is determined that ALF filtering is to be performed on the current color component of the current image, the determined ALF parameter information can be written into the bitstream and transmitted to the decoding end. The ALF parameter information may include at least the second identification information, the first scale factor information, the filter coefficient, and the cropping information.

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

[0409] Furthermore, in an embodiment of the present application, third identification information may be determined and written into the bitstream, wherein the third identification information may be used to determine whether the current color component of the current image is filtered using non-fixed filter parameters in the ALF.

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

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

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

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

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

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

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

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

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

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

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

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

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

[0423] Step 402: Determine first identification information according to the rate-distortion cost corresponding to the scale factor, and write the first identification information into the bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using ALF.

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

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

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

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

[0428] Furthermore, in an embodiment of the present application, when the current color component of the current image is not subjected to ALF filtering, a third generation value can be determined. The third generation value is the rate-distortion cost corresponding to not subjecting the current color component of the current image to ALF filtering.

[0429] Further, in an embodiment of the present application, when the third generation value is less than the first generation value and the second generation value, the value of the first identification information is set to the first value, so that the first identification information indicates that ALF is not used to filter the current color component of the current image; when the third generation value is greater than the first generation value or the second generation value, the value of the first identification information is set to the second value, so that the first identification information indicates that ALF is used to filter the current color component of the current image.

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

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

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

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

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

[0435] It should be noted that, in the embodiments of the present application, the first identification information can be used to indicate whether the current color component of the current image is filtered using the ALF. In addition, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Generally, the first identification information can be a parameter written in the PPS or a parameter written in the SPS. The first identification information can also be a flag, and no limitation is imposed herein.

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

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

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

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

[0440] It is understood that in the embodiments of the present application, if the fourth generation value, the fifth generation value, and the sixth generation value are all equal, then the value of the second identification information can be set to either the third value or the fourth value, and this application does not specifically limit this. For example, the value of the second identification information can be set to the third value so that the second identification information indicates that the current color component of the current block is not to be filtered using the ALF.

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

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

[0443] Exemplarily, in some embodiments, when the value of the second identification information is the third value, it can be determined that the current color component of the current block is not filtered using the ALF.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0458] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see FIG10 , which shows a schematic diagram of the structure of the encoder 100 proposed in the embodiment of the present application. As shown in FIG10 , the encoder 100 may include: a first determining unit 1001; wherein,

[0459] The first determination unit 1001 is configured to determine a scale factor corresponding to a current color component of a current image; determine first identification information based on a rate-distortion cost corresponding to the scale factor, and write the first identification information into a bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

[0460] It should be noted that, in the embodiment of the present application, the encoder 100 can also be regarded as a data processing mode (or "entropy encoder"), which is used to encode the values ​​of the syntax elements to be encoded.

[0461] It is understood that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular device. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0462] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0463] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 100. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the encoding method described in any one of the aforementioned embodiments.

[0464] Based on the composition of the encoder 100 and the computer-readable storage medium, refer to Figure 11, which shows a specific hardware structure diagram of the encoder 100 provided in an embodiment of the present application. As shown in Figure 11, the encoder 100 may include: a first communication interface 1002, a first memory 1003 and a first processor 1004; each component is coupled together through a first bus system 1005. It can be understood that the first bus system 1005 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 1005 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the first bus system 1005 in the figure. Among them,

[0465] The first communication interface 1002 is used to receive and send signals when sending and receiving information with other external network elements;

[0466] A first memory 1003 is used to store computer programs that can be run on the first processor 1004;

[0467] The first processor 1004 is configured to, when running the computer program, perform the following operations: determining a scale factor corresponding to a current color component of a current image; determining first identification information based on a rate-distortion cost corresponding to the scale factor, and writing the first identification information into a bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

[0468] It is understood that the first memory 1003 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a 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, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 1003 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0469] The first processor 1004 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 1004. The above-mentioned first processor 1004 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 1003 , and the first processor 1004 reads the information in the first memory 1003 and completes the steps of the above method in combination with its hardware.

[0470] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0471] Optionally, as another embodiment, the first processor 1004 is further configured to execute the encoding method described in any one of the aforementioned embodiments when running the computer program.

[0472] This embodiment provides an encoder that determines a scale factor corresponding to a current color component of a current image; determines first identification information based on a rate-distortion cost corresponding to the scale factor, and writes the first identification information into a bitstream; wherein the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF. That is, in an embodiment of the present application, the encoding end can adaptively determine a corresponding scale factor for the current color component of the current image; and the decoding end, when determining that CCALF is to be used for filtering the current color component of the current image, can use the scale factor corresponding to the current color component of the current image to perform CCALF filtering on the current color component, wherein each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

[0473] In another embodiment of the present application, based on the same inventive concept as the above embodiment, refer to FIG12 , which shows a schematic diagram of the structure of the decoder 120 proposed in the embodiment of the present application. As shown in FIG12 , the decoder 120 may include: a second determining unit 1201; wherein,

[0474] The second determination unit 1201 is configured to decode the code stream and determine first identification information; when it is determined based on the first identification information that CCALF is used to filter the current color component of the current image, determine a scale factor and a filter coefficient corresponding to the current color component; and determine a reconstructed block of the current block based on the scale factor and the filter coefficient.

[0475] It should be noted that, in the embodiment of the present application, the decoder 120 can also be regarded as a data processing mode (or "entropy decoder"), which is used to decode the values ​​of the syntax elements to be decoded.

[0476] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0477] If the integrated unit is implemented as a software functional module and not sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium, applied to decoder 120, storing a computer program. When executed by a second processor, the computer program implements any of the methods described in the aforementioned embodiments.

[0478] Based on the composition of the decoder 120 and the computer-readable storage medium, refer to Figure 13, which shows a specific hardware structure diagram of the decoder 120 provided in an embodiment of the present application. As shown in Figure 13, the decoder 120 may include: a second communication interface 1202, a second memory 1203 and a second processor 1204; each component is coupled together through a second bus system 1205. It can be understood that the second bus system 1205 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 1205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the second bus system 1205 in the figure. Among them,

[0479] The second communication interface 1202 is used to receive and send signals during the process of sending and receiving information between other external network elements;

[0480] The second memory 1203 is used to store computer programs that can be run on the second processor 1204;

[0481] The second processor 1204 is configured to, when running the computer program, perform the following operations: configuring to decode the code stream and determining first identification information; determining a scale factor and a filter coefficient corresponding to the current color component when determining to use CCALF to filter the current color component of the current image based on the first identification information; and determining a reconstructed block of the current block based on the scale factor and the filter coefficient.

[0482] Optionally, as another embodiment, the second processor 1204 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0483] It can be understood that the hardware functions of the second memory 1203 are similar to those of the first memory 1003, and the hardware functions of the second processor 1204 are similar to those of the first processor 1004; they will not be described in detail here.

[0484] This embodiment provides a decoder that decodes a bitstream and determines first identification information; when determining based on the first identification information to use CCALF to filter the current color component of the current image, determines a scale factor and filter coefficient corresponding to the current color component; and determines a reconstructed block of the current block based on the scale factor and the filter coefficient. That is, in an embodiment of the present application, the encoder can adaptively determine a corresponding scale factor for the current color component of the current image; and the decoder, when determining to use CCALF to filter the current color component of the current image, can use the scale factor corresponding to the current color component of the current image to perform CCALF filtering on the current color component, wherein each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

[0485] In yet another embodiment of the present application, referring to FIG14 , a schematic diagram of the structure of a coding and decoding system proposed in an embodiment of the present application is shown. As shown in FIG14 , the coding and decoding system 140 may include an encoder 100 and a decoder 120 .

[0486] In an embodiment of the present application, the encoder 100 may be the encoder described in any one of the aforementioned embodiments, and the decoder 120 may be the decoder described in any one of the aforementioned embodiments.

[0487] Furthermore, an embodiment of the present application also proposes a code stream, wherein the code stream is generated by bit encoding based on the information to be encoded; wherein the information to be encoded includes at least: first identification information, a scale factor corresponding to the current color component of the current image, a filter coefficient corresponding to the current color component of the current image, second identification information, an APS index corresponding to the current image, and an APS unit corresponding to the current image.

[0488] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0489] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0490] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0491] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0492] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0493] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability

[0494] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. At a decoding end, the bitstream is decoded and first identification information is determined. If, based on the first identification information, CCALF is determined to be used for filtering the current color component of the current image, a scale factor and filter coefficient corresponding to the current color component are determined. A reconstructed block of the current block is determined based on the scale factor and filter coefficient. At an encoding end, a scale factor corresponding to the current color component of the current image is determined. First identification information is determined based on the rate-distortion cost corresponding to the scale factor and written into the bitstream. The first identification information indicates whether CCALF is used for filtering the current color component of the current image. In other words, in embodiments of the present application, the encoding end can adaptively determine a corresponding scale factor for the current color component of the current image. At a decoding end, if CCALF is determined to be used for filtering the current color component of the current image, the scale factor corresponding to the current color component of the current image can be used to perform CCALF filtering on the current color component. Each filter of the current color component uses the same scale factor, thereby achieving a more ideal filtering effect and improving encoding performance.

Claims

1. A decoding method, applied to a decoder, the method comprising: Decoding a bitstream to determine first identification information; When it is determined based on the first identification information that cross-component adaptive loop filter (CCALF) is used to filter the current color component of the current image, determining a scale factor and a filtering coefficient corresponding to the current color component; Determining a reconstructed block of a current block in the current image according to the scale factor and the filtering coefficient; 2. The method according to claim 1, wherein, The determining the scale factor corresponding to the current color component includes: Determining first scale factor information corresponding to the current color component; Determining the scale factor corresponding to the current color component according to the first scale factor information; 3. The method according to claim 2, wherein The determining the scale factor corresponding to the current color component according to the first scale factor information includes: Determining the scale factor corresponding to the current color component according to the first scale factor information and a scale factor candidate list; 4. The method according to claim 2, wherein, The determining the scale factor corresponding to the current color component according to the first scale factor information includes: Determining the first scale factor information as the scale factor corresponding to the current color component; 5. The method according to claim 2, wherein, The determining the scale factor corresponding to the current color component according to the first scale factor information includes: Performing a conversion according to the first scale factor information to determine the scale factor corresponding to the current color component; 6. The method according to any one of claims 2-5, wherein The method further comprises: When it is determined based on the first identification information that CCALF is used to filter the current color component of the current image, decoding the bitstream to determine an adaptive parameter set (APS) index corresponding to the current image; Determining an APS unit corresponding to the current image according to the APS index; Determining second identification information according to the APS unit; wherein, the second identification information is used to determine whether CCALF is used to filter the current color component of the current block; 7. The method according to claim 6, wherein The method further comprises: When it is determined based on the second identification information that CCALF is used to filter the current color component of the current block, executing the process of determining the reconstructed block of the current block according to the scale factor and the filtering coefficient; 8. The method according to claim 6, wherein The determining the first scale factor information corresponding to the current color component includes: Determining the first scale factor information corresponding to the current color component according to the APS unit; 9. The method according to claim 6, wherein The determining the filtering coefficient corresponding to the current color component includes: Determining the filtering coefficient corresponding to the current color component according to the APS unit; 10. The method according to any one of claims 1-5, 7-9, wherein The determining the reconstructed block of the current block according to the scale factor and the filtering coefficient includes: For a current pixel in the current block, determining a filtered reconstructed value of the current color component of the current pixel according to a luminance reconstructed value of a reference pixel corresponding to the current pixel, a luminance reconstructed value of the current pixel, a reconstructed value of the current color component of the current pixel, the scale factor, and the filtering coefficient; Determining the reconstructed block of the current block based on the filtered reconstructed value of the current color component of the current pixel; 11. The method according to claims 1-5, 7-9, wherein, The method further comprises: When the value of the first identification information is the first value, it is determined not to perform filtering processing on the current color component of the current image using CCALF; When the value of the first identification information is the second value, it is determined to perform filtering processing on the current color component of the current image using CCALF.

12. The method according to claim 7, wherein, The method further includes: When the value of the second identification information is the third value, it is determined not to perform filtering processing on the current color component of the current block using CCALF; When the value of the second identification information is the fourth value, it is determined to perform filtering processing on the current color component of the current block using CCALF.

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

14. The method according to claim 3, wherein, The method further includes: Decode the bitstream and determine the list number information; Set at least one of the scale factor candidate lists according to the list number information.

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

16. An encoding method, applied to an encoder, the method includes: Determine the scale factor corresponding to the current color component of the current image; Determine the first identification information according to the rate-distortion cost corresponding to the scale factor, and write the first identification information into the bitstream; wherein, the first identification information is used to indicate whether to perform filtering processing on the current color component of the current image using CCALF.

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

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

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

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

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

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

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

24. The method according to claim 20, wherein, The determining the scale factor corresponding to the current color component of the current image includes: Determine the scale factor corresponding to the current color component as the scale factor corresponding to the current color component of the filtering frames using CCALF in front of the current image.

25. The method according to claim 24, wherein, The rate distortion cost corresponding to the scale factor includes the first-generation cost corresponding to the optimal scale factor and the second-generation cost corresponding to the scale factor corresponding to the current color component of the filtering frames using CCALF in front.

26. The method according to claim 25, wherein, The method further includes: Determine the third-generation cost in the case where the current color component of the current image is not filtered using CCALF.

27. The method according to claim 26, wherein, The determining the first identification information according to the rate distortion cost corresponding to the scale factor includes: In the case where the third-generation cost is less than the first-generation cost and the second-generation cost, set the value of the first identification information to a first value, so that the first identification information indicates not to filter the current color component of the current image using CCALF; In the case where the third-generation cost is greater than the first-generation cost or the second-generation cost, set the value of the first identification information to a second value, so that the first identification information indicates to filter the current color component of the current image using CCALF.

28. The method according to claim 21, wherein, The method further includes: Determine the fourth-generation cost corresponding to the current block in the case of using the optimal scale factor; Determine the fifth-generation cost corresponding to the current block in the case of reusing the scale factor corresponding to the current color component of the filtering frames using CCALF in front of the current image; Determine the sixth-generation cost corresponding to the current block in the case where the current color component of the current image is not filtered using CCALF; Determine the second identification information according to the fourth-generation cost, the fifth-generation cost, and the sixth-generation cost, and write the second identification information into the code stream.

29. The method according to claim 28, wherein The determining the second identification information according to the fourth-generation cost, the fifth-generation cost, and the sixth-generation cost includes: In the case where the sixth-generation cost is less than the fourth-generation cost and the fifth-generation cost, set the value of the second identification information to a third value, so that the second identification information indicates not to filter the current color component of the current block using CCALF; In the case where the sixth-generation cost is greater than the fourth-generation cost or the fifth-generation cost, set the value of the second identification information to a fourth value, so that the second identification information indicates to filter the current color component of the current block using CCALF.

30. The method according to claim 17 or 18, wherein, The determining the scale factor corresponding to the current color component of the current image includes: Directly determine the scale factor corresponding to the current color component.

31. The method according to claim 20, wherein, The determining the scale factor corresponding to the current color component of the current image includes: Determine the optimal scaling factor in the list of scaling factor candidates; Determine the optimal scaling factor as the scaling factor corresponding to the current color component of the current image.

32. The method according to claim 17 or 18, wherein The method further includes: Determine first scaling factor information corresponding to the current color component according to the scaling factor corresponding to the current color component; Write the first scaling factor information into the bitstream.

33. The method according to claim 32, wherein The determining the first scaling factor information corresponding to the current color component according to the scaling factor corresponding to the current color component includes: Set the first scaling factor information according to the scaling factor corresponding to the current color component and the list of scaling factor candidates.

34. The method according to claim 32, wherein The determining the first scaling factor information corresponding to the current color component according to the scaling factor corresponding to the current color component includes: Determine the scaling factor corresponding to the current color component as the first scaling factor information.

35. The method according to claim 32, wherein, The determining the first scaling factor information corresponding to the current color component according to the scaling factor corresponding to the current color component includes: Perform a conversion according to the scaling factor corresponding to the current color component to determine the first scaling factor information.

36. The method according to claim 21, wherein The determining the reconstructed block of the current block according to the candidate scaling factor and the filtering coefficient includes: For the current pixel in the current block, determine the filtered reconstructed value of the current color component of the current pixel according to the luminance reconstructed value of the reference pixel corresponding to the current pixel, the luminance reconstructed value of the current pixel, the reconstructed value of the current color component of the current pixel, the candidate scaling factor, and the filtering coefficient; Determine the reconstructed block of the current block based on the filtered reconstructed value of the current color component of the current pixel.

37. The method according to claim 21 or 22, wherein, The method further includes: Determine the APS unit corresponding to the current image when filtering the current color component of the current image using CCALF; Determine the APS index corresponding to the current image according to the APS unit; Write the APS unit and the APS index into the bitstream.

38. The method according to claim 28 or 29, wherein The APS unit corresponding to the current image at least includes one or more of the following information: the second identification information, the filtering coefficient corresponding to the current color component of the current image, the first scaling factor information corresponding to the current color component of the current image.

39. A bitstream, which is generated by performing bit encoding on information to be encoded; wherein, The information to be encoded at least includes: the first identification information, the scaling factor corresponding to the current color component of the current image, the filtering coefficient corresponding to the current color component of the current image, the second identification information, the APS index corresponding to the current image, the APS unit corresponding to the current image.

40. An encoder, the encoder includes a first determination unit; wherein The first determination unit is configured to determine the scaling factor corresponding to the current color component of the current image; determine the first identification information according to the rate-distortion cost corresponding to the scaling factor, and write the first identification information into the bitstream; wherein, the first identification information is used to indicate whether the current color component of the current image is filtered using CCALF.

41. An encoder, the encoder comprising a first memory and a first processor; wherein, the first memory is configured to store a computer program that can run on the first processor; the first processor is configured to execute the method according to any one of claims 16 to 38 when running the computer program.

42. A decoder, the decoder comprising a second determination unit; wherein, the second determination unit is configured to decode a bitstream, determine first identification information; when it is determined based on the first identification information that CCALF is used for filtering processing of a current color component of a current image, determine a scaling factor and a filtering coefficient corresponding to the current color component; and determine a reconstructed block of the current block according to the scaling factor and the filtering coefficient.

43. A decoder, the decoder comprising a second memory and a second processor; wherein, the second memory is configured to store a computer program that can run on the second processor; the second processor is configured to execute the method according to any one of claims 1 to 15 when running the computer program.

44. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 15, or implements the method according to any one of claims 16 to 38.