Video processing method and stream generation method

Optimized in-loop filtering using cross-component adaptive loop filters addresses compression distortions in video coding, enhancing image quality and reducing complexity in video encoding/decoding processes.

JP2026041811APending Publication Date: 2026-03-10SZ DJI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Current video coding standards like H.264/MPEG-AVC, H.265/MPEG-HEVC, AVS2, and emerging technologies like VVC/AVS3 face challenges in reducing compression distortions such as block effects and ringing effects, which affect the quality of decoded images and require complex and time-consuming adaptive loop filtering.

Method used

The method involves optimizing in-loop filtering by determining a target filter for the chrominance component using cross-component adaptive loop filters (ALF), calculating filtering coefficients based on luma and chrominance components, and encoding these filters efficiently in the bitstream to reduce complexity and improve filtering efficacy.

Benefits of technology

This approach enhances coding/decoding performance by simplifying the filtering process and improving image quality while reducing computational overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026041811000001_ABST
    Figure 2026041811000001_ABST
Patent Text Reader

Abstract

A cross-component (CC) adaptive loop filtering (ALF) filter method is provided. [Solution] A CCALF for the chrominance components of a current block of an image is determined from multiple CCALFs, target CCALF coefficients for the chrominance components of the current block are determined based on the chrominance components that have undergone ALF and the luma component of the current block that has not undergone ALF, the chrominance components that have undergone ALF are filtered based on the target CCALF and the target CCALF coefficients, and filtered chrominance components of the current block are determined based on the filtered chrominance components and the chrominance components that have undergone ALF. The target CCALF is a 3x4 diamond, and is coded using the filtered chrominance components of the current block, the total number of multiple CCALFs, the index of the target CCALF, and the target CCALF coefficients as syntax elements.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] Copyright Statement The subject matter disclosed by this patent document contains material protected by copyright, which copyright is owned by the copyright owner. The copyright owner has no objection to anyone copying this patent document or the patent disclosure as it appears in the official records of the Trademark Office and in the public archives.

[0002] The present invention relates to the field of digital video coding, and more particularly to a method and apparatus for in-loop filtering. [Background technology]

[0003] Currently, in order to reduce the bandwidth required for video storage and transmission, video data needs to be coded and compressed. In current conventional coding technology, the video coding and compression process includes block segmentation, prediction, transformation, quantization, and entropy coding processes to form a mixed video coding frame. Based on this mixed video coding frame, after more than a decade of development, video coding and decoding technology standards have gradually been formed. Currently, several mainstream video coding and decoding standards include the international video coding standards H.264 / MPEG-AVC and H.265 / MPEG-HEVC, the domestic audio and video coding standard AVS2, and the H.266 / VVC international standard and the AVS3 domestic standard, which are currently under development.

[0004] In the coding process of block division, prediction, transformation, quantization, and entropy coding, due to the existence of quantization, compression distortions such as block effect and ringing effect will exist in the decoded reconstructed video. In addition, in the inter-frame prediction mode, the compression distortion in the reconstructed video will affect the coding quality of subsequent images. Therefore, in order to reduce the compression distortion, an in-loop filter technology is introduced into the coding / decoding structure frame to improve the quality of the current decoded image and provide a high-quality reference image for subsequent coded images, thereby improving compression efficiency.

[0005] In the Versatile Video Coding (VVC) standard and the High Efficiency Video Coding (HEVC) standard, which are currently being developed, loop filters include a deblocking filter (DBF), a sample adaptive offset (SAO), and an adaptive loop filter (ALF). However, there is still room for improvement in the filtering process. Summary of the Invention [Means for solving the problem]

[0006] The present invention provides a method and apparatus for in-loop filtering, which can reduce the complexity of in-loop filtering and improve the filtering effect compared with the prior art.

[0007] In a first aspect, there is provided a method of in-loop filtering, the method comprising: determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block according to the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF; encoding the current block based on the filtered chrominance components, and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in the bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.

[0008] In a second aspect, there is provided a method of in-loop filtering, the method comprising: Decoding the total number of cross-component ALF filters and the index of the target filter from the bitstream, the target filter being the ALF filter adopted for the chrominance component of the current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF;

[0009] In a third aspect, there is provided an apparatus for in-loop filtering, the apparatus comprising: a memory for storing the code; Executing the code stored in the memory determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block according to the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF; and a processor for performing the steps of: encoding the current block based on the filtered chrominance components; and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.

[0010] In a fourth aspect, there is provided an apparatus for in-loop filtering, the apparatus comprising: a memory for storing the code; Executing the code stored in the memory Decoding the total number of cross-component ALF filters and the index of the target filter from the bitstream, the target filter being the ALF filter adopted for the chrominance component of the current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; and determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF.

[0011] The technical method of the embodiments of the present application improves the coding / decoding performance by optimizing the coding scheme in the coding / decoding loop filtering process. [Brief explanation of the drawings]

[0012] [Figure 1] FIG. 1 is a block diagram of a technical solution using an embodiment of the present application. [Figure 2] 1 is a schematic diagram of a video coding frame according to an embodiment of the present application; [Figure 3] FIG. 2 is a schematic diagram of a video decoding frame according to an embodiment of the present application; [Figure 4] FIG. 1 is a schematic diagram of a Wiener filter according to an embodiment of the present application. [Figure 5a] FIG. 1 is a schematic diagram of an ALF filter according to an embodiment of the present application. [Figure 5b] FIG. 10 is a schematic diagram of another ALF filter according to another embodiment of the present application. [Figure 6] 1 is a schematic flowchart of a method for in-loop filtering in an embodiment of the present application; [Figure 7] 1 is a schematic diagram showing the shape of a CC-ALF filter according to an embodiment of the present application. [Figure 8] 1 is a schematic flowchart of a method for in-loop filtering in another embodiment of the present application; [Figure 9] 1 is a schematic flowchart of a method for in-loop filtering in another embodiment of the present application; [Figure 10] 1 is a schematic flow chart of an apparatus for in-loop filtering in another embodiment of the present application; [Figure 11] 1 is a schematic flow chart of an apparatus for in-loop filtering in another embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION

[0013] The technical solutions in the embodiments of the present application are described below with reference to the drawings.

[0014] The embodiments of the present application can be applied to standard or non-standard image or video encoders, for example encoders of the VVC standard.

[0015] It should be understood that the specific examples in this specification are intended to help those skilled in the art better understand the embodiments of the present application, and do not limit the scope of the embodiments of the present application.

[0016] Furthermore, it should be understood that the formulas in the examples of the present application are merely illustrative and do not limit the scope of the examples of the present application, and that each formula can be modified, and these modifications also fall within the scope of protection of the present application.

[0017] Furthermore, in each embodiment of the present application, the size of the number of each process does not mean the order of execution, and the execution order of each process is determined by its function and inherent logic, and it should be understood that this does not impose any limitations on the implementation process of the embodiments of the present application.

[0018] Furthermore, it is to be understood that the various embodiments described herein can be practiced alone or in combination, and that the present application is not limited thereto.

[0019] Unless otherwise specified, all technical and scientific terms used in the examples of this application have the same meaning as commonly understood by those skilled in the art of this application. The technical terms used in the specification of this application are for the purpose of describing specific examples only and are not intended to limit the scope of this application. The term "at least one" as used in this application includes any and all combinations of one or more of the associated listed items.

[0020] FIG. 1 is a block diagram of the technical solution using the embodiments of the present application.

[0021] As shown in FIG. 1 , the system 100 can receive data to be processed 102, process the data to be processed 102, and generate processed data 108. For example, the system 100 can receive data to be encoded and encode the data to be encoded to generate encoded data, or the system 100 can receive data to be decoded and decode the data to be decoded to generate decoded data. In some embodiments, components in the system 100 can be implemented by one or more processors, which can be processors in a computer system or a mobile system (e.g., an unmanned aerial vehicle). The processor can be any type of processor, and embodiments of the present invention are not limited thereto. In some possible designs, the processor can include an encoder, a decoder, or a coder-decoder. The system 100 can further include one or more memories. The memories can store commands and data, such as computer-executable commands for implementing the technical solutions of embodiments of the present invention, the data to be processed 102, and the processed data 108. The memories can be any type of memory, and embodiments of the present invention are not limited thereto.

[0022] The data to be encoded may include documents, images, graphic objects, video sequences, audio, video, or any other data that needs to be encoded. In some situations, the data to be encoded may include sensing data from a sensor, which may be a visual sensor (e.g., a camera, an infrared sensor), a microphone, a short-range sensor (e.g., an ultrasonic sensor, a radar), a position sensor, a temperature sensor, a touch sensor, etc. In some situations, the data to be encoded may include information from a user, for example, bioinformation, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA samples, etc.

[0023] 2 is a schematic diagram of a video encoding frame 2 according to an embodiment of the present application. As shown in FIG. 2, after receiving a video to be encoded, each frame in the video to be encoded is sequentially encoded starting from the first frame of the video to be encoded. Here, the currently encoded frame mainly undergoes processes such as prediction, transformation, quantization, and entropy coding, and finally outputs a bitstream of the currently encoded frame. Correspondingly, the decoding process generally follows the reverse process of the above process to decode the received bitstream and recover the video frame information before decoding.

[0024] Specifically, as shown in Fig. 2, the video coding frame 2 has a coding control module 201 for determining control operations and selecting parameters in the coding process. For example, as shown in Fig. 2, the coding control module 201 controls parameters used in transform, quantization, dequantization, and inverse transform, controls the selection of intra-frame or inter-frame mode, and controls parameters of motion prediction and filters, and the control parameters of the coding control module 201 are also input into the entropy coding module, which encodes them and forms part of the coded bitstream.

[0025] Encoding begins with a current frame to be coded, and the frame to be coded is divided (202), specifically, first divided into slices and then into blocks. Optionally, in one example, the frame to be coded is divided into multiple non-overlapping maximum coding tree units (CTUs), and each CTU is further divided into a series of smaller coding units (CUs) iteratively according to a quadtree, binary tree, or ternary tree scheme. In some examples, a CU may further have a prediction unit (PU) and a transform unit (TU) associated therewith, where a PU is a basic unit of prediction and a TU is a basic unit of transformation and quantization. In some examples, a PU and a TU are each obtained by dividing a CU into one or more blocks, and one PU has multiple prediction blocks (PBs) and related syntax elements. In some examples, a PU and a TU may be the same or may be obtained by different division schemes depending on the CU. In some examples, at least two of the CU, PU, ​​and TU are the same, for example, the CU, PU, ​​and TU are not distinguished, and prediction, quantization, and transformation are all performed on the CU as a unit. For ease of explanation, hereinafter, a CTU, CU, or other formed data unit is referred to as a coding block.

[0026] It should be understood that in the embodiments of the present application, the data targeted by video coding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or any group thereof. In different embodiments, the size of the data unit may vary.

[0027] Specifically, as shown in Figure 2, a frame to be coded is divided into multiple coding blocks, and then a prediction process is performed to remove spatial and temporal redundant information of the currently coded frame. Currently, relatively commonly used predictive coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction predicts a currently coded block using only reconstructed information in the current frame image, while inter-frame prediction predicts a currently coded block using information in other previously reconstructed frame images (also called reference frames). Specifically, in the embodiment of the present application, the coding control module 201 is configured to determine whether to use intra-frame prediction or inter-frame prediction.

[0028] When the intraframe prediction mode is selected, the intraframe prediction process 203 obtains a reconstructed block of an already-coded neighboring block surrounding the current coding block as a reference block, calculates a predicted value using a prediction mode based on the pixel values ​​of the reference block to generate a predicted block, and subtracts corresponding pixel values ​​between the current coding block and the predicted block to obtain a residual of the current coding block. The residual of the current coding block is transformed 204, quantized 205, and entropy coded 210 to form a bitstream of the current coding block. After undergoing the above coding process, all coding blocks of the current coding frame form part of the coding bitstream of the current coding frame. In addition, the control and parameter data generated in the intraframe prediction process 203 are also coded by entropy coding 210 to form part of the coding bitstream.

[0029] Specifically, the transform 204 is for removing correlation of residuals of image blocks, thereby improving coding efficiency. The transform of residual data of the current coding block is usually performed by using a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST). For example, the encoding side multiplies the residual information of the coding target block by an N×M transform matrix and its transpose matrix, respectively, to obtain the transform coefficients of the current coding block after multiplication.

[0030] After generating the transform coefficients, quantization 205 is performed to further improve compression efficiency. The transform coefficients can be quantized to obtain quantized coefficients, which are then entropy coded 210 to obtain a residual bitstream for the current coding block. Here, the entropy coding method includes, but is not limited to, CABAC (Context Adaptive Binary Arithmetic Coding) entropy coding.

[0031] Specifically, the coded neighboring block in the intra prediction 203 process is a neighboring block coded before the current coding block is coded, and is a reconstructed block obtained by adding the residual generated in the coding process of this neighboring block to the predicted block of this neighboring block after transform 204, quantization 205, inverse quantization 206, and inverse transform 207. Correspondingly, the inverse quantization 206 and inverse transform 207 are the inverse processes of the quantization 206 and transform 204, and are intended to restore the residual data before quantization and transform.

[0032] As shown in FIG. 2, when the inter-frame prediction mode is selected, the inter-frame prediction process includes motion prediction 208 and motion compensation 209. Specifically, motion prediction 208 is performed based on a reference image in a reconstructed image frame. In one or more reference frame images, an image block that is most similar to the current coding block is searched for based on a certain matching criterion, and this is determined as a matching block. The relative shift between this matching block and the current coding block is the motion vector (MV) of the current coding target block. After motion prediction is performed for all coding blocks in the current coding target frame, motion compensation 209 is performed on the current coding target frame based on the motion vector and the reference frame to obtain a predicted value for the current coding target frame. The original value of the pixel in this current coding target frame is subtracted from the corresponding predicted value to obtain a residual for the current coding target frame. After undergoing transformation 204, quantization 205, and entropy coding 210, the residual for the current coding target frame forms part of the coded bitstream for the current coding target frame. Additionally, control and parameter data generated in motion compensated prediction 209 is also encoded by entropy coding 210 and forms part of the encoded bitstream.

[0033] Here, as shown in FIG. 2 , the reconstructed video frame is a video frame obtained after filtering 211. Filtering 211 is intended to reduce compression artifacts, such as block effects and ringing effects, generated during the encoding process. During the encoding process, the reconstructed video frame provides a reference frame for inter-frame prediction, and during the decoding process, the reconstructed video frame is output as the final decoded video after post-processing. In an embodiment of the present application, filtering 211 includes at least one filtering technique among deblocking DB filtering, sample adaptive offset SAO filtering, adaptive loop filter ALF, and cross-component ALF (CC-ALF). In the example, ALF is provided after at least one of DB and SAO. In the example, the luma component before ALF is filtered, and the chroma component after ALF is filtered. Filtering parameters in the filtering process 211 are also transmitted to entropy coding and coded, forming part of the coded bitstream.

[0034] FIG. 3 is a schematic diagram of a video decoding frame 3 according to another embodiment of the present application. As shown in FIG. 3, video decoding involves performing operation steps corresponding to video encoding. First, entropy coding 301 is used to obtain one or more data information from the coded bitstream, including residual data, prediction syntax, intra-frame prediction syntax, motion compensation syntax, and filtering syntax. The residual data is then inversely quantized 302 and inversely transformed 303 to obtain original residual data information. Furthermore, the prediction syntax is used to determine whether intra-frame prediction or inter-frame prediction is used for the current decoded block. For intra-frame prediction 304, prediction information is constructed according to the intra-frame prediction scheme using a reconstructed image block in the current frame based on the intra-frame prediction syntax obtained by decoding. For inter-frame prediction, a reference block is determined in the reconstructed image based on the motion compensation syntax obtained by decoding to obtain prediction information. Subsequently, the prediction information and residual information are combined, and a reconstructed video frame is obtained through filtering 311. The reconstructed video frame is then post-processed 306 to obtain decoded video.

[0035] Specifically, in the embodiment of the present application, the filtering 311 may be the same as the filtering 211 in Fig. 2, and may include at least one of DB filtering, sample adaptive offset SAO filtering, adaptive loop filter ALF, and cross-component ALF (CC-ALF), where the filtering parameters and control parameters in the filtering 311 may be obtained by entropy decoding the coded bitstream, and filtering is performed based on the obtained filtering parameters and control parameters.

[0036] In the example, DB filtering processes pixels at the edges of the prediction unit PU and the transform unit TU, and uses a trained low-pass filter to nonlinearly weight the edges, thereby reducing blocking effects. In the example, SAO filtering classifies pixel values ​​in coding blocks of a frame image as units, and adds compensation values ​​to each type of pixel. Different coding blocks employ different filtering formats, and the compensation values ​​for different types of pixels in different coding blocks are different, so that the reconstructed frame image is closer to the original frame image and ringing effects are avoided. In the example, ALF filtering is a Wiener filtering process that calculates and filters filtering coefficients based on the Wiener filtering principle, mainly to minimize the mean-square error (MSE) between the reconstructed frame image and the original frame image, thereby further improving the image quality of the reconstructed frame, increasing the accuracy of motion prediction and motion compensation, and effectively improving the coding efficiency of the entire coding system. However, ALF filtering is complex and requires a long calculation time, resulting in certain shortcomings in practical applications.

[0037] For ease of understanding, an example of the ALF filtering process will now be described in the light of Figures 4, 5a and 5b.

[0038] Calculation principle of ALF filtering coefficients First, we will explain the calculation method of the ALF filtering coefficient based on the Wiener filtering principle. As shown in Figure 4, the pixel signal in the original coding frame of the current coding is X, and the reconstructed pixel signal after coding, DB filtering, and SAO filtering is Y. The noise or distortion introduced by Y in this process is e. After the reconstructed pixel signal is filtered by the filtering coefficient f in Wiener filtering, it becomes the ALF reconstructed signal

number

number

number

[0039] Alternatively, in one possible embodiment, a filter consisting of a set of ALF filtering coefficients has 13 filtering coefficients C0 to C12 symmetrically distributed, with a filter length L of 7, as shown in Figures 5a and 5b, or has 7 filtering coefficients C0 to C6 symmetrically distributed, with a filter length L of 5. Alternatively, the filter shown in Figure 5a, also known as a 7*7 filter, is applied to the luminance component of the coded frame, and the filter shown in Figure 5b, also known as a 5*5 filter, is applied to the chrominance component of the coded frame.

[0040] In the embodiments of the present application, the filter consisting of the ALF filtering coefficients may also be of other types of filters, such as a symmetrically distributed filter with a filter length of 9, and it should be understood that the embodiments of the present application are not limited thereto.

[0041] Optionally, in the linear ALF filtering process, for a pixel point to be filtered in a reconstructed image frame, the filtered result of the current point is obtained by weighted averaging of surrounding pixel points, that is, the corresponding pixel point in the ALF reconstructed image frame. Specifically, a pixel point I(x,y) in the reconstructed image frame is the pixel point to be filtered currently, (x,y) is the position coordinate of the pixel point to be filtered currently in the encoding frame, the filtering coefficient of the filter center corresponds to it, and the other filtering coefficients in the filter correspond to the pixel points surrounding I(x,y) one by one, the filtering coefficient value in the filter is the weight, and the value obtained by averaging the filtering coefficient value in the filter by the corresponding pixel point is the filtered pixel value O(x,y) of the current pixel point to be filtered I(x,y), the specific formula is as follows:

number

[0042] According to this method, each pixel point in the reconstructed image frame is filtered sequentially to obtain a filtered ALF reconstructed image frame.

[0043] Optionally, in a possible embodiment, the filtering coefficients w(i,j) of the filter are integers between [-1, 1).

[0044] Alternatively, in one possible embodiment, the filtering coefficient w(i,j) of the filter is extended by 128 times and then truncated to obtain w'(i,j), where w'(i,j) is an integer between [-128, 128). Specifically, the extended w'(i,j) is coded for transmission, and the hardware coding / decoding is easy to implement. The calculation formula for filtering using the extended w'(i,j) to obtain O(x,y) is as follows:

number

[0045] Alternatively, in other nonlinear ALF filtering processes, instead of directly using a filter as the weight, multiple pixel points are weighted to obtain the filtered result. A nonlinear parameter element is introduced to optimize the filtering effect. Specifically, the calculation formula for filtering I(x,y) to calculate O'(x,y) using nonlinear ALF filtering is as follows:

number

number

[0046] Specifically, in the k(d,b) clip operation, k(i,j) represents the in-loop filtering ALF modified clip parameter (hereinafter referred to as the modified parameter or clip parameter), and each filtering coefficient w(i,j) corresponds to a clip parameter. For the luminance component of the coding frame, the clip parameter is selected from {1024, 181, 32, 6}. For the chrominance component of the coding frame, the clip parameter is selected from {1024, 161, 25, 4}. An index corresponding to each clip parameter, i.e., a modified (clip) index parameter, needs to be written into the bitstream. If the clip parameter is 1024, the clip index parameter 0 is written into the bitstream. Similarly, if the clip parameter is 181, the clip index parameter 1 is written into the bitstream. Therefore, it can be seen that the clip index parameters for the luminance and chrominance classifications of the coding frame are both integers between 0 and 3.

[0047] Pixel classification and division Secondly, calculating a set of ALF filtering coefficients for each pixel point is time-consuming and complex, and writing all the ALF coefficients for each pixel point into the bitstream would be costly. Therefore, it is necessary to classify and divide the pixel points in the reconstructed image, and each type of pixel point uses the same set of ALF filtering coefficients (a type of filter), thereby reducing the computational complexity and improving the coding efficiency.

[0048] There may be multiple selectable pixel classification methods. For example, it is possible to classify only the luminance Y component of a pixel, without classifying the color UV component. For example, the luminance Y component may be divided into 25 types, and the color UV component may not be divided, resulting in only one type. In other words, for one frame image, the encoding frame for the luminance Y component can correspond to a maximum of 25 sets of filters, and the encoding frame for the color UV component corresponds to one set of filters.

[0049] In the embodiment of the present application, the pixel type may be a type corresponding to the luminance Y component, but it should be understood that the embodiment of the present application is not limited thereto, and the pixel type may be a type corresponding to other components or all components. For ease of explanation, the following describes ALF filtering as an example, with the coded frame of the luminance Y component being classified and divided.

[0050] Optionally, in a possible embodiment, the reconstructed image frame after DB filtering and SAO filtering is divided into a number of 4*4 pixel blocks, and the 4*4 blocks are classified.

[0051] For example, each 4*4 block can be classified in the Laplace direction.

number

[0052] C represents the type to which the pixel block belongs. D is the Laplace direction.

number

number

[0053] The calculation method of method D is as follows: first, calculate the Laplace gradients of the current 4*4 block in different directions, and the calculation formula is as follows:

number

[0054] R(k,l) is the reconstructed pixel value located at position (k,l) in the 4*4 block. Vk,l represents the Laplacian gradient in the vertical direction of the pixel point located at the (k,l) coordinate in the 4*4 block. H k,l represents the horizontal Laplacian gradient of the pixel point located at coordinate (k,l) in the 4*4 block. k,l represents the 135-degree Laplacian gradient of the pixel point located at the (k,l) coordinate in the 4*4 block. D2 k、l represents the 45-degree Laplacian gradient of the pixel point located at the (k,l) coordinate in the 4*4 block.

[0055] Correspondingly, the calculated g v represents the Laplace gradient in the vertical direction of the current 4*4 block. g h represents the horizontal Laplace gradient of the current 4*4 block. g d1 represents the Laplace gradient of the current 4*4 block in the 135 degree direction. d2 represents the Laplace gradient in the 45 degree direction of the current 4*4 block.

[0056] Then, the direction D is determined based on the extremum ratio of the Laplace gradients of the four directions, and the specific calculation formula is as follows:

number

number

number

number

number

number

[0057] Alternatively, in a possible embodiment:

number

number

[0058] Quantize A to get an integer between 0 and 4,

number

[0059] Therefore, by combining the values ​​of D and A, the value range of C is an integer between 0 and 24, and in the embodiment of the present application, at most, 4*4 blocks in one frame image are divided into 25 types.

[0060] Alternatively, in a possible embodiment, a coded frame has N types of 4*4 blocks, and each type of 4*4 block has a set of ALF filtering coefficients, where N is an integer between 1 and 25.

[0061] In the embodiments of the present application, the entire frame image can be divided into multiple 4*4 blocks, or into blocks of other pixel sizes, for example, multiple 8*8 or 16*16 size blocks, and it should be understood that the embodiments of the present application are not limited to this.

[0062] Furthermore, in the embodiments of the present application, in addition to classification based on the Laplace direction described above, other classification methods can also be adopted to classify blocks, and it should be understood that the embodiments of the present application are not limited thereto.

[0063] Furthermore, in the examples of the present application, the number of classifications can be any number other than 25, and it is understood that the examples of the present application are not limited thereto.

[0064] Block-based ALF filtering ALF filtering can be divided into frame-based ALF, block-based ALF, and quadtree-based ALF. Frame-based ALF applies a set of filtering coefficients to the entire frame. Block-based ALF divides a coding frame into equal-sized image blocks and determines whether to perform ALF filtering for each image block. Quadtree-based ALF divides a coding frame into unequal-sized image blocks based on a quadtree partitioning method and determines whether to perform ALF filtering. Frame-based ALF is computationally simple but has poor filtering performance. On the other hand, quadtree-based ALF requires high computational complexity. Therefore, some standards or technologies, such as the latest VVC standard under consideration, use block-based ALF in their reference software, VTM.

[0065] The block-based ALF in VTM is taken as an example. In VTM, a coded frame has a frame-level ALF filtering marker bit and a block-level ALF filtering marker bit. Optionally, the block level may be a CTU, a CU, or other image block of a division scheme. However, the embodiments of the present application are not limited thereto. For ease of explanation, the following description takes the CTU-level ALF filtering marker bit as an example.

[0066] Specifically, if the frame-level ALF filtering marker bit indicates that ALF filtering is not performed, the CTU-level ALF filtering marker bit in the coded frame is not identified, and if the frame-level ALF filtering marker bit indicates that ALF filtering is performed, the CTU-level ALF filtering marker bit in the coded frame is identified to indicate whether the current CTU performs ALF filtering.

[0067] Optionally, when a coding frame includes Z CTUs, the methods for calculating N sets of ALF filtering coefficients for the coding frame are as follows: Regarding whether the Z CTUs in the coding frame are ALF filtered and combined, for each type of combination method, N sets of ALF filtering coefficients for this method and the rate-distortion cost (RD Cost) of the coding frame are calculated and obtained. Here, the ALF calculation method for the i-th set of ALF filtering coefficients for each set is as follows: In the current CTU combination method, f is calculated for the i-th type pixel in the CTU that performs ALF filtering, and f is not calculated for the i-th type pixel in the other CTUs that do not perform ALF filtering, and the i-th set of ALF coefficients for the current combination method are calculated and obtained. It should be understood that the N sets of ALF filtering coefficients calculated and obtained for different combination methods may be different from each other.

[0068] The RD costs of multiple combinations are compared, and the combination with the smallest RD cost is determined as the final combination. The N sets of ALF filtering coefficients calculated using these different combinations are the ALF filtering coefficients with the best adaptability.

[0069] If the combination scheme with the smallest RD cost is to ALF filter at least one CTU among the Z CTUs, the frame-level ALF marker bit of the coded frame indicates that ALF filtering is to be performed, and the CTU-level ALF marker bits sequentially indicate whether ALF filtering is to be performed on the CTU data. For example, when the marker bit is set to 0, it indicates that ALF filtering is not to be performed, and when the marker bit is set to 1, it indicates that ALF filtering is to be performed.

[0070] In particular, if the combination scheme with the smallest RD cost is to not perform ALF filtering on any of the Z CTUs, then the coded frame will not be ALF filtered, and the frame-level ALF marker bit of the coded frame will indicate that ALF filtering is not performed, and the CTU-level ALF marker bit will not be identified.

[0071] It should be understood that the ALF in the embodiments of the present application not only applies to the VVC standard, but also to other ALF technical solutions or standards based on blocks.

[0072] Cross-Component ALF (CC-ALF) In the example, CC-ALF adjusts the chrominance component using the value of the luma component to improve the quality of the chrominance component. For ease of understanding, the CC-ALF and ALF processes are illustrated in FIG. 6. The current block has a luma component and a chrominance component, where the chrominance component includes a first chrominance component (e.g., Cb in FIG. 6) and a second chrominance component (e.g., Cr in FIG. 6).

[0073] The luma component is sequentially filtered by SAO and ALF, the first chroma component is sequentially filtered by SAO and ALF, the second chroma component is sequentially filtered by SAO and ALF, and a CC-ALF filter is further employed to perform CC-ALF on the chroma component.

[0074] In the example, the shape of the CC-ALF filter can be as shown in Figure 7. This CC-ALF filter uses a 3x4 diamond shape, with a total of eight coefficients. The location of label 2 in the figure is the pixel point of the current first or second chromaticity component, and the weighted average of the seven surrounding points is used to obtain the filtered result of the pixel point of the intermediate label 2 location.

[0075] A single frame image can have a total of multiple sets of filters, where the first chromaticity component and the second chromaticity component can be filtered by selecting the same or different target filters from the same set of CC-ALF filters, or can be filtered by selecting target filters from different sets of CC-ALF filters.

[0076] The total number of CC-ALF filters used for the current image needs to be written to the bitstream, where the total number of CC-ALF filters can include at least one of the total number of CC-ALF filters for the first chrominance component and the total number of CC-ALF filters for the second chrominance component. In a situation where the total number of CC-ALF filters for the first chrominance component and the total number of CC-ALF filters for the second chrominance component are the same, or the first chrominance component and the second chrominance component can select target filters from the same set of CC-ALF filters, only one total number of CC-ALF filters can be used to indicate the total number of CC-ALF filters.

[0077] For the current block, the index of the target filter selected for the current block is further coded into the bitstream. When the indexes of the target filters selected for the first chrominance component and the second chrominance component are the same or different, the indexes of the target filters for the two chrominance components can be coded into the bitstream. Alternatively, when the indexes of the target filters selected for the first chrominance component and the second chrominance component are the same, only one index can be coded into the bitstream, and this index indicates the target filter for the two chrominance components.

[0078] Next, we will provide a specific interpretation based on Figure 6.

[0079] Specifically, for a first chrominance component, a target filter for the first chrominance component of the current block is determined from multiple CC-ALF filters, and target filtering coefficients for the first chrominance component are determined based on the luma component that has not undergone ALF (e.g., after undergoing SAO but not ALF) and the first chrominance component of the current block that has undergone ALF. The first chrominance component is filtered based on the target filter for the first chrominance component and the target filtering coefficients. Then, the filtering result for the first chrominance component is determined based on the first chrominance component filtered by the target filter and target filtering coefficients and the first chrominance component that has undergone ALF (e.g., after undergoing SAO and ALF in sequence).

[0080] For the second chrominance component, a target filter for the second chrominance component of the current block is determined from the multiple CC-ALF filters, and the target filtering coefficients for this second chrominance component are determined based on the luma component that has not undergone ALF (e.g., after undergoing SAO but not ALF) and the second chrominance component of the current block that has undergone ALF. The second chrominance component is filtered based on the target filter for the second chrominance component and the target filtering coefficients. Then, the filtering result for the second chrominance component is determined based on the second chrominance component filtered by the target filter and target filtering coefficients and the second chrominance component that has undergone ALF (e.g., after undergoing SAO and ALF in sequence).

[0081] When encoding the current block, the total number of CC-ALF filters is encoded into the bitstream as a syntax element, and the index of the target filter selected for the first chrominance component of the current block and the index of the target filter selected for the second chrominance component are encoded into the bitstream as syntax elements.

[0082] In the example, there is only one syntax element for indicating the total number of CC-ALF filters in a bitstream of one frame image. In the example, the syntax element for indicating the total number of CC-ALF filters is located in an adaptation parameter set syntax for the image. In the example, the syntax element for indicating the total number of cross-component ALF filters is not present in at least one of a picture header and a slice header.

[0083] In an example, a syntax element for indicating the total number of CC-ALF filters can be encoded using truncated binary encoding. In an example, an index of the target filter can be encoded using truncated binary encoding.

[0084] For the current block, further encode the target filtering coefficients of the first chrominance component and the target filtering coefficients of the second chrominance component of the current block into the bitstream.

[0085] After receiving the bitstream, the decoding side decodes the index of the target filter selected for the current chrominance component and the total number of CC-ALF filters from the bitstream, and determines the CC-ALF filter for the chrominance component of the current block based on the index and total number. The decoding side also decodes the target filtering coefficient for the chrominance component of the current block from the bitstream, and filters the chrominance component that has passed through ALF of the current block based on the target filter and the target filtering coefficient.

[0086] The technical solutions of the embodiments of the present application can be used on both the encoding side and the decoding side. The following describes the technical solutions of the embodiments of the present application from the encoding side and the decoding side respectively.

[0087] 8 shows a schematic flow chart of a method 200 for in-loop filtering according to an embodiment of the present application. This method 200 can be performed by the encoding side, for example, by the system 100 shown in FIG. 1 during the encoding operation.

[0088] S210, determining a target filter for chrominance components of the current block from a plurality of cross-component adaptive loop filters (ALF filters);

[0089] S220: determining a target filtering coefficient of the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block;

[0090] S230 filters the chrominance components of the current block that have undergone ALF based on the target filter and the target filtering coefficients.

[0091] S240: determining a filtered chrominance component of the current block based on the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF;

[0092] S250, encoding based on the filtered chrominance components of the current block, and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in the bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.

[0093] Optionally, a syntax element for indicating the total number of the plurality of cross-component ALF filters is located within the Adaptation parameter set syntax of the image.

[0094] Optionally, a syntax element for indicating a total number of the plurality of cross-component ALF filters is not present in at least one of the image header and the slice header.

[0095] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.

[0096] Optionally, the luminance component of the current block that has not undergone ALF specifically refers to the luminance component of the current block that has undergone SAO but has not undergone ALF.

[0097] Optionally, encoding the total number of the plurality of cross-component ALF filters as a syntax element includes encoding the total number of the plurality of cross-component ALF filters employing truncated binary encoding.

[0098] Optionally, the method further comprises encoding an index of the target filter as a syntax element.

[0099] Optionally, encoding the target filter index as a syntax element includes encoding the target filter index employing truncated binary encoding.

[0100] Optionally, the method further comprises encoding target filtering coefficients for chrominance components of the current block into a bitstream.

[0101] 9 shows a schematic flow chart of the in-loop filtering method 200 of an embodiment of the present application. The method 300 can be performed by the encoding side, for example, when the system 100 shown in FIG. 1 performs the encoding operation.

[0102] S310: Decode the total number of cross-component ALF filters and the index of the target filter from the bitstream, where the target filter is the ALF filter adopted for the chrominance component of the current block, where only one syntax element is included to indicate the total number of cross-component ALF filters in the bitstream of one frame image.

[0103] S320, decoding target filtering coefficients of chrominance components of the current block from a bitstream, where the target filtering coefficients are coefficients in the target filter.

[0104] S330 cross-component filters the chrominance components of the current block that have undergone ALF based on the target filter and the target filtering coefficients.

[0105] S340: determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF;

[0106] Optionally, a syntax element for indicating the total number of cross-component ALF filters is located within the Adaptation parameter set syntax for the image.

[0107] Optionally, a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of the image header and the slice header.

[0108] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.

[0109] Optionally, the luminance component of the current block that has not undergone ALF specifically refers to the luminance component of the current block that has undergone SAO but has not undergone ALF.

[0110] Optionally, decoding the total number of cross-component ALF filters and the index of the target filter from the bitstream includes decoding at least one of the total number of cross-component ALF filters and the index of the target filter using truncated binary encoding.

[0111] FIG. 10 is a schematic frame diagram of another encoding-side in-loop filtering apparatus 30 in an embodiment of the present application, which is an in-loop filtering apparatus on the video encoding side, and optionally, this in-loop filtering apparatus 20 can correspond to an in-loop filtering method 100.

[0112] As shown in FIG. 10, the in-loop filtering device 30 includes a processor 31 and a memory 32, The memory 32 can be used to store a program, and the processor 31 executes the program stored in the memory to: determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block according to the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF; encoding the current block based on the filtered chrominance components, and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in the bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.

[0113] A syntax element for indicating the total number of the multiple cross-component ALF filters is located in the Adaptation parameter set syntax of the image.

[0114] Optionally, a syntax element for indicating a total number of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header.

[0115] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.

[0116] Optionally, the luminance component of the current block that has not undergone ALF specifically refers to the luminance component of the current block that has undergone SAO but has not undergone ALF.

[0117] Optionally, encoding the total number of the plurality of cross-component ALF filters as a syntax element comprises: and encoding a total number of the plurality of cross-component ALF filters using truncated binary encoding.

[0118] Optionally, the processor further comprises: for encoding the index of the target filter as a syntax element.

[0119] Optionally, encoding the index of the target filter as a syntax element comprises: Encoding the target filter index using truncated binary encoding.

[0120] It is to be understood that the apparatus embodiments correspond to the method embodiments, and similar descriptions may refer to the method embodiments.

[0121] 11 is a schematic frame diagram based on the apparatus 40 for in-loop filtering at the decoding side of an embodiment of the present application. Optionally, the apparatus 40 for in-loop filtering can correspond to the method 200 for in-loop filtering.

[0122] As shown in FIG. 11, the in-loop filtering device 40 includes a processor 41 and a memory 42, The memory 42 can be used to store a program, and the processor 41 executes the program stored in the memory to: Decoding the total number of cross-component ALF filters and the index of the target filter from the bitstream, the target filter being the ALF filter adopted for the chrominance component of the current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; It can be used to determine the filtered chrominance components of the current block based on the chrominance components after filtering by the target filtering coefficients and the chrominance components of the current block after ALF.

[0123] Optionally, a syntax element for indicating the total number of cross-component ALF filters is located within the Adaptation parameter set syntax for the image.

[0124] Optionally, a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of the image header and the slice header.

[0125] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.

[0126] Optionally, the luminance component of the current block that has not undergone ALF specifically refers to the luminance component of the current block that has undergone SAO but has not undergone ALF.

[0127] Optionally, decoding a total number of cross-component ALF filters and target filter indices from the bitstream includes: employing truncated binary encoding to decode at least one of the total number of cross-component ALF filters and the index of the target filter.

[0128] An embodiment of the present application further provides an electronic device, which may include the in-loop filtering apparatus of each embodiment of the present application described above.

[0129] It should be understood that the processor in the embodiments of the present application may be an integrated circuit chip and have signal processing capabilities. In the implementation process, each step of the above-mentioned method embodiments can be completed by a hardware integrated logic circuit in the processor or a command in software form. The above-mentioned processor includes, but is not limited to, a general-purpose processor, a CPU, 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. Each method, step, and logic block diagram disclosed in the embodiments of the present application can be realized or executed. The general-purpose processor may be a microprocessor, or this processor may be any conventional processor, etc. Based on the steps of the method disclosed in the embodiments of the present application, execution can be directly embodied as a hardware decoder processor, or can be completed by a combination of hardware and software modules in the decoder processor. The software module may be located in a storage medium known in the art, such as a random memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above-mentioned method.

[0130] It can be understood that the memory in the embodiments of the present application can be volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Here, the nonvolatile 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) and is used as an external high-speed buffer memory. By way of example and not limitation, many forms of RAM may be used, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that memory in the systems and methods described herein includes, but is not limited to, these and any other suitable types of memory.

[0131] An embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs, the one or more programs having commands that, when executed on a portable electronic device including a plurality of application programs, can cause the portable electronic device to perform the method of the embodiment shown in FIGS. 6 to 11.

[0132] An embodiment of the present application further provides a computer program, which has instructions, when the computer program is executed on a computer, causing the computer to perform the method of the embodiment shown in FIGS.

[0133] An embodiment of the present application further provides a chip, the chip having input / output ports, at least one processor, at least one memory, and a bus, the at least one memory for storing commands, and the at least one processor for executing the method of the embodiment shown in Figures 6 to 11 by calling the commands in the at least one memory.

[0134] Those skilled in the art can recognize that each exemplary unit and algorithm step described in the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are ultimately implemented in a hardware or software manner is determined by the specific application of the technical solution and design constraints. Those skilled in the art can realize the described functions by using different methods for each specific application, but such realization should not be recognized as going beyond the scope of this application.

[0135] Those skilled in the art can clearly understand that for ease of explanation and simplicity, the specific operating processes of the systems, devices, and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be described here.

[0136] It should be understood that the disclosed systems, devices, and methods in the various embodiments provided by this application can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a division of logical functions, and in actual implementation, other division methods may exist. For example, multiple units or components may be combined or integrated into other systems, or some features may be omitted or not implemented. Furthermore, the illustrated or discussed couplings or direct couplings or communication connections between each other may be through some interfaces, and indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units, and some or all of the units may be selected to achieve the objective of the solution of this embodiment according to actual needs.

[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically alone, or two or more units may be integrated into one unit.

[0139] When the functions are realized in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application, or the contributions made to the prior art or parts of the technical solutions, can be embodied in the form of a software product, and the computer software product is stored in a storage medium and has a plurality of commands for causing a computer device (which may be a personal computer, a server, a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. Meanwhile, the storage medium includes various media capable of storing program code, such as a USB memory, a portable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0140] The above are only specific embodiments of the present application, and the scope of protection of the present application is not limited thereto. Those skilled in the art can easily think of modifications or replacements within the technical scope disclosed by the present application, and all such modifications or replacements shall be included in the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined based on the scope of protection of the claims. [Item 1] 1. A method of in-loop filtering, comprising: determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block according to the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF; encoding the current block based on the filtered chrominance components, and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters. [Item 2] 2. The method for in-loop filtering according to item 1, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax for the image. [Item 3] 3. The method for in-loop filtering according to item 1 or 2, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 4] The method according to item 1, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset SAO and ALF in sequence. [Item 5] Item 2. The method according to item 1, wherein the luminance component of the current block that has not undergone ALF is specifically the luminance component of the current block that has undergone SAO and has not undergone ALF. [Item 6] encoding the total number of the plurality of cross-component ALF filters as a syntax element, Item 10. The method of item 1, comprising employing truncated binary encoding to encode the total quantity of the plurality of cross-component ALF filters. [Item 7] The method comprises: Item 10. The method of item 1, further comprising encoding the index of the target filter as a syntax element. [Item 8] encoding the index of the target filter as a syntax element, 8. The method of claim 7, comprising encoding the target filter index using truncated binary encoding. [Item 9] 1. A method of in-loop filtering, comprising: Decoding the total number of cross-component ALF filters and the index of the target filter from the bitstream, the target filter being the ALF filter adopted for the chrominance component of the current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF. [Item 10] 10. The method of in-loop filtering according to item 9, wherein a syntax element for indicating the total number of cross-component ALF filters is located in an adaptation parameter set syntax for the image. [Item 11] 11. The method for in-loop filtering according to item 9 or 10, wherein a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 12] Item 10. The method according to item 9, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset SAO and ALF in sequence. [Item 13] Item 10. The method according to item 9, wherein the luminance component of the current block that has not undergone ALF is specifically the luminance component of the current block that has undergone SAO and has not undergone ALF. [Item 14] decoding a total number of cross-component ALF filters and an index of a target filter from the bitstream; Item 10. The method of item 9, comprising employing truncated binary encoding to decode at least one of the total number of cross-component ALF filters and the index of the target filter. [Item 15] 1. An apparatus for in-loop filtering, comprising: a memory for storing the code; Executing the code stored in the memory determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient for the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block according to the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF; and a processor for performing the steps of: encoding based on filtered chrominance components of the current block; and encoding a total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters. [Item 16] Item 16. The in-loop filtering apparatus according to item 15, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax of the image. [Item 17] 17. The apparatus for in-loop filtering according to item 15 or 16, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 18] Item 16. The device according to item 15, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset SAO and ALF in sequence. [Item 19] Item 16. The device according to item 15, wherein the luminance component of the current block that has not undergone ALF is specifically the luminance component of the current block that has undergone SAO and has not undergone ALF. [Item 20] encoding the total number of the plurality of cross-component ALF filters as a syntax element, Item 16. The apparatus of item 15, comprising employing truncated binary encoding to encode a total quantity of the plurality of cross-component ALF filters. [Item 21] The processor further comprises: Item 16. The apparatus according to item 15, for encoding the index of the target filter as a syntax element. [Item 22] encoding the index of the target filter as a syntax element, Item 22. The apparatus of item 21, comprising encoding the target filter index using truncated binary encoding. [Item 23] 1. An apparatus for in-loop filtering, comprising: a memory for storing the code; Executing the code stored in the memory Decoding the total number of cross-component ALF filters and the index of the target filter from the bitstream, the target filter being the ALF filter adopted for the chrominance component of the current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; and determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF. [Item 24] Item 24. The apparatus for in-loop filtering according to item 23, wherein a syntax element for indicating the total number of cross-component ALF filters is located in an adaptation parameter set syntax for the image. [Item 25] 25. The apparatus for in-loop filtering according to item 23 or 24, wherein a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 26] Item 24. The device according to item 23, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset SAO and ALF in sequence. [Item 27] Item 24. The device according to item 23, wherein the luminance component of the current block that has not undergone ALF is specifically the luminance component of the current block that has undergone SAO and has not undergone ALF. [Item 28] decoding a total number of cross-component ALF filters and an index of a target filter from the bitstream; Item 24. The apparatus of item 23, comprising employing truncated binary encoding to decode at least one of the total number of cross-component ALF filters and the index of the target filter.

Claims

1. determining a target cross-component adaptive loop filtering (ALF) filter for a chrominance component of a current block of an image from a plurality of cross-component ALF filters; determining target cross-component ALF filter coefficients for the chrominance components of the current block based on the chrominance components that have undergone ALF and the luminance components of the current block that have not undergone ALF; filtering the chrominance components that have undergone ALF based on the target cross-component ALF filter and the target cross-component ALF filter coefficients; determining filtered chrominance components of the current block based on the chrominance components filtered by the target cross-component ALF filter coefficients and the chrominance components after passing through the ALF, where the target cross-component ALF filter adopts a 3x4 diamond shape; encoding the filtered chrominance components of the current block using a total number of the plurality of cross-component ALF filters, an index of the target cross-component ALF filter, and a coefficient of the target cross-component ALF filter as syntax elements.

2. 2. The video processing method of claim 1, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax of the image but is not present in at least one of a picture header and a slice header.

3. The moving image processing method according to claim 1 , wherein the chrominance components that have undergone ALF are the chrominance components that have undergone sample adaptive offset (SAO) filtering and ALF in sequence.

4. The moving image processing method according to claim 1 , wherein the luminance component that has not undergone ALF is the luminance component that has undergone sample adaptive offset (SAO) and has not undergone ALF.

5. encoding the total number of the plurality of cross-component ALF filters using a syntax element, 2. The method of claim 1, comprising encoding the total number of the plurality of cross-component ALF filters using a truncated binary code.

6. encoding the index of the target cross-component ALF filter using as a syntax element, 2. The video processing method of claim 1, comprising encoding the index of the target cross-component ALF filter using a truncated binary code.

7. decoding a total number of a plurality of cross-component adaptive loop filtering (ALF) filters and an index of a target cross-component ALF filter from the stream, the target cross-component ALF filter being a cross-component ALF filter to be adopted for a chrominance component of a current block of an image; decoding target cross-component ALF filter coefficients for the chrominance components of the current block from the stream, the target cross-component ALF filter coefficients being coefficients in the target cross-component ALF filter and determined on an encoding side based on the chrominance components that have undergone ALF and the luminance components of the current block that have not undergone ALF; filtering the chrominance components that have undergone ALF based on the target cross-component ALF filter and the target cross-component ALF filter coefficients; determining filtered chrominance components of the current block based on the chrominance components after being filtered by the target cross-component ALF filter coefficients and the chrominance components after passing through ALF, wherein the target cross-component ALF filter adopts a 3x4 diamond shape.

8. 8. The video processing method of claim 7, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax for the image but is not present in at least one of a picture header and a slice header.

9. determining a target cross-component adaptive loop filtering (ALF) filter for a chrominance component of a current block of an image from a plurality of cross-component ALF filters; determining target cross-component ALF filter coefficients for the chrominance components of the current block based on the chrominance components that have undergone ALF and the luminance components of the current block that have not undergone ALF; filtering the chrominance components that have undergone ALF based on the target cross-component ALF filter and the target cross-component ALF filter coefficients; determining filtered chrominance components of the current block based on the chrominance components filtered by the target cross-component ALF filter coefficients and the chrominance components after passing through the ALF, where the target cross-component ALF filter adopts a 3x4 diamond shape; encoding the filtered chrominance components of the current block, and encoding the filtered chrominance components of the current block using a total number of the plurality of cross-component ALF filters, an index of the target cross-component ALF filter, and a coefficient of the target cross-component ALF filter as syntax elements to generate a stream.