Encoding method, decoding method, encoder, decoder, storage medium, and bitstream

WO2026193775A1PCT designated stage Publication Date: 2026-09-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/083584
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-09-24

Smart Images

  • Figure CN2025083584_24092026_PF_FP_ABST
    Figure CN2025083584_24092026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides an encoding method, a decoding method, an encoder, a decoder, a storage medium, and a bitstream. The decoding method comprises: determining a first chroma value of a chroma sample of a current block on the basis of a first loop filter; determining a second chroma value of the chroma sample on the basis of at least one adaptive filter; and determining a correction value for the chroma sample on the basis of the first chroma value and the second chroma value.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding / decoding methods, codecs, storage media, and bitstreams Technical Field

[0001] This application relates to the field of video encoding and decoding, and more particularly to an encoding and decoding method, an encoder and decoder, a storage medium, and a bitstream. Background Technology

[0002] Loop filtering is an important video encoding and decoding technique. However, in certain scenarios, this technique suffers from low filtering performance. Summary of the Invention

[0003] This application provides an encoding / decoding method, an encoding / decoding method, a storage medium, and a bitstream. The various aspects involved in this application are described below.

[0004] In a first aspect, a decoding method is provided, applied to a decoder, comprising: determining a first chromaticity value of a chromaticity sample of a current block based on a first loop filter; determining a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and determining a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0005] In a second aspect, an encoding method is provided, applied to an encoder, comprising: determining a first chromaticity value of a chromaticity sample of a current block based on a first loop filter; determining a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and determining a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0006] Thirdly, a decoder is provided, comprising: a first determining unit configured to determine a first chromaticity value of a chromaticity sample of a current block based on a first loop filter; a second determining unit configured to determine a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and a third determining unit configured to determine a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0007] Fourthly, an encoder is provided, comprising: a first determining unit configured to determine a first chromaticity value of a chromaticity sample of a current block based on a first loop filter; a second determining unit configured to determine a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and a third determining unit configured to determine a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0008] Fifthly, a decoder is provided, the decoder comprising: a memory for storing a computer program; and a processor for executing the method as described in the first aspect when running the computer program.

[0009] In a sixth aspect, an encoder is provided, the encoder comprising: a memory for storing a computer program; and a processor for executing the method as described in the second aspect when running the computer program.

[0010] In a seventh aspect, a non-volatile computer-readable storage medium is provided for storing a bit stream, the bit stream being generated by an encoding method using an encoder, or the bit stream being decoded by a decoding method using a decoder, wherein the decoding method is as described in the first aspect and the encoding method is as described in the second aspect.

[0011] Eighthly, a bitstream is provided, the bitstream comprising a bitstream generated by the method described in the second aspect.

[0012] A ninth aspect provides a computer-readable storage medium storing a computer program that, when executed, implements the method described in the first aspect or the method described in the second aspect.

[0013] In a tenth aspect, a computer program product is provided, comprising a computer program that, when executed, implements the method as described in the first or second aspect.

[0014] The embodiments of this application correct the chromaticity values ​​determined based on the filter, thereby avoiding the occurrence of outliers and improving the filtering performance. Attached Figure Description

[0015] Figure 1 is a structural example diagram of a video encoder applicable to embodiments of this application.

[0016] Figure 2 is a structural example diagram of a video decoder applicable to embodiments of this application.

[0017] Figure 3 is a schematic diagram of the decoding process of the adaptive loop filter-cross component convolution model (ALF_CCCM).

[0018] Figure 4 is a flowchart illustrating the decoding method provided in an embodiment of this application.

[0019] Figure 5 is a schematic diagram of the decoding process of ALF_CCCM provided in the embodiment of this application.

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

[0021] Figure 7 is a schematic diagram of the structure of a decoder provided in one embodiment of this application.

[0022] Figure 8 is a schematic diagram of the structure of a decoder provided in another embodiment of this application.

[0023] Figure 9 is a schematic diagram of the encoder provided in one embodiment of this application.

[0024] Figure 10 is a schematic diagram of the encoder provided in another embodiment of this application. Detailed Implementation

[0025] Video encoding and decoding framework

[0026] Figure 1 is a schematic block diagram of a video encoder involved in an embodiment of this application.

[0027] It should be understood that the video encoder 100 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.

[0028] This video encoder 100 can be applied to image data in luminance / chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) for every 4 samples; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) for every 4 samples; and 4:4:4 means that all samples are displayed (YYYYCbCrCbCrCbCrCbCr).

[0029] For example, the video encoder 100 reads video data and, for each image (or sub-image or frame) in the video data, divides an image into several coding tree units (CTUs). In some examples, CTUs may be called "tree blocks," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU can be associated with a sample block of equal size within the image. Each sample can correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. A CTU can be a square block (or, the shape of the CTU is square). The size of a CTU is, for example, 256×256, 128×128, 64×64, 32×32, etc. A CTU can be further divided into several coding units (CUs) for encoding. CUs can be rectangular blocks or square blocks. The CU can be further divided into prediction units (PUs) and transform units (TUs), thus separating encoding, prediction, and transformation for more flexible processing. In one example, the CTU is divided into CUs using a quadtree structure, and the CUs are further divided into TUs and PUs using a quadtree structure. In some embodiments, the division of the prediction unit and the transform unit can be different.

[0030] It's important to note that video codec standards (such as VVC and HEVC) allow encoders to determine the size and partitioning of CUs and / or PUs based on the video content. For example, regions with simple textures or motion may tend to use larger blocks, while regions with complex textures or motion may tend to use smaller blocks. The deeper the block partitioning, the more complex and closer the blocks can be to the actual texture or motion, but correspondingly, the overhead for representing these partitions is also greater.

[0031] The video encoder and decoder support various PU sizes. Assuming a specific CU size of 2N×2N, the video encoder and decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and also support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.

[0032] In some embodiments, as shown in FIG1, the video encoder 100 may include: a prediction unit 110, a residual unit 120, a transform / quantization unit 130, an inverse transform / quantization unit 140, a reconstruction unit 150, a loop filtering unit 160, a decoded image buffer 170, and an entropy coding unit 180. It should be noted that the video encoder 100 may include more, fewer, or different functional components.

[0033] In some embodiments, the prediction unit 110 includes an inter-frame prediction unit 111 and an intra-frame prediction unit 112. Because there is a strong correlation between adjacent samples in an image of a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent samples. Because there is a strong similarity between adjacent images in a video, inter-frame prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0034] Inter-frame prediction unit 111 can be used for inter-frame prediction, which can include motion estimation and motion compensation. Referring to image information from different images, inter-frame prediction uses motion information to find reference blocks in the reference images and generates prediction blocks based on these reference blocks to eliminate temporal redundancy. The motion information includes a list of reference images containing the reference image, the reference image index, and motion vectors. Motion vectors can be whole-sample or multi-sample. If the motion vectors are multi-sample, interpolation filtering needs to be used in the reference images to create the required multi-sample blocks. Here, the whole-sample or multi-sample block in the reference image found based on the motion vector is called a reference block. Some techniques directly use the reference block as the prediction block, while others process the reference block further to generate the prediction block. Processing the reference block further to generate the prediction block can also be understood as using the reference block as the prediction block and then processing it to generate a new prediction block.

[0035] Intra-frame prediction unit 112 refers only to information from the same image to predict sample information within the current code image block, thereby eliminating spatial redundancy.

[0036] Intra-frame prediction has multiple prediction modes. Taking the international digital video coding standards H-series as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC extends this to 33 angular prediction modes and 2 non-angular prediction modes. HEVC uses Planar, DC, and 33 angular modes for a total of 35 intra-frame prediction modes. VVC uses Planar, DC, and 65 angular modes for a total of 67 intra-frame prediction modes.

[0037] It should be noted that with the increase in angle modes, intra-frame prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video.

[0038] The residual unit 120 can generate a residual block of the CU based on the sample block of the CU and the prediction block of the PU of the CU. For example, the residual unit 120 can generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the sample in the sample block of the CU and the corresponding sample in the prediction block of the PU of the CU.

[0039] Transform / quantization unit 130 can quantize transform coefficients. Transform / quantization unit 130 can quantize transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. Video encoder 100 can adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0040] The inverse transform / quantization unit 140 can apply inverse quantization and inverse transform to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients.

[0041] The reconstruction unit 150 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction unit 110 to produce a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of the CU in this way, the video encoder 100 can reconstruct the sample blocks of the CU.

[0042] The loop filtering unit 160 is used to process the samples after inverse transform and inverse quantization to compensate for distorted information and provide a better reference for subsequent encoded samples. For example, it can perform deblocking filtering to reduce the block effect of sample blocks associated with the CU.

[0043] In some embodiments, the loop filtering unit 160 includes a deblocking filtering unit and a sample adaptive compensation / adaptive loop filtering (SAO / ALF) unit, wherein the deblocking filtering unit is used to remove block effects and the SAO / ALF unit is used to remove ringing effects.

[0044] The decoded image buffer 170 can store reconstructed sample blocks. The inter-frame prediction unit 111 can use a reference image containing the reconstructed sample blocks to perform inter-frame prediction on PUs in other images. In addition, the intra-frame prediction unit 112 can use the reconstructed sample blocks in the decoded image buffer 170 to perform intra-frame prediction on other PUs in the same image as the CU.

[0045] The entropy coding unit 180 can receive quantized transform coefficients from the transform / quantization unit 130. The entropy coding unit 180 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.

[0046] Figure 2 is a schematic block diagram of the video decoder involved in the embodiments of this application.

[0047] As shown in Figure 2, the video decoder 200 includes: an entropy decoding unit 210, a prediction unit 220, an inverse quantization / transformation unit 230, a reconstruction unit 240, a loop filtering unit 250, and a decoded image buffer 260. It should be noted that the video decoder 200 may contain more, fewer, or different functional components.

[0048] Video decoder 200 can receive a bitstream. Entropy decoding unit 210 can parse the bitstream to extract syntax elements. As part of parsing the bitstream, entropy decoding unit 210 can parse the entropy-encoded syntax elements in the bitstream. Prediction unit 220, dequantization / transform unit 230, reconstruction unit 240, and loop filtering unit 250 can decode video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.

[0049] In some embodiments, the prediction unit 220 includes an intra-frame prediction unit 222 and an inter-frame prediction unit 221.

[0050] Intra-prediction unit 222 can perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 222 can use an intra-prediction mode to generate prediction blocks for the PU based on sample blocks of spatially adjacent PUs. Intra-prediction unit 222 can also determine the intra-prediction mode of the PU based on one or more syntax elements parsed from the bitstream.

[0051] Inter-frame prediction unit 221 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter-frame prediction coding, entropy decoding unit 210 can parse the motion information of the PU. Inter-frame prediction unit 221 can determine one or more reference blocks of the PU based on the motion information of the PU. Inter-frame prediction unit 221 can generate prediction blocks for the PU based on one or more reference blocks of the PU.

[0052] The dequantization / transformation unit 230 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The dequantization / transformation unit 230 can use the QP value associated with the CU of the TU to determine the degree of quantization.

[0053] After the inverse quantization transform coefficients, the inverse quantization / transformation unit 230 can apply one or more inverse transforms to the inverse quantization transform coefficients to generate a residual block associated with the TU.

[0054] The reconstruction unit 240 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the sample block of the CU. For example, the reconstruction unit 240 can add the samples of the residual block to the corresponding samples of the prediction block to reconstruct the sample block of the CU, thereby obtaining the reconstructed image block.

[0055] The loop filter unit 250 can perform deblocking filtering operations to reduce the block effect of sample blocks associated with the CU.

[0056] The video decoder 200 can store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 can use the reconstructed image in the decoded image buffer 260 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0057] The basic process of video encoding and decoding is as follows: At the encoding end, an image is divided into blocks. For the current block, prediction unit 110 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. Residual unit 120 can calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. This residual block can also be called residual information. This residual block is transformed and quantized by transform / quantization unit 130, which can remove information that is not sensitive to the human eye to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by transform / quantization unit 130 can be called a temporal residual block, and the temporal residual block after transformation and quantization by transform / quantization unit 130 can be called a frequency residual block or a frequency domain residual block. Entropy coding unit 180 receives the quantized change coefficients output by transform / quantization unit 130, and can entropy code the quantized change coefficients to output a bitstream. For example, entropy coding unit 180 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.

[0058] At the decoding end, the entropy decoding unit 210 can parse the bitstream to obtain the prediction information and quantization coefficient matrix of the current block. The prediction unit 220 uses intra-frame prediction or inter-frame prediction to generate the prediction block of the current block based on the prediction information. The dequantization / transform unit 230 uses the quantization coefficient matrix obtained from the bitstream to perform dequantization and inverse transform on the quantization coefficient matrix to obtain the residual block. The reconstruction unit 240 adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image. The loop filtering unit 250 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. This decoded image can also be called the reconstructed image, which can be used as a reference image for inter-frame prediction of subsequent images.

[0059] It should be noted that the block partitioning information determined at the encoding end, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding end by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.

[0060] In some embodiments, the current block may be referred to as the current coding unit (CU), the current prediction unit (PU), or the current transform unit (TU), etc. The prediction block may also be referred to as the predicted image block or the image prediction block, and the reconstructed image block may also be referred to as the reconstruction block or the image reconstruction block.

[0061] In some embodiments, images can be divided into slices or similar components to facilitate parallel processing. Slices within the same image can be processed in parallel, meaning there is no data dependency between different slices within the same image.

[0062] It should be noted that the term "frame" as used in this application can generally be understood as a frame or an image, or in other words, the term "frame" as used in this application can also be replaced with an image or a slice, etc.

[0063] The above describes the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. This application is applicable to the basic flow of a video codec under this block-based hybrid coding framework, but is not limited to this framework and flow.

[0064] The encoding / decoding framework provided in the embodiments of this application has been described in detail above. The embodiments of this application can be applied to the loop filtering unit within the encoding / decoding framework. The relevant technologies involved in the embodiments of this application will be described in detail below.

[0065] ALF_CCCM

[0066] In related technologies, loop filters mainly include bilateral filters, luminance mapping and chrominance scaling, deblocking filters, sample offset compensation, adaptive loop filters, and cross-component adaptive loop filters (CCALF). ALF is a filter designed to minimize the mean square error between the reconstructed image and the original image. CCALF is a filter designed to minimize the mean square error between the chrominance reconstructed image and the original image using luminance information.

[0067] In addition, related technologies have proposed ALF_CCCM. ALF_CCCM mainly utilizes the relationship between the luminance and chrominance components to map the ALF filtering result of the luminance component onto the chrominance component, thereby improving the performance of the chrominance component. The decoding framework diagram of ALF_CCCM at the decoding end is shown in Figure 3.

[0068] The ALF_CCCM technology consists of three parts: parameter parsing, CCCM filter coefficient derivation, and CCCM filtering. The implementation of these three parts will be explained in detail below from the perspective of the decoding end.

[0069] Part 1: Parameter Analysis

[0070] The parameters of ALF_CCCM are primarily at the coding tree unit (CTU) level. These parameters include: an indicator of whether the current CTU uses ALF_CCCM (alf_cccm_enabled), the window size when the current CTU uses ALF_CCCM (alf_cccm_window_size_idx), and the filter template used by the current CTU (alf_cccm_model_type_idx). The parameters of ALF_CCCM are located in the coding_tree_unit() function of the syntax element table, as shown in Table 1 below.

[0071] Table 1. ALF CCCM Syntax Element Table

[0072] The syntax elements in Table 1 are described below.

[0073] alfCccm(CtbAddrX, CtbAddrY) is the main function for encoding ALF_CCCM syntax elements, where CtbAddrX represents the x-coordinate of the current CTU, and CtbAddrY represents the y-coordinate of the current CTU.

[0074] `is_intra_slice` is a binary variable. A value of 1 indicates that the slice containing the current CTU is an intra-frame slice. A value of 0 indicates that the slice containing the current CTU is not an intra-frame slice.

[0075] `has_ref_pic` is a binary variable. A value of 1 indicates that the slice containing the current CTU contains a reference image that uses ALF_CCCM. A value of 0 indicates that the slice containing the current CTU does not contain a reference image that uses ALF_CCCM.

[0076] `inherit_from_ref_pic` is a binary variable. A value of 1 indicates that the ALF_CCCM parameter of each CTU in the current frame is the same as the ALF_CCCM parameter of the CTU at the same position in the nearest reference frame. A value of 0 indicates that the ALF_CCCM parameter of each CTU in the current frame is different from the ALF_CCCM parameter of the CTU at the same position in the nearest reference frame.

[0077] `alf_cccm_enabled` is a binary variable. A value of 1 indicates that the current CTU uses ALF_CCCM for filtering. A value of 0 indicates that the current CTU does not use ALF_CCCM for filtering.

[0078] `alf_cccm_merge_mode_enabled` is a binary variable. A value of 1 indicates that the current CTU uses the ALF_CCCM parameter of the left-adjacent or top-adjacent CTU for filtering. A value of 0 indicates that the current CTU does not use the ALF_CCCM parameter of the left-adjacent or top-adjacent CTU for filtering.

[0079] `alf_cccm_use_left_or_above_ctu_info` is a binary variable. A value of 1 indicates that the current CTU uses the ALF_CCCM parameter of the left adjacent CTU for filtering. A value of 0 indicates that the current CTU uses the ALF_CCCM parameter of the top adjacent CTU for filtering.

[0080] `alf_cccm_window_size_idx` has eight possible values, each corresponding to a different window size. `alf_cccm_window_size_idx` indicates whether the current CTU should be divided into multiple adjacent, non-overlapping blocks. The window sizes mentioned here are: 4x4, 8x2, 2x8, 8x8, 16x16, 32x32, 64x64, or 128x128.

[0081] The `alf_cccm_model_type_idx` parameter has eight possible values, each corresponding to a different ALF_CCCM filter template, as shown in Table 2. Different ALF_CCCM filter templates are used to filter adjacent samples at different positions as input.

[0082] Table 2 ALF_CCCM Filter Template

[0083] During the decoding process, firstly, it is determined whether the slice containing the current CTU is an intra-frame slice. If it is an intra-frame slice, the current CTU does not use ALF_CCCM, and the ALF_CCCM parameter parsing process ends. If the slice containing the current CTU is not an intra-frame slice, it is determined whether the current CTU is the first CTU in the top left corner of the current frame. If the current CTU is the first CTU in the top left corner of the current frame and there is a reference frame in the current frame that uses ALF_CCCM, the syntax element inherit_from_ref_pic is parsed. Otherwise, the syntax element inherit_from_ref_pic is not parsed. If the value of this syntax element is 1, the current CTU uses the ALF_CCCM parameter of the CTU at the same position in the reference frame for filtering, and the parsing process ends. If the value of inherit_from_ref_pic is 0, the value of the syntax element alf_ctb_flag[0] is determined. If `alf_ctb_flag[0]` is 1, then the syntax element `alf_cccm_enabled` is further parsed. If `alf_ctb_flag[0]` is 0, then the current CTU does not use ALF_CCCM for filtering. The value of the syntax element `alf_cccm_enabled` is determined. If the value is 1, it is determined whether the current CTU's left-adjacent CTU and top-adjacent CTU use ALF_CCCM for filtering. If at least one of the top-adjacent CTU or left-adjacent CTU uses ALF_CCCM for filtering, then the syntax element `alf_cccm_merge_mode_enabled` is further parsed. Otherwise, the current CTU does not use the ALF_CCCM parameter of the adjacent CTU for filtering. The value of the syntax element `alf_cccm_merge_mode_enabled` is determined. If the value is 1, the current CTU uses the ALF_CCCM parameter of the left-adjacent CTU or top-adjacent CTU for filtering. At this point, the value of `alf_cccm_merge_cand_number` is checked. If the value of `alf_cccm_merge_cand_number` is greater than 1, the syntax element `alf_cccm_use_left_or_above_ctu_info` is further parsed. `alf_cccm_use_left_or_above_ctu_info` indicates whether the current CTU uses the ALF_CCCM parameters of its left-adjacent CTU or its top-adjacent CTU for filtering. If the value of `alf_cccm_merge_mode_enabled` is 0, then the current CTU does not use the ALF_CCCM parameters of its adjacent CTUs for filtering.At this point, it is necessary to parse the syntax elements alf_cccm_window_size_idx and alf_cccm_model_type_idx.

[0084] Part Two: Derivation of ALF_CCCM Filter Coefficients

[0085] The first step is to obtain the reconstructed sample values ​​of the current CTU output by the front-end module, including the luminance sample value and two chromaticity values. In the example in Figure 3, the front-end modules are SAO and CCSAO.

[0086] The second step is to determine whether the current CTU uses ALF_CCCM filtering based on the syntax elements alf_ctb_flag[0] and alf_cccm_enabled. The current CTU uses ALF_CCCM filtering if and only if both alf_ctb_flag[0] and alf_cccm_enabled are 1. Otherwise, the current CTU does not perform ALF_CCCM filtering.

[0087] The third step is to divide the current CTU into several adjacent and non-overlapping blocks according to the syntax element alf_cccm_window_size_idx. For an introduction to the block size, please refer to the previous text, and it will not be repeated here.

[0088] The fourth step is to select the filter template for ALF_CCCM based on the syntax element alf_cccm_model_type_idx.

[0089] The fifth step is to downsample the brightness sample output by the front-end module for each CTU to obtain the downsampled brightness sample.

[0090] Step 6: For each block, use the downsampled luminance sample as input and the chrominance sample output from the previous module as output to construct the Wiener-Hopp equation and solve for the filtering coefficients of ALF_CCCM used in each block.

[0091] It should be noted that during the decoding process, the filter coefficients corresponding to the first chromaticity component and the second chromaticity component need to be calculated separately.

[0092] Part Three: ALF_CCCM Filtering

[0093] The first step is to determine whether the current CTU uses ALF_CCCM filtering based on the syntax elements alf_ctb_flag[0] and alf_cccm_enabled. The current CTU uses ALF_CCCM filtering if and only if both alf_ctb_flag[0] and alf_cccm_enabled are 1. Otherwise, the current CTU does not perform ALF_CCCM filtering.

[0094] The second step is to divide the current CTU into several adjacent and non-overlapping blocks according to the syntax element alf_cccm_window_size_idx. For an introduction to the block size, please refer to the previous text, which will not be repeated here.

[0095] The third step is to select the ALF_CCCM filter template based on the syntax element alf_cccm_model_type_idx.

[0096] The fourth step is to downsample the luminance sample output by ALF for each CTU to obtain the downsampled luminance sample.

[0097] Fifth, for each block, the downsampled luminance sample is used as input, and filtered using the ALF_CCCM filtering coefficients derived from the corresponding chrominance components to obtain the corresponding chrominance sample. The ALF_CCCM filtering formula is:

[0098] Where S represents the positions of the neighboring samples (x0, y0) of the sample to be filtered, and Coeff i The ALF_CCCM filter coefficients are obtained during the derivation process, and DownSampleLuma is the sample after downsampling the luminance sample output by the ALF filter.

[0099] The sixth step is to average the chromaticity sample values ​​obtained after CCCM filtering at the same position with the chromaticity sample values ​​output from the previous stage to obtain the ALF_CCCM filtered chromaticity sample values.

[0100] Step 7: Subtract the ALF_CCCM filtered chromaticity value from the previous input chromaticity value to obtain the ALF_CCCM filtered compensation value. Sum this compensation value with the chromaticity value output by the ALF filter and / or CCALF filter, and output the summation result to the reconstructed image.

[0101] Loop filtering is an important video encoding and decoding technique. However, in certain scenarios, this technique suffers from low filtering performance.

[0102] To address the aforementioned issues, this application provides an encoding method comprising: determining a first chromaticity value of a chromaticity sample of a current block based on a first loop filter; determining a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and determining a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0103] This application also provides a decoding method, comprising: determining a first chromaticity value of a chromaticity sample of a current block based on a first loop filter; determining a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and determining a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0104] The embodiments of this application correct the chromaticity values ​​determined based on the filter, thereby avoiding the occurrence of outliers and improving the filtering performance.

[0105] The decoding method provided in the embodiments of this application will be described in detail below with reference to Figure 4.

[0106] Figure 4 is a schematic flowchart of the decoding method provided in an embodiment of this application. The method shown in Figure 4 can be applied to a decoder.

[0107] Referring to Figure 4, in step S410, the first chromaticity value of the chromaticity sample of the current block is determined according to the first loop filter. The aforementioned first loop filter can be a filter used to perform sample point adaptive compensation operation, or it can be a filter used to perform cross-component sample point adaptive compensation operation.

[0108] The current block mentioned in the embodiments of this application can be a region within the current CTU. For example, the current CTU can be divided into several adjacent and non-overlapping blocks according to the second parameter mentioned later (such as alf_cccm_window_size_idx). The current block mentioned in the embodiments of this application can be any one of these several adjacent and non-overlapping blocks. Detailed descriptions are provided below and will not be elaborated here.

[0109] The first chromaticity value can be the chromaticity value of the chromaticity sample output by the first loop filter. Alternatively, the first chromaticity value can also be the chromaticity value after processing by other filters. For example, the first chromaticity value can be the chromaticity value after ALF and / or CCALF filtering.

[0110] In step S420, a second chromaticity value for the chromaticity sample of the current block is determined based on at least one adaptive filter. The at least one adaptive filter may be a filter performing an adaptive loop filtering operation. For example, the at least one adaptive filter may be an ALF. Alternatively, the at least one adaptive filter may be a CCALF. Or, the at least one adaptive filter may include both ALF and CCALF.

[0111] In step S430, a correction value for the chromaticity sample is determined based on the first chromaticity value and the second chromaticity value. In some embodiments, the correction value for the chromaticity sample can be determined based on the first chromaticity value, the second chromaticity value, and correction parameters (such as scaling parameters and / or bias parameters). For example, the first chromaticity value and the second chromaticity value can be averaged to determine a fourth chromaticity value; then, the difference between the fourth chromaticity value and the first chromaticity value can be calculated to determine a fifth chromaticity value; next, the fifth chromaticity value can be corrected to determine a sixth chromaticity value; and the sixth chromaticity value and the first chromaticity value can be summed to determine the correction value for the chromaticity sample.

[0112] The embodiments of this application correct the chromaticity values ​​determined based on the filter, thereby avoiding the occurrence of outliers and improving the filtering performance.

[0113] In some embodiments, the correction value of the chromaticity sample determined in step S430 can be used as the reconstructed value of the chromaticity sample. Alternatively, in other embodiments, after determining the correction value of the chromaticity sample, the correction value can be further processed to determine the reconstructed value of the chromaticity sample. For example, a third chromaticity value of the chromaticity sample can be determined based on the second loop filter; then, the reconstructed value of the chromaticity sample is determined based on the third chromaticity value and the correction value of the chromaticity sample.

[0114] The second loop filter mentioned above refers to a filter that performs filtering operations based on a cross-component model. In some embodiments, the second loop filter can be a CCCM-based filter. Alternatively, the second loop filter can also be a cross-component linear model (CCLM) based filter. As an example, the second loop filter is an ALF_CCCM filter.

[0115] Taking ALF_CCCM as the second filter and at least one adaptive filter including ALF and CCALF as an example, referring to Figure 5, the chromaticity values ​​(including the chromaticity values ​​of the cr component and the cb component) output by ALF and CCALF can be added together, and then the addition result is corrected (corresponding to the correction process for cb and cr in Figure 5). The corrected result is then averaged with the filtering result output by ALF_CCCM to obtain the output reconstructed chromaticity value (i.e., the sample values ​​of the output cr sample and cb sample in Figure 5).

[0116] The performance of the second-loop filter mentioned above and at least one adaptive filter (such as ALF and / or CCALF) mentioned above may overlap or influence each other. For example, if the second-loop filter is ALF_CCCM and the at least one adaptive filter is CCALF, both of which utilize information from the luminance samples, their outputs may contain redundancy. Considering this, a weighted sum can be performed on the third chrominance value determined based on the second-loop filter and the correction value of the chrominance sample determined based on the at least one adaptive filter. This weighted sum optimizes the final output, thereby further improving the decoding performance of the chrominance samples.

[0117] This application does not specifically limit the setting method of the weight parameters for the third chromaticity value and the correction value of the chromaticity sample in the embodiments. The following example, which takes the third chromaticity value corresponding to the first weight parameter and the correction value of the chromaticity sample corresponding to the second weight parameter, provides a more detailed illustration of how to determine the first weight parameter and the second weight parameter.

[0118] The first weight parameter and / or the second weight parameter can be represented by a numerical value (such as 1, 2, 3, 4, 5, etc.) or by a shift value (such as 1, 2, 4, 8, etc., that is, the value of the weight parameter represents the number of bits in the shift operation).

[0119] For example, suppose the first weight parameter is weight A, the second weight parameter is weight B, weight A is multiplied by the third chromaticity value (such as the sample value of the chromaticity sample obtained after ALF_CCCM filtering), weight B is multiplied by the correction value of the chromaticity sample (such as the sample value of the chromaticity sample output by ALF or / and CCALF), then the two multiplication results are summed, and the summation result is added to (A+B) / 2 (equivalent to performing a rounding operation on the summation result), finally, the summation result is divided by (A+B), and the division result is rounded and truncated.

[0120] For example, suppose the first weight parameter is weight A, the second weight parameter is weight B, and both weights A and B are shift values. The third chroma value (such as the sample value of the chroma sample obtained after ALF_CCCM filtering) can be shifted left by A positions, and the corrected value of the chroma sample (such as the sample value of the chroma sample output by ALF or / and CCALF) can be shifted left by B positions. Then, the sum of the two shift results is added to 1 << (A + B - 1) (equivalent to rounding the sum). Finally, the sum is shifted right by (A + B), and the shifted result is truncated.

[0121] It should be understood that the values ​​of the first weighting parameter and the second weighting parameter can be the same or different. If the values ​​of the first weighting parameter and the second weighting parameter are the same, it is equivalent to averaging the correction values ​​of the third chromaticity value and the chromaticity sample.

[0122] The values ​​of the first and second weighting parameters can be predefined. Alternatively, the values ​​of the first and second weighting parameters can be dynamically adjusted according to the actual situation.

[0123] In some embodiments, the values ​​of the first weight parameter and / or the second weight parameter are related to the type of the at least one adaptive filter mentioned above. For example, if the at least one adaptive filter is an ALF, the first weight parameter is a first value and / or the second weight parameter is a second value. As another example, if the at least one adaptive filter is a CCALF, the first weight parameter is a third value and / or the second weight parameter is a fourth value. Furthermore, if the at least one adaptive filter includes both ALF and CCALF, the first weight parameter is a fifth value and / or the second weight parameter is a sixth value.

[0124] Furthermore, in some embodiments, if at least one adaptive filter is not used, the value of the first weight parameter is set to a seventh value, and / or the value of the second weight parameter is set to an eighth value (in which case the eighth value may be, for example, 0).

[0125] The first, second, third, fourth, fifth, sixth, seventh, and eighth values ​​mentioned above can all be preset constants or determined according to certain calculation rules. This application does not limit this.

[0126] During the decoding process, the type of at least one adaptive filter can be determined based on the syntax elements in the bitstream. For example, the flag bits (or switches for ALF and / or CCALF) in the bitstream can be decoded to determine whether ALF and / or CCALF are used, and then the values ​​of the first weight parameter and / or the second weight parameter can be determined according to the above judgment logic.

[0127] The introduction of the first and second weighting parameters helps reduce the mutual influence between the filtering results of the second loop filter and the at least one adaptive filter, thereby improving the filtering performance of the chroma samples. Furthermore, by determining the values ​​of the first and / or second weighting parameters based on the type of the at least one adaptive filter, the weighting parameters do not need to be transmitted in the bitstream, thus reducing bitstream overhead.

[0128] Alternatively, in other embodiments, a first weight parameter and / or a second weight parameter can be carried in the bitstream. In this way, the decoding end does not need to determine the value of the weight parameter according to complex calculation rules, thereby reducing the decoding complexity.

[0129] The first and / or second weight parameters mentioned above can be the weight parameters of the current block. Different blocks have different weight parameters. That is, weight parameters can be determined for each block. This implementation may increase decoding complexity. Therefore, in some embodiments, the weight parameters of the chroma samples in the coding tree unit where the current block resides are the same. Alternatively, the first and / or second weight parameters mentioned above can be said to be common parameters (or shared parameters) of the chroma samples in the current CTU.

[0130] In other embodiments, the weight parameters of the chroma samples in the current slice containing the current block are the same. Alternatively, the first weight parameter and / or the second weight parameter can be described as common parameters (or shared parameters) of the chroma samples in the current slice.

[0131] In other embodiments, the weight parameters of the chroma samples in the current frame containing the current block are the same. Alternatively, the first weight parameter and / or the second weight parameter can be described as common parameters (or shared parameters) of the chroma samples in the current frame.

[0132] Taking the first weight parameter and the second weight parameter as parameters shared by the slice as an example, the following syntax elements can be added to the slice header of the bitstream to transmit the first weight parameter and the second weight parameter through the bitstream.

[0133] In the table above, alf_cccm_cb_weight_A and alf_cccm_cr_weight_A represent the first weight parameters of the Cb component and the Cr component, respectively, and alf_cccm_cb_weight_B and alf_cccm_cr_weight_B represent the second weight parameters of the Cb component and the Cr component, respectively.

[0134] As mentioned earlier, the bitstream may carry parameters indicating whether the parameters of the second loop filter used at the same position in the current frame and the reference frame are the same (such as inherit_from_ref_pic in Table 1 above). Combining Table 1 and the preceding description, it can be seen that this parameter is written in coding_tree_unit() in related technologies. However, judging from the meaning of this parameter, it is a frame-level parameter, and writing it in coding_tree_unit() is unreasonable. Repeatedly judging the value of this parameter in each CTU increases decoding overhead. Therefore, in some embodiments, the first parameter can be set in the slice header or picture header, making it a slice-level or picture-level parameter.

[0135] For example, you can add the following syntax elements to the slice header.

[0136] For example, the following syntax elements can be added to the picture header.

[0137] In addition, the following syntax elements in Table 1 can be deleted.

[0138] Related technologies mention that the filtering coefficients of ALF_CCCM are determined based on the luminance value of the current block and the chrominance value output by the preceding module (such as SAO and / or CCSAO). In the embodiments of this application, the filtering coefficients of the second loop filter (such as ALF_CCCM) can be determined based on the luminance value of the current block (the luminance value after sampling) and the chrominance value output by the preceding module (such as SAO and / or CCSAO) (such as the first chrominance value mentioned above). Alternatively, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block (the luminance value after sampling) and the second chrominance value (the chrominance value determined based on at least one adaptive filter (such as ALF and / or CCALF) mentioned above). Alternatively, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block (the luminance value after sampling) and the correction value of the chrominance sample mentioned in step S430. The second chrominance value or the correction value of the chrominance sample is more accurate than the chrominance value output by the preceding module, which can improve the accuracy of the filtering coefficients, thereby improving the filtering performance of the second loop filter. For example, the filter coefficients of the second loop filter can be determined by solving the Wiener-Hope equation based on the luminance and chrominance values ​​of the current block. Alternatively, the filter coefficients of the second loop filter can be determined by solving the Wiener-Hope equation based on the luminance value and the correction value of the chrominance sample of the current block.

[0139] For example, taking the second loop filter mentioned above as ALF_CCCM and at least one adaptive filter mentioned above as ALF as an example, for the current block, the downsampled luminance value can be used as input and the chrominance value output by ALF as output to construct the Wiener-Hopp equation and solve for the filter coefficients of the second loop filter.

[0140] For example, taking the second loop filter mentioned above as ALF_CCCM and at least one adaptive filter mentioned above as CCALF as an example, for the current block, the downsampled luminance value can be used as input and the chrominance value output by CCALF can be used as output to construct the Wiener-Hopp equation and solve for the filtering coefficients of the second loop filter.

[0141] For example, taking the second loop filter mentioned above as ALF_CCCM, and at least one adaptive filter mentioned above including ALF and CCALF as an example, the downsampled luminance value can be used as input, and the corrected value of the chromaticity sample output by ALF or / and CCALF can be used as output to construct the Wiener-Hopp equation and solve for the filter coefficients of the second loop filter.

[0142] In some embodiments, the size of the current block mentioned above can be determined by parameters in the decoded bitstream. For example, the bitstream can be decoded to determine the second parameter of the second loop filter. The second parameter can indicate the size of the current block. This second parameter can be, for example, alf_cccm_window_size_idx. This second parameter can include eight values: 4x4, 8x2, 2x8, 8x8, 16x16, 32x32, 64x64, or 128x128.

[0143] In some embodiments, the template type (or filter template, or model type) of the second loop filter mentioned above can be determined by parameters in the decoded bitstream. For example, the bitstream can be decoded to determine a third parameter of the second loop filter. This third parameter indicates the template type of the second loop filter. This third parameter could be, for example, alf_cccm_model_type_idx. This third parameter can include eight values, which can correspond to the eight filter templates (or models) shown in Table 2 above.

[0144] In some embodiments, whether to use a second loop filter can be determined based on certain conditions. For example, whether to use a second loop filter can be determined based on the indication of parameters in the bitstream. These parameters may include a fourth parameter and / or a fifth parameter, where the fourth parameter indicates whether the current coding tree unit performs an adaptive filtering operation, and the fifth parameter indicates whether the current coding tree unit performs a filtering operation based on a cross-component model. The fourth parameter may, for example, be alf_ctb_flag[0] mentioned above, and the fifth parameter may, for example, be alf_cccm_enabled mentioned above. For example, if both the fourth and fifth parameters are 1, then the second loop filter is used.

[0145] The decoding method provided by the embodiments of this application has been described in detail above with reference to Figure 4. The encoding method provided by the embodiments of this application has been described in detail below with reference to Figure 6.

[0146] Figure 6 is a flowchart illustrating the encoding method provided in an embodiment of this application. The method shown in Figure 6 can be applied to an encoder.

[0147] Referring to Figure 6, in step S610, the first chromaticity value of the chromaticity sample of the current block is determined according to the first loop filter. The aforementioned first loop filter can be a filter used to perform sample point adaptive compensation operation, or it can be a filter used to perform cross-component sample point adaptive compensation operation.

[0148] The current block mentioned in the embodiments of this application can be a region within the current CTU. For example, the current CTU can be divided into several adjacent and non-overlapping blocks according to the second parameter mentioned later (such as alf_cccm_window_size_idx). The current block mentioned in the embodiments of this application can be any one of these several adjacent and non-overlapping blocks. Detailed descriptions are provided below and will not be elaborated here.

[0149] The first chromaticity value can be the chromaticity value of the chromaticity sample output by the first loop filter. Alternatively, the first chromaticity value can also be the chromaticity value after processing by other filters. For example, the first chromaticity value can be the chromaticity value after ALF and / or CCALF filtering.

[0150] In step S620, a second chromaticity value for the chromaticity sample of the current block is determined based on at least one adaptive filter. The at least one adaptive filter may be a filter performing an adaptive loop filtering operation. For example, the at least one adaptive filter may be an ALF. Alternatively, the at least one adaptive filter may be a CCALF. Or, the at least one adaptive filter may include both ALF and CCALF.

[0151] In step S630, a correction value for the chromaticity sample is determined based on the first chromaticity value and the second chromaticity value. In some embodiments, the correction value for the chromaticity sample can be determined based on the first chromaticity value, the second chromaticity value, and correction parameters (such as scaling parameters and / or bias parameters). For example, the first chromaticity value and the second chromaticity value can be averaged to determine a fourth chromaticity value; then, the difference between the fourth chromaticity value and the first chromaticity value can be calculated to determine a fifth chromaticity value; next, the fifth chromaticity value can be corrected to determine a sixth chromaticity value; and the sixth chromaticity value and the first chromaticity value are summed to determine the correction value for the chromaticity sample.

[0152] The embodiments of this application correct the chromaticity values ​​determined based on the filter, thereby avoiding the occurrence of outliers and improving the filtering performance.

[0153] In some embodiments, the correction value of the chromaticity sample determined in step S630 can be used as the reconstructed value of the chromaticity sample. Alternatively, in other embodiments, after determining the correction value of the chromaticity sample, the correction value can be further processed to determine the reconstructed value of the chromaticity sample. For example, a third chromaticity value of the chromaticity sample can be determined based on the second loop filter; then, the reconstructed value of the chromaticity sample is determined based on the third chromaticity value and the correction value of the chromaticity sample.

[0154] The second loop filter mentioned above refers to a filter that performs filtering operations based on a cross-component model. In some embodiments, the second loop filter can be a CCCM-based filter. Alternatively, the second loop filter can also be a cross-component linear model (CCLM) based filter. As an example, the second loop filter is an ALF_CCCM filter.

[0155] Taking ALF_CCCM as the second filter and at least one adaptive filter including ALF and CCALF as an example, referring to Figure 5, the chromaticity values ​​(including the chromaticity values ​​of the cr component and the cb component) output by ALF and CCALF can be added together, and then the addition result is corrected (corresponding to the correction process for cb and cr in Figure 5). The corrected result is then averaged with the filtering result output by ALF_CCCM to obtain the output reconstructed chromaticity value (i.e., the sample values ​​of the output cr sample and cb sample in Figure 5).

[0156] The performance of the second-loop filter mentioned above and at least one adaptive filter (such as ALF and / or CCALF) mentioned above may overlap or influence each other. For example, if the second-loop filter is ALF_CCCM and the at least one adaptive filter is CCALF, both of which utilize information from the luminance samples, their outputs may contain redundancy. Considering this, a weighted sum can be performed on the third chroma value determined based on the second-loop filter and the correction value of the chroma sample determined based on the at least one adaptive filter. This weighted sum optimizes the final output, thereby further improving the coding performance of the chroma samples.

[0157] This application does not specifically limit the setting method of the weight parameters for the third chromaticity value and the correction value of the chromaticity sample in the embodiments. The following example, which takes the third chromaticity value corresponding to the first weight parameter and the correction value of the chromaticity sample corresponding to the second weight parameter, provides a more detailed illustration of how to determine the first weight parameter and the second weight parameter.

[0158] The first weight parameter and / or the second weight parameter can be represented by a numerical value (such as 1, 2, 3, 4, 5, etc.) or by a shift value (such as 1, 2, 4, 8, etc., that is, the value of the weight parameter represents the number of bits in the shift operation).

[0159] For example, suppose the first weight parameter is weight A, the second weight parameter is weight B, weight A is multiplied by the third chromaticity value (such as the sample value of the chromaticity sample obtained after ALF_CCCM filtering), weight B is multiplied by the correction value of the chromaticity sample (such as the sample value of the chromaticity sample output by ALF or / and CCALF), then the two multiplication results are summed, and the summation result is added to (A+B) / 2 (equivalent to performing a rounding operation on the summation result), finally, the summation result is divided by (A+B), and the division result is rounded and truncated.

[0160] For example, suppose the first weight parameter is weight A, the second weight parameter is weight B, and both weights A and B are shift values. The third chroma value (such as the sample value of the chroma sample obtained after ALF_CCCM filtering) can be shifted left by A positions, and the corrected value of the chroma sample (such as the sample value of the chroma sample output by ALF or / and CCALF) can be shifted left by B positions. Then, the sum of the two shift results is added to 1 << (A + B - 1) (equivalent to rounding the sum). Finally, the sum is shifted right by (A + B), and the shifted result is truncated.

[0161] It should be understood that the values ​​of the first weighting parameter and the second weighting parameter can be the same or different. If the values ​​of the first weighting parameter and the second weighting parameter are the same, it is equivalent to averaging the correction values ​​of the third chromaticity value and the chromaticity sample.

[0162] The values ​​of the first and second weighting parameters can be predefined. Alternatively, the values ​​of the first and second weighting parameters can be dynamically adjusted according to the actual situation.

[0163] In some embodiments, the values ​​of the first weight parameter and / or the second weight parameter are related to the type of the at least one adaptive filter mentioned above. For example, if the at least one adaptive filter is an ALF, the first weight parameter is a first value and / or the second weight parameter is a second value. As another example, if the at least one adaptive filter is a CCALF, the first weight parameter is a third value and / or the second weight parameter is a fourth value. Furthermore, if the at least one adaptive filter includes both ALF and CCALF, the first weight parameter is a fifth value and / or the second weight parameter is a sixth value.

[0164] Furthermore, in some embodiments, if at least one adaptive filter is not used, the value of the first weight parameter is set to a seventh value, and / or the value of the second weight parameter is set to an eighth value (in which case the eighth value may be, for example, 0).

[0165] The first, second, third, fourth, fifth, sixth, seventh, and eighth values ​​mentioned above can all be preset constants or determined according to certain calculation rules. This application does not limit this.

[0166] The introduction of the first and second weighting parameters helps reduce the mutual influence between the filtering results of the second loop filter and the at least one adaptive filter, thereby improving the filtering performance of the chroma samples. Furthermore, by determining the values ​​of the first and / or second weighting parameters based on the type of the at least one adaptive filter, the weighting parameters do not need to be transmitted in the bitstream, thus reducing bitstream overhead.

[0167] Alternatively, in other embodiments, a first weight parameter and / or a second weight parameter can be carried in the bitstream. In this way, the encoder does not need to determine the value of the weight parameter according to complex calculation rules, thereby reducing the encoding complexity.

[0168] The first and / or second weight parameters mentioned above can be the weight parameters of the current block. Different blocks have different weight parameters. That is, weight parameters can be determined for each block. This implementation may increase coding complexity. Therefore, in some embodiments, the weight parameters of the chroma samples in the coding tree unit where the current block resides are the same. Alternatively, the first and / or second weight parameters mentioned above can be said to be common parameters (or shared parameters) of the chroma samples in the current CTU.

[0169] In other embodiments, the weight parameters of the chroma samples in the current slice containing the current block are the same. Alternatively, the first weight parameter and / or the second weight parameter can be described as common parameters (or shared parameters) of the chroma samples in the current slice.

[0170] In other embodiments, the weight parameters of the chroma samples in the current frame containing the current block are the same. Alternatively, the first weight parameter and / or the second weight parameter can be described as common parameters (or shared parameters) of the chroma samples in the current frame.

[0171] Taking the first weight parameter and the second weight parameter as parameters shared by the slice as an example, the following syntax elements can be added to the slice header of the bitstream to transmit the first weight parameter and the second weight parameter through the bitstream.

[0172] In the table above, alf_cccm_cb_weight_A and alf_cccm_cr_weight_A represent the first weight parameters of the Cb component and the Cr component, respectively, and alf_cccm_cb_weight_B and alf_cccm_cr_weight_B represent the second weight parameters of the Cb component and the Cr component, respectively.

[0173] As mentioned earlier, the bitstream may carry parameters indicating whether the parameters of the second loop filter used at the same position in the current frame and the reference frame are the same (such as inherit_from_ref_pic in Table 1 above). Combining Table 1 and the preceding description, it can be seen that this parameter is written in coding_tree_unit() in related technologies. However, judging from the meaning of this parameter, it is a frame-level parameter, and writing it in coding_tree_unit() is unreasonable. Repeatedly judging the value of this parameter in each CTU increases coding overhead. Therefore, in some embodiments, the first parameter can be set in the slice header or picture header, making it a slice-level or picture-level parameter.

[0174] For example, you can add the following syntax elements to the slice header.

[0175] For example, the following syntax elements can be added to the picture header.

[0176] In addition, the following syntax elements in Table 1 can be deleted.

[0177] Related technologies mention that the filtering coefficients of ALF_CCCM are determined based on the luminance value of the current block and the chrominance value output by the preceding module (such as SAO and / or CCSAO). In the embodiments of this application, the filtering coefficients of the second loop filter (such as ALF_CCCM) can be determined based on the luminance value of the current block (the luminance value after sampling) and the chrominance value output by the preceding module (such as SAO and / or CCSAO) (such as the first chrominance value mentioned above). Alternatively, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block (the luminance value after sampling) and the second chrominance value (the chrominance value determined based on at least one adaptive filter (such as ALF and / or CCALF) mentioned above). Alternatively, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block (the luminance value after sampling) and the correction value of the chrominance sample mentioned in step S630. The second chrominance value or the correction value of the chrominance sample is more accurate than the chrominance value output by the preceding module, which can improve the accuracy of the filtering coefficients, thereby improving the filtering performance of the second loop filter. For example, the filter coefficients of the second loop filter can be determined by solving the Wiener-Hope equation based on the luminance and chrominance values ​​of the current block. Alternatively, the filter coefficients of the second loop filter can be determined by solving the Wiener-Hope equation based on the luminance value and the correction value of the chrominance sample of the current block.

[0178] For example, taking the second loop filter mentioned above as ALF_CCCM and at least one adaptive filter mentioned above as ALF as an example, for the current block, the downsampled luminance value can be used as input and the chrominance value output by ALF as output to construct the Wiener-Hopp equation and solve for the filter coefficients of the second loop filter.

[0179] For example, taking the second loop filter mentioned above as ALF_CCCM and at least one adaptive filter mentioned above as CCALF as an example, for the current block, the downsampled luminance value can be used as input and the chrominance value output by CCALF can be used as output to construct the Wiener-Hopp equation and solve for the filtering coefficients of the second loop filter.

[0180] For example, taking the second loop filter mentioned above as ALF_CCCM, and at least one adaptive filter mentioned above including ALF and CCALF as an example, the downsampled luminance value can be used as input, and the corrected value of the chromaticity sample output by ALF or / and CCALF can be used as output to construct the Wiener-Hopp equation and solve for the filter coefficients of the second loop filter.

[0181] In some embodiments, a second parameter of the second loop filter is written into the bitstream. The second parameter may indicate the size of the current block. For example, the second parameter may be `alf_cccm_window_size_idx`. This second parameter may include eight values: 4x4, 8x2, 2x8, 8x8, 16x16, 32x32, 64x64, or 128x128.

[0182] In some embodiments, a third parameter of the second loop filter is written into the bitstream. This third parameter indicates the template type of the second loop filter. For example, the third parameter could be `alf_cccm_model_type_idx`. This third parameter can include eight values, which can correspond to the eight filter templates (or models) shown in Table 2 above.

[0183] In some embodiments, a fourth parameter and / or a fifth parameter are written into the bitstream. The fourth parameter indicates whether the current coding tree unit performs an adaptive filtering operation, and the fifth parameter indicates whether the current coding tree unit performs a cross-component model-based filtering operation. The fourth parameter may be, for example, the previously mentioned alf_ctb_flag[0], and the fifth parameter may be, for example, the previously mentioned alf_cccm_enabled. For example, if both the fourth and fifth parameters are 1, then the second loop filter is used.

[0184] The embodiments of this application are described in more detail below from a decoding perspective, using specific examples. In the examples below, SAO / CCSAO / BIF corresponds to the first loop filter mentioned above, ALF_CCCM corresponds to the second loop filter mentioned above, and ALF and / or CCAFL corresponds to at least one adaptive filter mentioned above. It should be noted that the examples below are merely to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of this application to the specific values ​​or scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or variations based on the given examples, and such modifications or variations also fall within the scope of the embodiments of this application.

[0185] Example 1:

[0186] Analysis process:

[0187] Compared to the related technologies mentioned above, the parsing process in Implementation 1 moves the parsing of the syntax element inherit_from_ref_pic from the CTU level to the slice header or picture header.

[0188] Decoding process:

[0189] The first step is to determine whether the current CTU uses ALF_CCCM filtering based on the syntax elements alf_ctb_flag[0] and alf_cccm_enabled. The current CTU uses ALF_CCCM filtering only if both alf_ctb_flag[0] and alf_cccm_enabled are 1. Otherwise, the current CTU does not perform ALF_CCCM filtering.

[0190] The second step is to divide the current CTU into several adjacent and non-overlapping blocks according to the syntax element alf_cccm_window_size_idx. For an introduction to the block size, please refer to the relevant technology, which will not be repeated here.

[0191] The third step is to select the ALF_CCCM filter template based on the syntax element alf_cccm_model_type_idx.

[0192] The fourth step is to downsample the luminance sample output by TALF for each CTU to obtain the downsampled luminance sample.

[0193] The fifth step is to use the downsampled luminance sample as input for each block, and then filter it using the filtering coefficients of the CCCM filter derived from the corresponding chrominance component to obtain the corresponding chrominance sample.

[0194] Step 6: The average of the chromaticity samples obtained after CCCM filtering at the same location and the corrected chromaticity samples from the ALF filter and / or CCALF filter is then output to the reconstructed image. The correction operations include, but are not limited to, multiplying the temporary chromaticity samples or their compensation values ​​by: 1) a scaling factor, 2) adding a bias factor, and 3) multiplying by a scaling factor and adding a bias factor. The position of the correction process within the overall process can be seen in Figure 5.

[0195] Compared with related technologies, the performance data of the solution in Embodiment 1 mentioned above is as follows:

[0196] As can be seen from the above performance data, Example 1 has improved filtering performance compared to related technologies.

[0197] The method embodiments of this application have been described in detail above with reference to Figures 1 to 6. The apparatus embodiments of this application will be described in detail below with reference to Figures 7 to 10. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be referred to the preceding method embodiments.

[0198] Figure 7 is a schematic diagram of the decoder provided in one embodiment of this application. The decoder 700 shown in Figure 7 includes a first determining unit 710, a second determining unit 720, and a third determining unit 730. The first determining unit 710 is configured to determine a first chromaticity value of the chromaticity sample of the current block based on a first loop filter; the second determining unit 720 is configured to determine a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and the third determining unit 730 is configured to determine a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0199] In some embodiments, the third determining unit 730 is further configured to determine the correction value of the chromaticity sample based on the first chromaticity value, the second chromaticity value, and the correction parameter.

[0200] In some embodiments, the correction parameters include scaling parameters and / or bias parameters.

[0201] In some embodiments, the decoder further includes: a fourth determining unit configured to determine a third chromaticity value of the chromaticity sample based on a second loop filter, the second loop filter being used to perform a filtering operation based on a cross-component model; and to determine a reconstructed value of the chromaticity sample based on the third chromaticity value and a correction value of the chromaticity sample.

[0202] In some embodiments, the reconstructed value of the chromaticity sample is the average of the third chromaticity value and the corrected value of the chromaticity sample.

[0203] In some embodiments, the third chromaticity value corresponds to a first weighting parameter, the correction value of the chromaticity sample corresponds to a second weighting parameter, and the reconstructed value of the chromaticity sample is determined based on the first weighting parameter and the second weighting parameter.

[0204] In some embodiments, the values ​​of the first weight parameter and / or the second weight parameter are related to the type of the at least one adaptive filter.

[0205] In some embodiments, the at least one adaptive filter is an adaptive loop filter, wherein the first weight parameter is a first value and / or the second weight parameter is a second value; or, the at least one adaptive filter is a cross-component adaptive loop filter, wherein the first weight parameter is a third value and / or the second weight parameter is a fourth value; or, the at least one adaptive filter includes an adaptive loop filter and a cross-component adaptive loop filter, wherein the first weight parameter is a fifth value and / or the second weight parameter is a sixth value.

[0206] In some embodiments, the first weight parameter and / or the second weight parameter are weight parameters carried in the bitstream.

[0207] In some embodiments, the weight parameters of the chroma samples in the coding tree unit where the current block is located are the same; or, the weight parameters of the chroma samples in the current strip where the current block is located are the same; or, the weight parameters of the chroma samples in the current frame where the current block is located are the same.

[0208] In some embodiments, the filtering operation based on the cross-component model is a filtering operation based on the cross-component convolution model.

[0209] In some embodiments, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block and the second chrominance value; or, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block and the correction value of the chrominance sample.

[0210] In some embodiments, the decoder further includes: a first decoding unit configured to solve for the filtering coefficients of the second loop filter based on the luminance value of the current block and the second chrominance value; or to solve for the filtering coefficients of the second loop filter based on the luminance value of the current block and the correction value of the chrominance sample.

[0211] In some embodiments, the decoder further includes: a second decoding unit configured to decode a bitstream and determine a first parameter, the first parameter being used to indicate whether the parameters of the second filter used at the same position in the current frame and the reference frame are the same.

[0212] In some embodiments, the first parameter is a parameter in the strip header or image header.

[0213] In some embodiments, the decoder further includes: a third decoding unit configured to decode the bitstream and determine a second parameter and / or a third parameter of the second loop filter; wherein the second parameter is used to indicate the size of the current block and the third parameter is used to indicate the template type of the second filter.

[0214] In some embodiments, the decoder further includes: a fourth decoding unit configured to decode the bitstream and determine a fourth parameter and / or a fifth parameter; wherein the fourth parameter is used to indicate whether the current coding tree unit performs an adaptive filtering operation, and the fifth parameter is used to indicate whether the current coding tree unit performs a filtering operation based on a cross-component model.

[0215] In some embodiments, the at least one adaptive filter includes an adaptive loop filter and / or a cross-component adaptive loop filter.

[0216] In some embodiments, the first loop filter is used to perform sample point adaptive compensation operation or cross-component sample point adaptive compensation operation.

[0217] Understandably, in the embodiments of this 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 one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0218] If the integrated unit is implemented as a software functional module and 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, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0219] Therefore, embodiments of this application provide a computer-readable storage medium for use with a decoder, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, implements the decoding method described in the first embodiment.

[0220] Based on the composition of the decoder 700 described above and the computer-readable storage medium, refer to Figure 8, which shows a schematic diagram of the specific hardware structure of the decoder 800 provided in this embodiment of the application. As shown in Figure 8, the decoder 800 may include: a communication interface 810, a memory 820, and a processor 830; the various components are coupled together through a bus system 840. It is understood that the bus system 840 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 840 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 840 in Figure 8.

[0221] The communication interface 810 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0222] Memory 820 is used to store computer programs;

[0223] Processor 830, when running the computer program, performs the following:

[0224] The first chromaticity value of the chromaticity sample of the current block is determined based on the first loop filter;

[0225] The second chromaticity value of the chromaticity sample is determined according to at least one adaptive filter;

[0226] The correction value of the chromaticity sample is determined based on the first chromaticity value and the second chromaticity value.

[0227] It is understood that the memory 820 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 820 of the systems and methods described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0228] The processor 830 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 830 or by software instructions. The processor 830 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 820. Processor 830 reads the information in memory 820 and, in conjunction with its hardware, completes the steps of the above method.

[0229] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0230] Alternatively, as another embodiment, the processor 830 is also configured to execute the decoding method described in the foregoing embodiments when running the computer program.

[0231] Figure 9 is a schematic diagram of an encoder provided in one embodiment of this application. The encoder 900 shown in Figure 9 may include a first determining unit 910, a second determining unit 920, and a third determining unit 930. The first determining unit 910 is configured to determine a first chromaticity value of the chromaticity sample of the current block based on a first loop filter; the second determining unit 920 is configured to determine a second chromaticity value of the chromaticity sample based on at least one adaptive filter; and the third determining unit 930 is configured to determine a correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

[0232] In some embodiments, the third determining unit 930 is configured to determine the correction value of the chromaticity sample based on the first chromaticity value, the second chromaticity value, and the correction parameter.

[0233] In some embodiments, the correction parameters include scaling parameters and / or bias parameters.

[0234] In some embodiments, the encoder further includes: a fourth determining unit configured to determine a third chromaticity value of the chromaticity sample based on a second loop filter, the second loop filter being used to perform a filtering operation based on a cross-component model; and to determine a reconstructed value of the chromaticity sample based on the third chromaticity value and a correction value of the chromaticity sample.

[0235] In some embodiments, the reconstructed value of the chromaticity sample is the average of the third chromaticity value and the corrected value of the chromaticity sample.

[0236] In some embodiments, the third chromaticity value corresponds to a first weighting parameter, the correction value of the chromaticity sample corresponds to a second weighting parameter, and the reconstructed value of the chromaticity sample is determined based on the first weighting parameter and the second weighting parameter.

[0237] In some embodiments, the values ​​of the first weight parameter and / or the second weight parameter are related to the type of the at least one adaptive filter.

[0238] In some embodiments, the at least one adaptive filter is an adaptive loop filter, wherein the first weight parameter is a first value and / or the second weight parameter is a second value; or, the at least one adaptive filter is a cross-component adaptive loop filter, wherein the first weight parameter is a third value and / or the second weight parameter is a fourth value; or, the at least one adaptive filter includes an adaptive loop filter and a cross-component adaptive loop filter, wherein the first weight parameter is a fifth value and / or the second weight parameter is a sixth value.

[0239] In some embodiments, the first weight parameter and / or the second weight parameter are weight parameters carried in the bitstream.

[0240] In some embodiments, the weight parameters of the chroma samples in the coding tree unit where the current block is located are the same; or, the weight parameters of the chroma samples in the current strip where the current block is located are the same; or, the weight parameters of the chroma samples in the current frame where the current block is located are the same.

[0241] In some embodiments, the filtering operation based on the cross-component model is a filtering operation based on the cross-component convolution model.

[0242] In some embodiments, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block and the second chrominance value; or, the filtering coefficients of the second loop filter are determined based on the luminance value of the current block and the correction value of the chrominance sample.

[0243] In some embodiments, the encoder includes: a first encoding unit configured to solve for the filtering coefficients of the second loop filter based on the luminance value of the current block and the second chrominance value; or, to solve for the filtering coefficients of the second loop filter based on the luminance value of the current block and the correction value of the chrominance sample.

[0244] In some embodiments, the encoder includes: a second encoding unit configured to write a first parameter into the bitstream, the first parameter being used to indicate whether the parameters of the second filter used at the same position in the current frame and the reference frame are the same.

[0245] In some embodiments, the first parameter is a parameter in the strip header or image header.

[0246] In some embodiments, the encoder includes: a third encoding unit configured to write a second parameter and / or a third parameter of the second loop filter into the bitstream; wherein the second parameter is used to indicate the size of the current block, and the third parameter is used to indicate the template type of the second filter.

[0247] In some embodiments, the encoder includes: a fourth encoding unit configured to write a fourth parameter and / or a fifth parameter into the bitstream;

[0248] The fourth parameter is used to indicate whether the current coding tree unit performs an adaptive filtering operation, and the fifth parameter is used to indicate whether the current coding tree unit performs a filtering operation based on a cross-component model.

[0249] In some embodiments, the at least one adaptive filter includes an adaptive loop filter and / or a cross-component adaptive loop filter.

[0250] In some embodiments, the first loop filter is used to perform sample point adaptive compensation operation or cross-component sample point adaptive compensation operation.

[0251] Understandably, in the embodiments of this 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 one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0252] If the integrated unit is implemented as a software functional module and 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, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0253] Therefore, embodiments of this application provide a computer-readable storage medium applied to an encoder, wherein the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the decoding method described in any of the foregoing embodiments.

[0254] Based on the composition of the encoder 900 described above and the computer-readable storage medium, refer to Figure 10, which shows a schematic diagram of the specific hardware structure of the encoder 1000 provided in this embodiment of the application. As shown in Figure 10, the encoder 1000 may include: a communication interface 1010, a memory 1020, and a processor 1030; the various components are coupled together through a bus system 1040. It is understood that the bus system 1040 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 1040 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1040 in Figure 10.

[0255] The communication interface 1010 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0256] Memory 1020 is used to store computer programs;

[0257] Processor 1030, when running the computer program, performs the following:

[0258] The first chromaticity value of the chromaticity sample of the current block is determined based on the first loop filter;

[0259] The second chromaticity value of the chromaticity sample is determined according to at least one adaptive filter;

[0260] The correction value of the chromaticity sample is determined based on the first chromaticity value and the second chromaticity value.

[0261] It is understood that the memory 1020 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1020 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0262] The processor 1030 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1030 or by instructions in software form. The processor 1030 may 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1020. Processor 1030 reads the information in memory 1020 and completes the steps of the above method in conjunction with its hardware.

[0263] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0264] Alternatively, as another embodiment, the processor 1030 is also configured to execute the encoding method in the foregoing embodiments when running the computer program.

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

[0266] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

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

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

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

[0270] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A decoding method, applied to a decoder, comprising: The first chromaticity value of the chromaticity sample of the current block is determined based on the first loop filter; The second chromaticity value of the chromaticity sample is determined according to at least one adaptive filter; The correction value of the chromaticity sample is determined based on the first chromaticity value and the second chromaticity value.

2. The method according to claim 1, characterized in that, Determining the correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value includes: The correction value of the chromaticity sample is determined based on the first chromaticity value, the second chromaticity value, and the correction parameter.

3. The method according to claim 2, characterized in that, The correction parameters include scaling parameters and / or bias parameters.

4. The method according to any one of claims 1 to 3, further comprising: The third chromaticity value of the chromaticity sample is determined according to the second loop filter, which is used to perform a filtering operation based on the cross-component model; The reconstructed value of the chromaticity sample is determined based on the third chromaticity value and the correction value of the chromaticity sample.

5. The method according to claim 4, wherein, The reconstructed value of the chromaticity sample is the average of the third chromaticity value and the corrected value of the chromaticity sample.

6. The method according to claim 4, wherein, The third chromaticity value corresponds to the first weighting parameter, the correction value of the chromaticity sample corresponds to the second weighting parameter, and the reconstructed value of the chromaticity sample is determined based on the first weighting parameter and the second weighting parameter.

7. The method according to claim 6, wherein, The values ​​of the first weight parameter and / or the second weight parameter are related to the type of the at least one adaptive filter.

8. The method according to claim 7, wherein: The at least one adaptive filter is an adaptive loop filter, wherein the first weight parameter takes the value of a first value and / or the second weight parameter takes the value of a second value; or, The at least one adaptive filter is a cross-component adaptive loop filter, wherein the first weight parameter is a third value and / or the second weight parameter is a fourth value; or, The at least one adaptive filter includes an adaptive loop filter and a cross-component adaptive loop filter, wherein the first weight parameter is a fifth value and / or the second weight parameter is a sixth value.

9. The method according to claim 6, wherein, The first weight parameter and / or the second weight parameter are weight parameters carried in the bitstream.

10. The method according to claim 6, wherein: The weight parameters of the chroma samples in the coding tree unit where the current block is located are the same; or, The weight parameters of the chroma samples in the current strip where the current block is located are the same; or... The weight parameters of the chroma samples in the current frame where the current block is located are the same.

11. The method according to any one of claims 4 to 10, wherein, The filtering operation based on the cross-component model is a filtering operation based on the cross-component convolution model.

12. The method according to any one of claims 4 to 11, wherein: The filter coefficients of the second loop filter are determined based on the luminance value of the current block and the second chrominance value; or, The filtering coefficients of the second loop filter are determined based on the luminance value of the current block and the correction value of the chrominance sample.

13. The method according to claim 12, wherein, The method includes: Based on the luminance value of the current block and the second chrominance value, solve for the filter coefficients of the second loop filter; or, The filtering coefficients of the second loop filter are calculated based on the luminance value of the current block and the correction value of the chroma sample.

14. The method according to any one of claims 4 to 13, wherein, The method further includes: Decode the bitstream and determine the first parameter, which indicates whether the parameters of the second filter used at the same position in the current frame and the reference frame are the same.

15. The method according to claim 14, wherein, The first parameter is a parameter in the strip header or image header.

16. The method according to any one of claims 4 to 15, wherein, The method further includes: Decode the bitstream to determine the second and / or third parameters of the second loop filter; The second parameter indicates the size of the current block, and the third parameter indicates the template type of the second filter.

17. The method of any one of claims 4 to 16, wherein, The method further includes: Decode the bitstream to determine the fourth and / or fifth parameters; The fourth parameter is used to indicate whether the current coding tree unit performs an adaptive filtering operation, and the fifth parameter is used to indicate whether the current coding tree unit performs a filtering operation based on a cross-component model.

18. The method according to any one of claims 1 to 17, wherein, The at least one adaptive filter includes an adaptive loop filter and / or a cross-component adaptive loop filter.

19. The method according to any one of claims 1 to 18, wherein, The first loop filter is used to perform sample point adaptive compensation operation or cross-component sample point adaptive compensation operation.

20. An encoding method applied to an encoder, comprising: The first chromaticity value of the chromaticity sample of the current block is determined based on the first loop filter; The second chromaticity value of the chromaticity sample is determined according to at least one adaptive filter; The correction value of the chromaticity sample is determined based on the first chromaticity value and the second chromaticity value.

21. The method of claim 20, wherein, Determining the correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value includes: The correction value of the chromaticity sample is determined based on the first chromaticity value, the second chromaticity value, and the correction parameter.

22. The method according to claim 21, characterized in that, The correction parameters include scaling parameters and / or bias parameters.

23. The method according to any one of claims 20 to 22, further comprising: The third chromaticity value of the chromaticity sample is determined according to the second loop filter, which is used to perform a filtering operation based on the cross-component model; The reconstructed value of the chromaticity sample is determined based on the third chromaticity value and the correction value of the chromaticity sample.

24. The method of claim 23, wherein, The reconstructed value of the chromaticity sample is the average of the third chromaticity value and the corrected value of the chromaticity sample.

25. The method of claim 23, wherein, The third chromaticity value corresponds to the first weighting parameter, the correction value of the chromaticity sample corresponds to the second weighting parameter, and the reconstructed value of the chromaticity sample is determined based on the first weighting parameter and the second weighting parameter.

26. The method of claim 25, wherein, The values ​​of the first weight parameter and / or the second weight parameter are related to the type of the at least one adaptive filter.

27. The method according to claim 26, wherein: The at least one adaptive filter is an adaptive loop filter, wherein the first weight parameter takes the value of a first value and / or the second weight parameter takes the value of a second value; or, The at least one adaptive filter is a cross-component adaptive loop filter, wherein the first weight parameter is a third value and / or the second weight parameter is a fourth value; or, The at least one adaptive filter includes an adaptive loop filter and a cross-component adaptive loop filter, wherein the first weight parameter is a fifth value and / or the second weight parameter is a sixth value.

28. The method of claim 25, wherein, The first weight parameter and / or the second weight parameter are weight parameters carried in the bitstream.

29. The method according to claim 25, wherein: The weight parameters of the chroma samples in the coding tree unit where the current block is located are the same; or, The weight parameters of the chroma samples in the current strip where the current block is located are the same; or... The weight parameters of the chroma samples in the current frame where the current block is located are the same.

30. The method according to any one of claims 23 to 29, wherein, The filtering operation based on the cross-component model is a filtering operation based on the cross-component convolution model.

31. The method according to any one of claims 23 to 30, wherein: The filter coefficients of the second loop filter are determined based on the luminance value of the current block and the second chrominance value; or, The filtering coefficients of the second loop filter are determined based on the luminance value of the current block and the correction value of the chrominance sample.

32. The method of claim 31, wherein, The method includes: Based on the luminance value of the current block and the second chrominance value, solve for the filter coefficients of the second loop filter; or, The filtering coefficients of the second loop filter are calculated based on the luminance value of the current block and the correction value of the chroma sample.

33. The method according to any one of claims 33 to 32, wherein, The method further includes: Write the first parameter into the bitstream. The first parameter is used to indicate whether the parameters of the second filter used at the same position in the current frame and the reference frame are the same.

34. The method of claim 33, wherein, The first parameter is a parameter in the strip header or image header.

35. The method according to any one of claims 23 to 34, wherein, The method further includes: Write the second and / or third parameters of the second loop filter into the bitstream; The second parameter indicates the size of the current block, and the third parameter indicates the template type of the second filter.

36. The method according to any one of claims 23 to 35, wherein, The method further includes: Write the fourth and / or fifth parameters into the bitstream; The fourth parameter is used to indicate whether the current coding tree unit performs an adaptive filtering operation, and the fifth parameter is used to indicate whether the current coding tree unit performs a filtering operation based on a cross-component model.

37. The method of any one of claims 20 to 36, wherein, The at least one adaptive filter includes an adaptive loop filter and / or a cross-component adaptive loop filter.

38. The method of any one of claims 20 to 37, wherein, The first loop filter is used to perform sample point adaptive compensation operation or cross-component sample point adaptive compensation operation.

39. A decoder, comprising: The first determining unit is configured to determine the first chromaticity value of the chromaticity sample of the current block based on the first loop filter; The second determining unit is configured to determine a second chromaticity value of the chromaticity sample based on at least one adaptive filter; The third determining unit is configured to determine the correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

40. A decoder, the decoder comprising: Memory, used to store computer programs; A processor, configured to perform the method as described in any one of claims 1 to 19 when running the computer program.

41. An encoder, comprising: The first determining unit is configured to determine the first chromaticity value of the chromaticity sample of the current block based on the first loop filter; The second determining unit is configured to determine a second chromaticity value of the chromaticity sample based on at least one adaptive filter; The third determining unit is configured to determine the correction value of the chromaticity sample based on the first chromaticity value and the second chromaticity value.

42. An encoder, the encoder comprising: Memory, used to store computer programs; A processor, configured to perform the method as described in any one of claims 20 to 38 when running the computer program.

43. A non-volatile computer-readable storage medium for storing a bitstream, said bitstream being generated by an encoding method using an encoder, or said bitstream being decoded by a decoding method using a decoder, wherein, The decoding method is the method as described in any one of claims 1 to 19, and the encoding method is the method as described in any one of claims 20 to 38.

44. A bitstream comprising a bitstream generated by the method of any one of claims 20 to 38.

45. A computer readable storage medium, wherein, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 19, or the method as described in any one of claims 20 to 38.