Video encoding method, apparatus, computer device and storage medium

By delay filtering and using ALF/CC-ALF filters to filter image blocks in the reconstructed image frames, the problem of frequent memory read/write operations in existing technologies is solved, and the filtering and encoding efficiency of video coding is improved.

CN116546211BActive Publication Date: 2026-05-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-01-26
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing video coding technologies, the filtering process for reconstructing image frames requires frequent reading and writing of external memory, which affects the filtering and coding performance of computer equipment.

Method used

When encoding references for image blocks in the reconstructed image frame, the delayed filtering operation is performed until the motion estimation reference is reached. The filtering process is combined with ALF and CC-ALF filters to reduce memory read and write operations.

Benefits of technology

It improves filtering efficiency, enhances video frame encoding efficiency, and reduces storage pressure and resource consumption on computer equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116546211B_ABST
    Figure CN116546211B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a video encoding method and device, computer equipment and a storage medium, wherein the method comprises: obtaining a second video frame to be encoded from a target video, the target video containing a first video frame that has been encoded, a reconstructed image frame of the first video frame containing one or more image blocks, and the reconstructed image frame of the first video frame corresponding to a target filter-related parameter; obtaining a target image block from the reconstructed image frame of the first video frame when encoding processing is performed on the second video frame; performing filter processing on the target image block according to the target filter-related parameter to obtain a filtered target image block; and using the filtered target image block as encoding reference information of the second video frame to perform encoding processing on the second video frame, which can improve filter efficiency and thus improve encoding efficiency for video frames.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a video encoding method, apparatus, computer equipment, and storage medium. Background Technology

[0002] In existing video coding techniques, loop filtering of reconstructed image frames significantly impacts the encoding of subsequent image frames. However, current filtering processes require reading image information from each image block within the reconstructed frame, as well as the image information from the corresponding original video frame, and then storing the processed image frame in external memory. This repeated reading and writing to external memory negatively affects the filtering and coding performance of the computer. Therefore, effectively implementing filtering for reconstructed image frames has become a current research hotspot. Summary of the Invention

[0003] This invention provides a video encoding method, apparatus, computer device, and storage medium that can improve filtering efficiency, thereby improving encoding efficiency for video frames.

[0004] On one hand, embodiments of the present invention provide a video encoding method, including:

[0005] A second video frame to be encoded is obtained from a target video, the target video containing an encoded first video frame, the reconstructed image frame of the first video frame containing one or more image blocks, and the reconstructed image frame of the first video frame corresponding to the target filtering related parameters;

[0006] When encoding the second video frame, the target image block is obtained from the reconstructed image frame of the first video frame;

[0007] The target image block is filtered according to the target filtering parameters to obtain the filtered target image block.

[0008] The filtered target image block is used as the encoding reference information for the second video frame, and the second video frame is encoded.

[0009] In another aspect, embodiments of the present invention provide a video encoding apparatus, comprising:

[0010] An acquisition unit is used to acquire a second video frame to be encoded from a target video, wherein the target video contains an encoded first video frame, the reconstructed image frame of the first video frame contains one or more image blocks, and the reconstructed image frame of the first video frame corresponds to the target filtering related parameters;

[0011] The acquisition unit is further configured to acquire a target image block from the reconstructed image frame of the first video frame when encoding the second video frame;

[0012] A filtering unit is used to filter the target image block according to the target filtering parameters to obtain a filtered target image block.

[0013] The processing unit is used to encode the second video frame by using the filtered target image block as the encoding reference information of the second video frame.

[0014] In another aspect, embodiments of the present invention provide a computer device, including a processor, an input device, an output device, and a memory, wherein the processor, input device, output device, and memory are interconnected, wherein the memory is used to store a computer program supporting the computer device in executing the above-described method, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the following steps:

[0015] A second video frame to be encoded is obtained from a target video, the target video containing an encoded first video frame, the reconstructed image frame of the first video frame containing one or more image blocks, and the reconstructed image frame of the first video frame corresponding to the target filtering related parameters;

[0016] When encoding the second video frame, the target image block is obtained from the reconstructed image frame of the first video frame;

[0017] The target image block is filtered according to the target filtering parameters to obtain the filtered target image block.

[0018] The filtered target image block is used as the encoding reference information for the second video frame, and the second video frame is encoded.

[0019] In another aspect, embodiments of the present invention provide a computer-readable storage medium storing program instructions, which, when executed by a processor, are used to perform the video encoding method as described in the first aspect.

[0020] In this embodiment, after encoding a first video frame in a target video, the computer device can determine the target filtering parameters for the reconstructed image frame corresponding to the first video frame. Then, after the computer device subsequently obtains a second video frame to be encoded from the target video, if the encoding process of the second video frame requires reference to the target image block of the reconstructed image frame corresponding to the encoded first video frame in the target video, the computer device can perform filtering on the target image block based on the target filtering parameters. This allows the computer device to use the filtered target image block as a reference for encoding the second video frame. By delaying the filtering operation for the reconstructed image frame, the computer device can postpone the filtering operation until the frame or image block is used as a reference for motion estimation. This effectively reduces memory read / write operations during the filtering process. Furthermore, when filtering the target image block, the computer device can incorporate the proposed simplified filtering scheme to further improve the filtering efficiency. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1a This is a schematic diagram of a video encoding process provided in an embodiment of the present invention;

[0023] Figure 1b This is a schematic diagram of an image block relationship provided by an embodiment of the present invention;

[0024] Figure 1c This is a schematic diagram of a video encoding method provided in an embodiment of the present invention;

[0025] Figure 1d This is a schematic diagram of a filtering process provided in an embodiment of the present invention;

[0026] Figure 2 This is a schematic diagram of a diamond-shaped filter provided in an embodiment of the present invention;

[0027] Figure 3 This is a schematic flowchart of a video encoding method provided in an embodiment of the present invention;

[0028] Figure 4 This is a schematic block diagram of a video encoding device provided in an embodiment of the present invention;

[0029] Figure 5This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0030] This application proposes a video encoding method in which, after encoding the first video frame of a target video, the computer device first stores the filtering-related parameters of the reconstructed image frame of the first video frame. Only when some or all image blocks in the reconstructed image frame of the first video frame need to be encoded as references are the corresponding filtering-related parameters applied to the target image blocks to be encoded as references. This allows the computer device to encode the second video frame based on the filtered target image blocks as encoding references. This enables the computer device to filter the corresponding reconstructed image frames according to the actual usage requirements of the reconstructed image frames encoded from the first video frame, thereby effectively reducing the storage pressure on the computer device for the filtered reconstructed image frames and thus effectively saving the encoding resources of the computer device. The video encoding method proposed in this application is a processing technology for video data (such as the target video mentioned above). Video encoding refers to converting a file in an original video format into another video format file through compression technology. In one embodiment, the video (or video content, or video signal, specifically the target video mentioned in this application) mentioned in this application can include real scene video captured by a camera or screen content scene video generated by a computer. The mainstream video encoding technologies (or video encoding standards) include one or more combinations of the following: the international video encoding standard HEVC (High Efficiency Video Coding, international video encoding standard HEVC / H.265), VVC (versatile video coding, international video encoding standard VVC / H.266), and the Chinese national video encoding standard AVS (Audio Video Coding Standard, Chinese national video encoding standard AVS), or AVS3 (the third-generation video encoding standard launched by the AVS standards group). Among them, the process of encoding the input original video signal (such as a video frame in the target video) using a hybrid encoding framework that combines multiple video encoding technologies can be as follows: Figure 1a As shown:

[0031] ① Block partition structure: The input image (such as a video frame in video data) is divided into several non-overlapping processing units according to its size. Each processing unit will perform a similar compression operation. This processing unit is called a CTU (Coding Tree Unit) or LCU (Largest Coding Unit). The coding tree unit generally starts from the largest coding unit and continues downwards. Further subdivisions can be made below the CTU to obtain one or more basic coding units, called CUs (Coding Units). Each CU is the most basic element in a coding process.

[0032] Furthermore, based on the encoding rules of the color coding system, a CTU contains one luminance coding tree block (CTB) for the same image location, and two chrominance CTBs. The correspondence between each CTU obtained based on block partitioning and different CTBs under the encoding rules of the color coding system can be as follows: Figure 1b As shown.

[0033] ② Predictive Coding: This includes intra-frame prediction and inter-frame prediction. The original video signal is predicted using a selected reconstructed video signal to obtain the residual video signal. The encoder needs to determine the most suitable predictive coding mode from among many possible modes for the current CU and inform the decoder.

[0034] a. Intra(picture)Prediction: The predicted signal comes from a region within the same image that has already been encoded and reconstructed.

[0035] b. Inter-frame prediction: The predicted signal comes from other encoded images that are different from the current image (called reference images).

[0036] ③ Transform Coding and Quantization: The residual video signal undergoes transform operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform, a subset of DFT) to transform the signal into the transform domain, which are called transform coefficients. The signal in the transform domain is then further subjected to lossy quantization, losing some information, making the quantized signal more suitable for compression representation.

[0037] ④ Entropy Coding or Statistical Coding: The quantized transform domain signal is statistically compressed and encoded based on the frequency of each value, finally outputting a binary (0 or 1) compressed bitstream. Simultaneously, other information generated during encoding, such as the selected mode and motion vectors, also requires entropy coding to reduce the bit rate.

[0038] ⑤ Loop Filtering: An encoded image undergoes inverse quantization, inverse transform, and prediction compensation (the reverse of operations ② to ④ above) to obtain a reconstructed decoded image. Compared to the original image, the reconstructed image differs in some information due to the effects of quantization, resulting in distortion. Applying filtering operations to the reconstructed image, such as deblocking, SAO (Sample Adaptive Offset), or ALF (Adaptive Loop Filter), can effectively reduce the distortion caused by quantization.

[0039] Since these filtered reconstructed images will serve as a reference for subsequent coded images to predict future signals, the aforementioned filtering operation is also called loop filtering, or filtering operation within the coding loop. The latest generation of international video coding standard VVC supports four different types of loop filters: Deblocking Filter (DF), Sample Adaptive Compensation (SAO), Adaptive Loop Filtering (ALF), and Cross-Component Adaptive Loop Filtering (CC-ALF). Below, we will combine... Figure 1c The process of using the filtered reconstructed image as a coding reference for subsequent coded images, and then using this coding reference to encode the subsequent coded images, is briefly explained:

[0040] First, assume that the image (or image frame) to be encoded is Fn. When the image Fn to be encoded is encoded, it will be encoded in combination with the reconstructed image of the reference image Fn-1 (denoted as F'n-1). That is, when encoding the current image Fn to be encoded, the filtered reference reconstructed image F'n-1 needs to be obtained first, and then motion estimation and motion compensation are performed on the current image Fn to be encoded based on the filtered reference reconstructed image F'n-1. Motion compensation is used to predict and compensate for the current image Fn to be encoded by using a local image of the reference reconstructed image F'n-1. The result of motion compensation is divided into two parts. One part is used to calculate the difference with the current image Fn to be encoded. After performing Discrete Cosine Transform (DCT) and subsequent quantization encoding on the difference result, the encoded bitstream of the current image Fn to be encoded is obtained. The other part of the motion compensation result, after inverse quantization and inverse DCT (IDCT), can be used to generate the current reconstructed image F'n corresponding to the current image Fn to be encoded. It can be understood that after generating the current reconstructed image F'n of the current image to be encoded, the current reconstructed image F'n will also be used as the encoding reference for other subsequent image frames after being filtered.

[0041] In one embodiment, the filtering of image frames can be performed using an ALF filter, or a combination of an ALF filter and a CC-ALF filter. Both the ALF filter and the CC-ALF filter provide a variety of filter banks for selection. For example, in the current VVC design, the luminance ALF supports 25 different filter classes, the ALF for each chroma component supports up to 8 different filter classes, and the CC-ALF for each chroma component supports up to 4 different filter classes. Therefore, when selecting ALF or CC-ALF for filtering, the computer device can determine the relatively optimal filter choice for each image block (i.e., each CTB or CTU) of the reconstructed image frame from a variety of provided filtering options based on Rate-Distortion Optimization (RDO). In other words, the computer device can determine the filtering-related parameters for each image block in the reconstructed image frame based on RDO when filtering the reconstructed image frame. Thus, the process of filtering the reconstructed image frame is the process of filtering the corresponding image blocks in the reconstructed image frame using the corresponding filtering-related parameters. In one embodiment, the image blocks in the reconstructed image frame may be luma image blocks or chroma image blocks. When the image block is a luma image block, it can be filtered using an ALF filter; when the image block is a chroma image block, it can be filtered using an ALF filter or a CC-ALF filter.

[0042] In one embodiment, ALF and CC-ALF are Wiener filters that adaptively determine filter coefficients based on the content of different video components, thereby reducing the mean square error (MSE) between the reconstructed and original components. As an adaptive filter, the Wiener filter can generate different filter coefficients for video content with different characteristics. Therefore, when using an ALF or CC-ALF filter to filter a corresponding image frame (or video frame), it is first necessary to classify the image frame to be filtered based on its content, so as to use an appropriate filter for each category of video content. The input of ALF is the reconstructed pixel values ​​after DF and SAO filtering, and the output is the enhanced reconstructed luminance image and reconstructed chrominance image. Therefore, the process of using an ALF filter to filter the luminance image blocks in the reconstructed image frame includes the following steps 1 to 7:

[0043] 1. Classify the pixels of the reconstructed image frame according to the pixel content of each image block to obtain the pixel classification category of each image block in the reconstructed image frame.

[0044] For each 4x4 image block (specifically, the brightness image block) of the reconstructed image frame, pixel classification is performed based on the image block content, and the pixel classification category and corresponding geometric transformation of each image block are output. This step is a CTB-level operation.

[0045] 2. Based on the pixel classification category corresponding to each image patch, construct the filtering equation corresponding to the pixel classification category, such as the Wienerhof equation.

[0046] Since each image patch corresponds to an image location region in the reconstructed image frame (e.g., the top-left 4x4 pixel position), and each image location region in the reconstructed image frame also has a corresponding image location region in the original image frame (e.g., the top-left 4x4 pixel position in the reconstructed image frame also corresponds to the top-left 4x4 pixel position in the original image frame), the autocorrelation coefficient of the corresponding image patch can be determined based on its image location region in the reconstructed image frame. Furthermore, the cross-correlation coefficient of the corresponding image patch can be determined based on both its image location region in the reconstructed image frame and its corresponding image location region in the original image frame. After determining the autocorrelation coefficient, cross-correlation coefficient, and corresponding pixel classification category for each image patch, the autocorrelation coefficients and cross-correlation coefficients of image patches within the same pixel classification category can be accumulated. Based on these accumulated autocorrelation coefficients and cross-correlation coefficients, the Wienerhof equation for each pixel classification category can then be determined. This step is a CTB-level operation.

[0047] 3. Solve the Wienerhof equation corresponding to the classification category of each pixel in the reconstructed image frame to obtain the filter bank corresponding to the reconstructed image frame.

[0048] By solving the Wienerhof equation corresponding to each pixel classification category constructed in step 2, a corresponding filter bank will be obtained. In this case, an ALF filter bank can correspond to 25 filter coefficients when performing brightness filtering. As mentioned above, if the number of pixel classification categories obtained by classifying the reconstructed image frame is 25, then 25 corresponding Wienerhof equations will be constructed and solved to obtain a derived filter containing 25 filters.

[0049] After obtaining the filter corresponding to each pixel classification category, a greedy algorithm can be used to merge the filters by combining two filters at a time. Based on this merging process, the encoder can be provided with multiple possible filtering options. For example, if the pixel classification category is 25, merging two filters at a time can sequentially create filter banks containing 24 filters, 23 filters, and so on, until a filter bank containing only one filter is obtained. Therefore, through the filter merging process, the encoder (such as the aforementioned computer device) can be provided with 25 options (i.e., using filter banks containing one filter, up to using filter banks containing 25 filters) for filtering the reconstructed image frame. Based on the multiple filtering options provided to the encoder through filter merging, the encoder can use RDO (Resource Decision Object) to determine the merits of each filtering option for the corresponding reconstructed image frame, allowing the encoder to select the optimal filtering scheme (i.e., the derived filter bank, i.e., the filter bank derived from the current frame to be processed) from the provided filtering options. The optimal filtering scheme determined by the encoding end includes the number of filters used in the filtering process (i.e., the number of derived filters) and the coefficients of the filters used for filtering. This step is a frame-level operation.

[0050] 4. Export filter bank enable decision.

[0051] Calculate the rate-distortion (RD Cost) during encoding with ALF filtering disabled (i.e., without using the derived filter determined in step 3) and with ALF filtering enabled (i.e., using the derived filter determined in step 3). If the rate-distortion value when ALF filtering is disabled is greater than the rate-distortion value when ALF filtering is enabled, the encoder will enable ALF filtering to filter the reconstructed image frame before encoding the current image frame. Otherwise, the encoder will disable ALF filtering, using the reconstructed image frame before filtering as the encoding reference for the current image.

[0052] When the encoder determines to use the filter bank derived in step 3 to filter the reconstructed image frame based on the rate-distortion value, the filter bank derived from the current frame to be processed in step 3 will be added to the candidate filter bank set. This step is a frame-level operation.

[0053] 5. Construct a set of candidate filter groups.

[0054] In addition to determining the filter banks derived from the current frame to be processed in step 3 above, the default filter banks specified in the coding standard and the filter banks available for APS decoding can also be added to the candidate filter bank set. This candidate filter bank set is a combination of the aforementioned filter banks. During encoding, the encoder can encode based on any combination provided by this candidate filter bank set and further determine the optimal filter bank set using RDO (Real-Time Optimization). The optimal filter bank set determined from the candidate filter bank set may be one or more filter banks contained within that candidate filter bank set; this step is a frame-level operation.

[0055] An APS can contain up to 25 sets of luma filter coefficients and corresponding limiting indexes, up to 8 sets of chroma filter coefficients and corresponding limiting indexes for each chroma component, and up to 4 sets of CC-ALF filter coefficients for each chroma component. To save bitrate, for luma ALF filters, filter coefficients of different categories can be merged, with multiple categories sharing a single set of filter coefficients. The computer device determines which categories of coefficients can be merged using Rate-Distortion Optimization (RDO). The index of the APS used by the current slice is marked in the Slice Header. CC-ALF supports CTB-level adaptation; for cases with multiple filters, at the CTB level, it adaptively selects whether to use CC-ALF and the index of the filter used for each chroma component.

[0056] 6. ALF enabling for image patches and filter bank determination.

[0057] Each filter bank in the optimal filter bank set determined in step 5 is used to filter and encode each image block in the reconstructed image frame. The optimal filter bank for each image block in the reconstructed image frame is then determined from this optimal filter bank set using an RDO (Real-Time Optimization) approach. In this step, determining the optimal filter bank for each image block using RDO includes: whether to use the corresponding filter bank to filter the corresponding image block (i.e., determining the ALF enable tag for the corresponding image block), and which filter bank in the optimal filter bank set to use for filtering the corresponding image block. This step is a CTB-level operation.

[0058] 7. Using the filtering method determined in step 6, perform filtering on each image block in the reconstructed image frame. This step can be a CTB-level operation.

[0059] The following is a detailed description of the specific implementation method for classifying the luminance components (i.e., luminance image blocks) in the reconstructed image frame based on the content of the corresponding image blocks, as mentioned in step 1 above. In one embodiment, the ALF adaptively uses different filters at the sub-block level (4x4 luminance image blocks in VVC) for the luminance components, that is, it needs to divide each 4x4 image block into one of 25 classes. The classification index C of the luminance component image block is composed of the block's directionality feature D and quantized activity feature. This was obtained jointly. Specifically, it was based on the directional feature D and the activity feature. The formula for obtaining the classification index (i.e., pixel classification category) of the corresponding brightness image patch is shown in Equation 1:

[0060]

[0061] D and for each brightness image block To determine the values, we first need to calculate the horizontal, vertical, diagonal, and anti-diagonal gradient values ​​of each pixel in each brightness image patch. Let (k,l) represent the pixel position of the brightness image patch before filtering, and R(k,l) represent the reconstructed pixel value at position (k,l) before ALF filtering. We also assume that the horizontal gradient value at position (k,l) before filtering is determined by H. k,l This indicates that the gradient value in the vertical direction is determined by V. k,l The gradient value in the diagonal direction is represented by D0. k,l This indicates that the gradient value of the anti-angle is given by D1. k,l Therefore, the gradient values ​​in each direction at position (k,l) can be represented by Equation 2:

[0062] H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)|

[0063] V k,l =|2R(k,l)-R(k,l-1)-R(k,l+1)|

[0064] D0 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|

[0065] D1 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)|Formula 2

[0066] Based on the pixel gradient at each location in the image patch, the overall level g of the image patch is... h Vertical g v diagonal gd0 and the opposite g d1 The gradient is shown in Equation 3:

[0067]

[0068] Here, i and j represent the coordinates of the top-left pixel of the image patch. Based on the obtained gradient values ​​of the image patch, the maximum values ​​of the gradients in the horizontal and vertical directions can be determined. and minimum value As shown in Equation 4:

[0069]

[0070] Furthermore, the maximum gradient values ​​in the diagonal and anti-diagonal directions can also be determined. and minimum value As shown in Equation 5:

[0071]

[0072] After determining the relevant parameters in equations 2 to 5 above, the encoding end can determine the value of the directional feature D of the image patch through the following ① to ④:

[0073] ①If and If both conditions are met, then D is set to 0;

[0074] ②If Then proceed to ③; otherwise, proceed to ④.

[0075] ③If Then set D to 2; otherwise set D to 1.

[0076] ④If Then D is set to 4; otherwise, D is set to 3.

[0077] Furthermore, the activity characteristic A before quantization can be calculated based on the relevant parameters in Equations 2 to 5 above, and its calculation formula is shown in Equation 6:

[0078]

[0079] After obtaining the activity feature A before quantization, the activity feature A can be quantized to the interval [0-4] to obtain the quantized activity feature. Then, the pixel classification category of the corresponding image block can be calculated based on Equation 1.

[0080] Before filtering each brightness image block, geometric transformations are applied to the filter coefficients and corresponding limiting values ​​according to the gradient values ​​of the current block, following the rules in Table 1. These transformations include no transformation, diagonal transformation, vertical flip, and rotation. Applying geometric transformations to the filter coefficients is equivalent to applying geometric transformations to the pixel values ​​while keeping the coefficients unchanged before filtering. The purpose of geometric transformations is to align the directionality of different block contents as much as possible, thereby reducing the number of classifications required by ALF and allowing different pixels to share the same filter coefficients. Using geometric transformations can increase the actual classification from 25 classes to 100 classes without increasing the number of ALF filters, thus improving its adaptability.

[0081] Table 1

[0082] gradient value Several transformations <![CDATA[g d1 <g d0 And g h <g v ]]> constant <![CDATA[g d1 <g d0 And g v ≤g h ]]> Diagonal transformation <![CDATA[g d0 ≤g d1 And g h <g v ]]> Vertical flip <![CDATA[g d0 ≤g d1 And g v ≤g h ]]> Rotation Transformation

[0083] As shown in Table 1 above, if a certain brightness image block has a pixel classification category C=0 calculated according to Equation 1 above, and there is a filter bank corresponding to the classification category C=0, then when the gradient value relationship of each pixel position in this brightness image block is the first relationship, the filter bank corresponding to the pixel classification category can be directly used to filter this brightness image block. When the gradient value of each pixel position in this brightness image block is the second relationship, a diagonal transformation method can be used to first transform the filter parameters of the filter bank corresponding to the pixel classification category before filtering this brightness image block.

[0084] In one embodiment, similar to the process of filtering luminance image blocks using an ALF filter described above, when filtering chroma image blocks in the reconstructed image frame using an ALF filter, the computer device can directly divide the chroma video frame into 8 regions, corresponding to 8 classes. This classification is only for deriving the 8 filter banks later; however, the determination of CTBs in subsequent step 6 is not limited by the classification. For example, if a certain CTB belongs to class 1, in step 6, the computer device still needs to select the best filter bank from the 8 filter banks and the APS. When using an ALF filter to filter chroma image blocks, apart from the different classification methods of chroma image blocks, in subsequent steps, after constructing and solving the Wienerhof equation for each type of chroma image block and deriving the corresponding 8 sets of filters, the 8 sets of filters are not merged. Instead, the 8 sets of filters are directly used as the filter groups (i.e., the exported filter groups) for the current frame to be processed. After determining the activation decision of the exported filter groups, the 8 exported filter groups and the filter groups available for APS decoding are used as the candidate filter group set. Other processes of using ALF to filter chroma image blocks can refer to the above process of using ALF to filter luminance image blocks.

[0085] Besides the ALF filter, filters based on the Wienerhof equation also include the CC-ALF filter. CC-ALF operates only on the chroma component, utilizing the correlation between the luma and chroma components. It obtains a correction value for the chroma component through linear filtering of the luma component. This correction value is added to the chroma component after ALF to obtain the final reconstructed chroma component. The input to CC-ALF is the luma component after DF and SAO, but before ALF; the output is the corresponding chroma component's correction value. Unlike luma ALF, which supports sub-block-level classification and adaptive selection, CC-ALF only supports CTB-level classification and adaptive selection. For each chroma component, all chroma pixels within a CTB belong to the same category and use the same filter. In other words, the CC-ALF filter is only used to filter chroma image blocks. When using the CC-ALF filter to filter chroma image blocks in the reconstructed image frame, the process is similar to using the ALF filter, except that the classification is based on four regions instead of eight.

[0086] In one embodiment, the CC-ALF filter generates a corresponding correction value for each chrominance component by linearly filtering the luminance component. It should be noted that the use of the CC-ALF filter depends on the use of the ALF filter; its process and relationship with ALF are as follows. Figure 1dAs shown in Equation 7, the filtering process using the CC-ALF filter is as follows:

[0087]

[0088] Where (x,y) is the sample position of chromaticity component i, (x c ,y C ) is the luminance component obtained from the chromaticity component, S i This is the filtering region supported by the CC-ALF filter on the luminance component, c i (x0, y0) are the filter coefficients corresponding to chrominance component i. (x0, y0) are the offset positions corresponding to the luminance component. The positions corresponding to the luminance component are obtained by transforming the coordinates of the chrominance component according to the scaling relationship between luminance and chrominance in the video sequence. In one embodiment, the CC-ALF filter supports... Figure 2 The 3x4 diamond-shaped filter is shown. Compared to ALF, CC-ALF's filter coefficients eliminate the symmetry constraint, allowing it to flexibly adapt to the relative relationships of various luminance and chrominance components. Furthermore, to reduce the number of filter coefficients required for transmission, current VVC designs impose the following two constraints on CC-ALF's filter coefficients:

[0089] 1. The sum of all coefficients in CC-ALF is limited to 0. Therefore, for a 3x4 diamond filter, only 7 filter coefficients need to be calculated and transmitted, and the filter coefficient at the center position can be automatically inferred at the decoding end based on this condition.

[0090] 2. The absolute value of each filter coefficient to be transmitted must be a power of 2, and can be represented by a maximum of 6 bits. Therefore, the absolute values ​​of the CC-ALF filter coefficients are {0, 2, 4, 8, 16, 32, 64}. This design can use shift operations to replace multiplication operations, reducing the number of multiplication operations.

[0091] In one embodiment, since solving and optimizing the filter coefficients using an ALF or CCALF filter is a frame-level operation, it requires loading the entire original frame and reconstructed frame onto the chip (i.e., the computer device). After obtaining the filter coefficients, the computer device needs to write the filtered image frame back to external memory after the filtering operation. In real-time applications, encoding devices implemented in software, hardware, or embedded systems (i.e., the aforementioned computer device) are characterized by limited memory bandwidth and low latency. Therefore, to further improve the performance of the computer device in encoding image frames, see... Figure 3The video encoding method shown may specifically include the following steps:

[0092] S301, Obtain the second video frame to be encoded from the target video. The target video contains the encoded first video frame. The reconstructed image frame of the first video frame contains one or more image blocks, and the reconstructed image frame of the first video frame corresponds to the target filtering related parameters.

[0093] S302, when encoding the second video frame, the target image block is obtained from the reconstructed image frame of the first video frame.

[0094] In one embodiment, the target video is a sequence of images consisting of multiple video frames (or image frames) arranged in chronological order. That is, the target video contains one or more video frames arranged in sequence. Therefore, the process of encoding the target video is also the process of encoding each video frame contained in the target video separately. When encoding each video frame in the target video, the computer device will adopt different encoding methods for different types of frames. For example, for I-frames (keyframes), B-frames (bidirectional predictive interpolation coded frames), or P-frames (forward predictive coded frames), the computer device can adopt different encoding methods to encode different types of frames based on its own encoding requirements and the characteristics of different types of frames, thereby obtaining the corresponding encoded bitstream. Based on the different encoding methods used by computer devices when encoding different types of video frames, the computer device will refer to other video frames when encoding certain video frames to reduce the encoding distortion of the current video frame. In this embodiment, the video frame currently being encoded is the second video frame, and the case where the first video frame needs to be referenced when encoding the second video frame is explained. It should be noted that the reference to the first video frame when encoding the second video frame is made after filtering the reconstructed image frame of the first video frame.

[0095] In one embodiment, the reconstructed image frame of the first video frame is obtained by inverse quantization and inverse DCT processing of the motion compensation result of the first video frame after encoding the first video frame. In other words, the reconstructed image frame is reconstructed after encoding the first video frame. To avoid a large error between the reconstructed image frame generated based on the encoding and reconstruction process of the first video frame and the original first video frame, which would result in a large encoding error when used as the encoding reference for the second video frame, after obtaining the reconstructed image frame of the first video frame, the reconstructed image frame of the first video frame can be filtered to eliminate the error generated based on the encoding and reconstruction process of the first video frame. This can effectively ensure the accuracy of the encoded information obtained after referencing the first video frame when encoding the second video frame.

[0096] In one embodiment, the reconstructed image frame of the first video frame contains one or more image blocks. After the first video frame is encoded, target filtering parameters for each image block in the corresponding reconstructed image frame can be saved. These target filtering parameters can be determined through steps 1-7 described above. After the computer device determines these parameters, they can be temporarily stored. When the computer device needs to use the target image blocks from the first video frame as a reference for encoding the second video frame, it can filter the corresponding target image blocks according to the stored target filtering parameters. This allows the filtered target image blocks to be used as a reference during the encoding process of the second video frame.

[0097] In one embodiment, the target filtering correlation parameters for each image block in the reconstructed image frame of the first video frame determined by the computer device are related to the filter used for the corresponding image block. As mentioned above, if the filter used for the corresponding image block is an adaptive loop filter (i.e., an ALF filter), then the filtering correlation parameters determined by the computer device can be called ALF filtering correlation parameters. Based on steps 1 to 7 above, it can be seen that there are certain differences between the ALF filtering correlation parameters for chroma image blocks and for luma image blocks. The ALF filtering correlation parameters for luma image blocks include: filter bank coefficients, pixel classification category, geometric transformation category, and filtering enable flags for each image block (specifically luma image blocks) (including slice-level enable flags and / or CTU (or CTB) level filtering enable flags) and filter bank index; while the ALF filtering correlation parameters for chroma image blocks include: filter bank coefficients, and filtering enable flags and filter bank index for each image block. Among them, the filter bank coefficients are used to indicate the filter coefficients of each filter in the filter bank that performs filtering processing on the corresponding image block; the pixel classification category is used to indicate the classification category of the corresponding image block; the geometric transformation category is used to indicate the transformation method used for the filter coefficients when filtering image blocks under the same pixel classification category but with different orientations of block content; the filtering enable flag corresponding to each image block is used to indicate whether the corresponding filter bank is used to perform filtering processing on the corresponding image block; and the filter bank index is used to indicate the filter bank used when filtering processing the corresponding image block. In other words, if the reconstructed image frame of the first video frame is filtered using an ALF filter, it means the target filtering parameters are determined according to the adaptive loop filtering logic. However, if the reconstructed image frame of the first video frame is filtered using a CC-ALF filter, it means the target filtering parameters are determined according to the cross-component adaptive loop filtering logic. Therefore, if the target filtering parameters are determined according to the adaptive loop filtering logic, they must include at least one of the following: the pixel classification category and geometric transformation category of the target image block. Conversely, if the target filtering parameters are determined according to the cross-component adaptive loop filtering logic, they must not include the pixel classification category and geometric transformation category of the target image block. It should be noted that when using a CC-ALF filter to filter an image block, it is done in conjunction with an ALF filter.

[0098] The target image block described in the embodiments of this application may refer to one or more CTUs mentioned above, or it may refer to one or more CTBs. In one embodiment, when the target filtering related parameters are determined according to the processing logic of adaptive loop filtering, the target image block is one or more coding tree blocks obtained by dividing the reconstructed image frame of the first video frame, or the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame; when the target filtering related parameters are determined according to the processing logic of cross-component adaptive loop filtering, the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame. In addition, an image block composed of multiple coding tree blocks or coding units may be referred to as a block.

[0099] In one embodiment, if a cross-component adaptive loop filter (CC-ALF filter) is used to filter a certain image block in the reconstructed image frame of the first video frame, and since the CC-ALF filter only filters chroma image blocks, the determined filtering-related parameters for the corresponding chroma image block include filter bank coefficients, filtering enable flags for the corresponding image block, and filter bank indexes, similar to ALF filtering of chroma image blocks. In one embodiment, the target filtering-related parameters are only obtained for filtering when the corresponding image block is used as the encoding reference for the second video frame. This allows the computer device to combine the filtering operation for the image block in the reconstructed image frame of the first video frame with the interpolation operation for the reference frame, reducing the occupation of the computer device's encoding resources and effectively freeing up the computer device's computing resources. After the computer device stores the target filtering-related parameters corresponding to the reconstructed image frame of the first video frame, it will always keep the target filtering-related parameters on-chip until the entire reconstructed image frame of the first video frame has been filtered or is no longer used as the encoding reference for other video frames.

[0100] In one embodiment, when the computer device encodes a second video frame, if a target image block in the first video frame needs to be referenced, in a first implementation, if the target filtering correlation parameter is an ALF filtering correlation parameter, the target image block can be filtered according to the ALF filtering correlation parameter, and the filtered target image block can be used as the encoding reference for the second video frame. Further, if the target image block is a CTB, the computer device will perform ALF filtering on the CTB according to the ALF filtering correlation parameter; if the target image block is a block, the computer device will perform ALF filtering on the block according to the ALF filtering correlation parameter. In another implementation, if the target filtering correlation parameter is a CC-ALF filtering correlation parameter, the computer device can perform CC-ALF filtering on the target image block according to the CC-ALF filtering correlation parameter.

[0101] S303, filter the target image block according to the target filtering parameters to obtain the filtered target image block.

[0102] S304, use the filtered target image block as the encoding reference information for the second video frame, and encode the second video frame.

[0103] In one embodiment, after obtaining the filtered target image block, the computer device performs motion estimation processing on the second video frame based on the filtered target image block before encoding the second video frame. In a specific implementation, when performing motion estimation processing on the second video frame, the computer device can load a reference image region required for motion estimation of the second video frame into a motion estimation sliding window. Then, when the reference image region loaded in the motion estimation sliding window contains the target image block and the target image block has not been filtered, the target image block is filtered according to the target filtering parameters. If the reference image region loaded in the motion estimation sliding window contains the target image block and the target image block has been filtered, the filtered target image block can be directly used as the encoding reference information of the second video frame. Assuming the current encoding process is performed on CTB_N in the second video frame, then the motion estimation sliding window of CTB_N is loaded. If the motion estimation sliding window contains CTB_M in the reconstructed image frame of the first video frame, and CTB_M has not yet been filtered, then ALF filtering parameters (or CC-ALF filtering parameters) can be used to filter CTB_M. After the filtering process is completed on CTB_M, the filtering flag corresponding to CTB_M can be set to true (or set to 1).

[0104] In one embodiment, after the computer device completes the filtering processing of the target image block in the reconstructed image frame of the first video frame, the filtered target image block can be written back to external memory. This allows the target image block to be directly retrieved from external memory for encoding processing when it is used as an encoding reference again, without requiring further filtering. In a specific implementation, the computer device can update the motion estimation window. When the target image block is removed from the updated motion estimation window, the computer device can determine that the filtering processing of the target image block is complete and store it in external memory. Then, when the filtered target image is used as encoding reference information again, it can retrieve the filtered target image from external memory. Storing the filtered target image block in external memory means storing the pixel values ​​of the filtered image block in external memory. For example, when CTB_M is removed from the motion estimation window, the filtered pixel values ​​of CTB_M can be stored in external memory for subsequent use as an encoding reference.

[0105] In one embodiment, since the target image block can distinguish between luminance and chrominance signals, the computer device can perform filtering on the target image block separately for the luminance signal (target luminance block) and the chrominance signal (target chrominance block). This allows filtering only the luminance signal of the target image block and writing it to external memory, while the chrominance signal is filtered only during final motion compensation. In a specific implementation, the computer device can first filter the target luminance block included in the target image block and store it in external memory. Then, when performing motion compensation on the second video frame, the computer device can use target filtering parameters to filter the target chrominance block, obtaining a filtered target chrominance block. Thus, the filtered target luminance block and the filtered target chrominance block obtained from external memory can be used as encoding reference information for the second video frame.

[0106] In one embodiment, after encoding the second video frame, the computer device will also obtain the reconstructed image frame corresponding to the second video frame and the filtering related parameters of the reconstructed image frame corresponding to the second video frame. The filtering related parameters of the reconstructed image frame corresponding to the second video frame can be used to filter the reconstructed image frame of the second video frame. Then, when it is necessary to encode other video frames that use the reconstructed image frame of the second video frame as encoding reference information, the filtered reconstructed image frame of the second video frame can be used to encode the other video frames.

[0107] In one embodiment, the reconstructed image frame of the second video frame or the reconstructed image frame of the first video frame can be recorded as the current frame to be processed before filtering. Then, when the computer device performs filtering on the current frame to be processed, it can adopt a real-time filtering (on-the-fly) processing method. The real-time filtering method means that according to the encoding requirements, some or all of the image blocks in the current frame to be processed are filtered. After the filtering is performed, the image block after the filtered image block is used as an encoding reference is deleted to avoid outputting the filtered reconstructed image frame to external memory. According to the real-time filtering method, the computer device can perform filtering based on actual encoding requirements and avoid repeatedly reading and writing the reconstructed image frame (or the image block in the reconstructed image frame) from external memory.

[0108] In one embodiment, when determining the filtering-related parameters for the current frame to be processed (or a specific image block within the current frame to be processed), the computer device can further simplify the above steps to improve the filtering efficiency of the computer device, thereby improving the encoding processing efficiency of the computer device. In a specific implementation, when determining the filtering-related parameters for the current frame to be processed, the computer device can first obtain the set of available decoding filters for the current frame to be processed and use this set as the candidate filter set for the current frame to be processed; wherein, the candidate filter set contains multiple candidate filter sets; after the computer device determines the candidate filter set, it can calculate the rate-distortion cost between the currently encoded image frame and the currently encoded image frame obtained by filtering the current frame to be processed using any candidate filter set, with the filtered current frame to be processed as the encoding reference information. Then, the index of the candidate filter set that achieves the minimum rate-distortion cost can be used as the filter set index included in the filtering-related parameters of the current frame to be processed. If the target filtering parameters corresponding to the target image block are determined according to the processing logic of adaptive loop filtering, then the set of available filter banks for decoding the current encoded image frame includes one or more of the following: a filter bank based on the adaptive parameter set (i.e., the APS filter bank), and the default filter bank; while if the target filtering parameters corresponding to the target image block are determined according to the processing logic of cross-component adaptive loop filtering, then the set of available filter banks for decoding the current encoded image frame includes a filter bank based on the adaptive parameter set (i.e., CC-ALF APS).

[0109] In other words, if the computer device determines to use ALF to filter the current frame, then when determining the filtering-related parameters of the current frame, the set of available decoded filters for the current frame (i.e., the ALF APS) can be directly used as the ALF filter set. Thus, the optimal filter set can be set as the APS filter set. After classifying a CTB in the current frame, the ALF enable flag and filter set for that CTB can be determined using RDO, thereby obtaining the filtering-related parameters of the current frame. However, when the computer device uses CC-ALF to filter the current frame, the corresponding set of available decoded filters (i.e., CC-ALF APS) can be obtained and directly set as the optimal filter set. Therefore, for a CTB in the current frame, the filtering-related parameters can be obtained according to RDO when performing CC-ALF filtering. In one embodiment, the computer device can improve the efficiency of filtering the current frame by reducing the solving of the filtering equations at the frame level for the current frame to be processed by using the available APS filter bank and / or the default filter bank as the optimal filter bank.

[0110] In one embodiment, when determining the filtering-related parameters of the current frame to be processed, the computer device may also use a disable flag as a filtering-related parameter for the current frame to be processed. The disable flag can be a slice-level disable flag or a block-level disable flag (i.e., CTB or CTU level). When the slice-level disable flag is on, the block-level disable flag is either on or off; conversely, when the slice-level disable flag is off, the block-level disable flag is also off. In one embodiment, the disable flag includes an on state (e.g., when the value of the disable flag is 1, the corresponding state is on) and an off state (e.g., when the value of the disable flag is 0, the corresponding state is off). When determining the state of the disable flag, in one implementation, the computer device may first calculate the rate-distortion cost of the disable flag in the on state and the rate-distortion cost in the off state based on rate-distortion, thereby enabling the computer device to determine the state of the disable flag added to the filtering-related parameters based on the calculated rate-distortion cost.

[0111] In another implementation, when determining the state of the disable flag, the computer device can directly set the state of the disable flag added to the filter correlation parameters to the enabled state (i.e., always on) without performing rate distortion calculation. This disable flag can be a slice-level disable flag or an image patch-level disable flag. Therefore, setting the state of the disable flag added to the filter correlation parameters to the enabled state means that both the slice-level and image patch-level disable flags in the filter correlation parameters are set to the enabled state. In other words, with the slice-level (i.e., Slice-level) enable flag always on, no RD decision is needed at the slice level, saving hardware resources. Similarly, with the CTU-level enable flag always on and only one set of candidate filter banks used, no RD decision is needed, further saving hardware resources.

[0112] In one embodiment, when the image patch-level disable flag is enabled, the filter set used to filter the corresponding image patch includes one or more of the following: the filter set derived from the current frame to be processed, the filter set based on the adaptive parameter set, and the default filter set. When the slice-level disable flag is enabled, the filter set used to filter the corresponding image patch includes one or more of the following: the filter set derived from the current frame to be processed, the filter set based on the adaptive parameter set, and the default filter set. It should be noted that the filter set used to filter the corresponding image patch is determined from the filter set selected from the slice containing the corresponding image patch. Furthermore, in this embodiment, when the image patch-level disable flag is enabled, the filter set derived from the current frame to be processed is generally selected directly to filter the corresponding image patch. That is, when the image patch-level disable flag is enabled, the filter set derived from the current frame to be processed is generally used as the filter set for filtering the corresponding image patch without rate-distortion cost calculation, thereby saving hardware resources.

[0113] In one embodiment, when the image block is a luminance image block, the filter bank derived from the current frame to be processed can be an ALF filter bank obtained by solving the Wienerhof equation, while when the image block is a chrominance image block, the filter bank derived from the current frame to be processed can be an 8-ALF filter bank derived based on region partitioning, or a 4-ALF and CC-ALF filter bank.

[0114] Furthermore, when determining the filtering-related parameters of the current frame to be processed, the computer device can also construct a filtering equation (such as the Wienerhof equation constructed based on the minimum mean square error) corresponding to the pixel classification category of the current frame to be processed, based on the autocorrelation coefficient of the current frame to be processed and the cross-correlation coefficient between the current frame to be processed and the corresponding original image patch. Further, by solving the filtering equation, multiple filter coefficients are obtained, which can then be merged according to a target merging rule. The filter group coefficients included in the filtering-related parameters of the current frame to be processed are then determined based on the merged filter coefficients. In one embodiment, the target merging rule can be a rule that merges into one. Therefore, when the computer device merges the multiple filter coefficients according to the target merging rule, it merges the multiple filter coefficients into one filter coefficient. That is, after obtaining the filter group corresponding to each pixel classification category, the computer device can directly merge the multiple filter groups into one category without performing RDO operations, thereby simplifying the filtering process and improving filtering efficiency.

[0115] In one embodiment, the target merging rule can also be used to constrain the maximum number of filters after merging. In this case, when the computer device merges multiple filter coefficients according to the target merging rule, it can merge multiple filter coefficients into M filter coefficients, where M is greater than 1 and less than or equal to the maximum number of filters, such as 16. In this case, based on the indication of the maximum number of filters, the computer device can merge a maximum of 16 filter data. Furthermore, when the current frame to be processed uses cross-component adaptive loop filtering processing logic, and the current frame to be processed is a chroma image block, the computer device can use the reconstructed image frame containing the current frame to be processed as the target pixel category. That is, the computer device can classify the entire CTU of the current frame to be processed into one category. For this classification, the computer device can obtain only the filter coefficients corresponding to the target pixel category, which corresponds to a filter group of one category. This allows the computer device to use the filter coefficients corresponding to the target pixel category as the merged filter coefficients. Based on the derivation from only one filter group, the filtering process of the computer device can be effectively simplified.

[0116] In other implementations, after solving the Wienerhof equation based on the classification category corresponding to each image block of the current frame to be processed, and obtaining the filter bank under the corresponding pixel classification category, the computer device can directly use the derived filter bank (the filter bank derived from the current frame to be processed) as the candidate filter bank set, instead of adding the APS filter bank and the default filter bank to the candidate filter bank set for RDO selection. This reduces the computational requirements of the computer device to determine the filtering-related parameters for the current frame to be processed, thereby effectively simplifying the filtering and encoding process for the current frame to be processed. In other words, when determining the filtering-related parameters of the current frame to be processed, the computer device can first obtain the filter bank derived from the current frame. After obtaining the filter bank derived from the current frame, the computer device can directly use the obtained filter bank derived from the current frame as the filter bank of the current frame without calculating the rate-distortion cost. Then, the slice-level index of the filter bank derived from the current frame is used as the slice-level index of the filter bank included in the filtering-related parameters of the current frame, and the derived filter coefficients included in the filter bank derived from the current frame are the filter coefficients included in the filtering-related parameters of the current frame. Since the computer device no longer needs to calculate the rate-distortion cost when determining the filter bank for the current frame, the filtering efficiency of the computer device can be effectively improved, thus achieving an effective improvement in the encoding efficiency of the computer device.

[0117] In one embodiment, for the luminance image blocks contained in the current frame to be processed, the computer device can classify the luminance image blocks contained in the current frame to obtain multiple pixel classification categories and the luminance image blocks contained in each pixel classification category; then, based on each pixel classification category and the luminance image blocks contained in the corresponding pixel classification category, a filtering equation corresponding to each pixel classification category can be constructed; further, the filtering equation corresponding to any pixel classification category can be solved to obtain a derived filter for luminance filtering corresponding to any pixel classification category, and the luminance filtering filter corresponding to each pixel classification category of the current frame to be processed obtained is used as the derived filter group of the current frame to be processed. In another embodiment, for the chrominance image blocks contained in the current frame to be processed, the computer device can use the provided 8 sets of ALF filters as the derived filter group of the current frame to be processed, or directly use the provided 4 sets of CC-ALF filters as the derived filter group of the current frame to be processed.

[0118] In this embodiment, after encoding a first video frame in a target video, the computer device can determine the target filtering parameters for the reconstructed image frame corresponding to the first video frame. Then, after the computer device subsequently obtains a second video frame to be encoded from the target video, if the encoding process of the second video frame requires reference to the target image block of the reconstructed image frame corresponding to the encoded first video frame in the target video, the computer device can perform filtering on the target image block based on the target filtering parameters. This allows the computer device to use the filtered target image block as a reference for encoding the second video frame. By delaying the filtering operation for the reconstructed image frame, the computer device can postpone the filtering operation until the frame or image block is used as a reference for motion estimation. This effectively reduces memory read / write operations during the filtering process. Furthermore, when filtering the target image block, the computer device can incorporate the proposed simplified filtering scheme to further improve the filtering efficiency.

[0119] Based on the description of the above video encoding method embodiments, this invention also proposes a video encoding apparatus, which can be a computer program (including program code) running on the aforementioned computer device. This video encoding apparatus can be used to perform tasks such as... Figure 3 For the video encoding method described above, please refer to [link / reference]. Figure 4 The video encoding device includes: an acquisition unit 401, a filtering unit 402, and a processing unit 403.

[0120] The acquisition unit 401 is used to acquire a second video frame to be encoded from a target video, wherein the target video includes an encoded first video frame, the reconstructed image frame of the first video frame includes one or more image blocks, and the reconstructed image frame of the first video frame corresponds to the target filtering related parameters.

[0121] The acquisition unit 401 is further configured to acquire a target image block from the reconstructed image frame of the first video frame when encoding the second video frame;

[0122] Filtering unit 402 is used to filter the target image block according to the target filtering related parameters to obtain the filtered target image block;

[0123] The processing unit 403 is used to encode the second video frame by using the filtered target image block as the encoding reference information of the second video frame.

[0124] In one embodiment, if the target filtering related parameters are determined according to the processing logic of adaptive loop filtering, then the target filtering related parameters include at least one of the following: the pixel classification category of the target image patch and the geometric transformation category;

[0125] If the target filtering parameters are determined according to the cross-component adaptive loop filtering processing logic, then the target filtering parameters do not include the pixel classification category and geometric transformation category of the target image block.

[0126] In one embodiment, when the target filtering related parameters are determined according to the processing logic of the adaptive loop filtering, the target image block is one or more coding tree blocks obtained by dividing the reconstructed image frame of the first video frame, or the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame.

[0127] When the target filtering parameters are determined according to the cross-component adaptive loop filtering processing logic, the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame.

[0128] In one embodiment, motion estimation processing is included before encoding the second video frame; the processing unit 403 is further configured to load a reference image region required for motion estimation of the second video frame in a motion estimation sliding window when performing motion estimation processing on the second video frame.

[0129] The processing unit 403 is further configured to trigger the execution of filtering processing on the target image block according to the target filtering related parameters when the reference image region loaded in the motion estimation sliding window contains the target image block and the target image block has not been filtered.

[0130] The processing unit 403 is further configured to, if the reference image region loaded in the motion estimation sliding window contains the target image block and the target image block has been filtered, trigger the execution of using the filtered target image block as the encoding reference information of the second video frame.

[0131] In one embodiment, the processing unit 403 is further configured to update the motion estimation sliding window;

[0132] The processing unit 403 is further configured to store the filtered target image block in external memory when the target image block is removed from the updated motion estimation sliding window, and to retrieve the filtered target image from the external memory when the filtered target image is used as encoding reference information again.

[0133] In one embodiment, motion compensation processing is included before encoding the second video frame, and the target image block includes a target luma block and a target chroma block. The filtered target image block stored in external memory is the filtered target luma block.

[0134] The filtering unit 402 is further configured to use the target filtering related parameters to filter the target chroma block when performing motion compensation processing on the second video frame, so as to obtain the filtered target chroma block.

[0135] The processing unit 403 is further configured to use the filtered target luminance block obtained from the external memory and the filtered target chrominance block as encoding reference information for the second video frame.

[0136] In one embodiment, the acquisition unit 401 is further configured to acquire the reconstructed image frame corresponding to the second video frame, and the filtering related parameters of the reconstructed image frame corresponding to the second video frame;

[0137] The filtering unit 402 is further configured to perform filtering processing on the reconstructed image frame of the second video frame using the filtering-related parameters of the reconstructed image frame corresponding to the second video frame.

[0138] The processing unit 403 is further configured to encode other video frames using the reconstructed image frame of the filtered second video frame when encoding other video frames that use the reconstructed image frame of the second video frame as encoding reference information is required.

[0139] In one embodiment, the reconstructed image frame of the second video frame or the reconstructed image frame of the first video frame is recorded as the current frame to be processed; the processing unit 403 is further configured to perform filtering processing on the current frame to be processed using a real-time filtering processing method.

[0140] In one embodiment, the reconstructed image frame of the second video frame or the reconstructed image frame of the first video frame is recorded as the current frame to be processed; the acquisition unit 401 is further configured to acquire the set of available decoding filters for the current frame to be processed, and use the set of available decoding filters as the set of candidate filters for the current frame to be processed; the set of candidate filters includes multiple candidate filters.

[0141] The processing unit 403 is further configured to calculate the rate-distortion cost between the current encoded image frame obtained by using the filtered current image frame as encoding reference information after filtering the current image frame with any candidate filter group.

[0142] The processing unit 403 is further configured to use the index of the candidate filter bank that achieves the minimum rate distortion cost as the filter bank index included in the filtering related parameters of the current frame to be processed.

[0143] In one embodiment, if the target filtering parameters corresponding to the target image block are determined according to the processing logic of adaptive loop filtering, then the set of available filter banks for decoding the current encoded image frame includes one or more of the following: a filter bank based on an adaptive parameter set, or a default filter bank.

[0144] If the target filtering parameters corresponding to the target image block are determined according to the cross-component adaptive loop filtering processing logic, then the set of available filter banks for decoding the current encoded image frame includes filter banks based on the adaptive parameter set.

[0145] In one embodiment, the reconstructed image frame of the second video frame or the reconstructed image frame of the first video frame is recorded as the current frame to be processed.

[0146] The processing unit 403 is further configured to use the disable enable flag as a filtering-related parameter of the current frame to be processed;

[0147] When the slice-level disable flag is on, the image block-level disable flag is either on or off; and when the slice-level disable flag is off, the image block-level disable flag is also off.

[0148] In one embodiment, the processing unit 403 is specifically configured to: calculate the rate distortion cost of the disable flag in the open state and the rate distortion cost in the closed state based on the rate distortion, and determine the state of the disable flag to be added to the filter-related parameters based on the calculated rate distortion cost;

[0149] Alternatively, the processing unit 403 is specifically configured to: directly set the state of the disable flag added to the filter-related parameters to the enable state without performing rate-distortion calculation, wherein the disable flag is a slice-level disable flag or an image block-level disable flag; wherein the slice-level disable flag or the image block-level disable flag in the filter-related parameters is set to the enable state.

[0150] In one embodiment, when the state of the image patch level disable flag is set to the enable state, the filter group for filtering the corresponding image patch includes one or more of the following: a filter group derived based on the current frame to be processed, a filter group based on an adaptive parameter set, and a default filter group.

[0151] When the state of the slice-level disable flag is set to the enable state, the filter group used to filter the corresponding image block includes one or more of the following: a filter group derived based on the current frame to be processed, a filter group based on an adaptive parameter set, and a default filter group; wherein, the filter group set used to filter the corresponding image block is determined from the filter group set selected from the slice where the corresponding image block is located.

[0152] In one embodiment, the reconstructed image frame of the second video frame or the reconstructed image frame of the first video frame is recorded as the current frame to be processed.

[0153] The processing unit 403 is further configured to construct a filtering equation corresponding to the pixel classification category of the current frame to be processed based on the autocorrelation coefficient of the current frame to be processed and the cross-correlation coefficient between the current frame to be processed and the corresponding original image block.

[0154] The processing unit 403 is also used to solve the filtering equation to obtain multiple filter coefficients;

[0155] The processing unit 403 is further configured to merge the obtained multiple filter coefficients according to the target merging rule, and determine the filter group coefficients included in the filtering related parameters of the current frame to be processed based on the merged filter coefficients.

[0156] In one embodiment, if the target merging rule is a rule to merge into one, the processing unit 403 is specifically used to: merge the multiple filter coefficients into one filter coefficient;

[0157] If the target merging rule is used to constrain the maximum number of filters after merging, the processing unit 403 is specifically used to: merge the multiple filter coefficients into M filter coefficients, wherein M is greater than 1 and less than or equal to the maximum number of filters.

[0158] In one embodiment, when the current frame to be processed adopts the cross-component adaptive loop filtering processing logic, when the current frame to be processed is a chroma image block, the processing unit 403 is further configured to take the reconstructed image frame where the current frame to be processed is located as the target pixel category, and obtain the filter coefficients corresponding to the target pixel category.

[0159] The processing unit 403 is further configured to use the filter coefficients corresponding to the target pixel category as the merged filter coefficients.

[0160] In one embodiment, the reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; the processing unit 403 is specifically used for:

[0161] Obtain the filter group derived from the current frame to be processed, and use the filter group derived from the current frame to be processed as the filter group of the current frame to be processed;

[0162] The slice index of the filter bank derived from the current frame to be processed is used as the slice index of the filter bank included in the filter-related parameters of the current frame to be processed, and the derived filter coefficients included in the filter bank derived from the current frame to be processed are the filter coefficients included in the filter-related parameters of the current frame to be processed.

[0163] In one embodiment, the processing unit 403 is specifically used for:

[0164] Without calculating rate-distortion costs, the filter bank derived from the current frame to be processed is directly used as the filter bank for the current frame to be processed.

[0165] In this embodiment, the acquisition unit 401 can determine the target filtering parameters for the reconstructed image frame corresponding to the first video frame after encoding the first video frame in the target video. Then, after acquiring the second video frame to be encoded from the target video, if the encoding process of the second video frame requires reference to the target image block of the reconstructed image frame corresponding to the encoded first video frame in the target video, the filtering unit 402 can perform filtering on the target image block based on the target filtering parameters, using the filtered target image block as a reference for encoding the second video frame. By delaying the filtering operation for the reconstructed image frame, the filtering operation for the reconstructed image frame can be delayed until the frame or image block is used as a reference for motion estimation, effectively reducing memory read / write operations during filtering. Furthermore, when filtering the target image block, the proposed simplified filtering scheme can be combined to further improve filtering efficiency.

[0166] Please see Figure 5 This is a schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 5 The computer device shown in this embodiment may include: one or more processors 501; one or more input devices 502; one or more output devices 503; and a memory 504. The processors 501, input devices 502, output devices 503, and memory 504 are connected via a bus 505. The memory 504 stores a computer program, which includes program instructions, and the processor 501 executes the program instructions stored in the memory 504.

[0167] The memory 504 may include volatile memory, such as random-access memory (RAM); the memory 504 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; the memory 504 may also include a combination of the above types of memory.

[0168] The processor 501 may be a central processing unit (CPU). The processor 501 may further include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), etc. The PLD may be a field-programmable gate array (FPGA), generic array logic (GAL), etc. The processor 501 may also be a combination of the above structures.

[0169] In this embodiment of the invention, the memory 504 is used to store a computer program, the computer program including program instructions, and the processor 501 is used to execute the program instructions stored in the memory 504 to implement the above-mentioned... Figure 3 The steps of the corresponding method.

[0170] In one embodiment, the processor 501 is configured to invoke the program instructions to execute:

[0171] A second video frame to be encoded is obtained from a target video, the target video containing an encoded first video frame, the reconstructed image frame of the first video frame containing one or more image blocks, and the reconstructed image frame of the first video frame corresponding to the target filtering related parameters;

[0172] When encoding the second video frame, the target image block is obtained from the reconstructed image frame of the first video frame;

[0173] The target image block is filtered according to the target filtering parameters to obtain the filtered target image block.

[0174] The filtered target image block is used as the encoding reference information for the second video frame, and the second video frame is encoded.

[0175] In one embodiment, if the target filtering related parameters are determined according to the processing logic of adaptive loop filtering, then the target filtering related parameters include at least one of the following: the pixel classification category of the target image patch and the geometric transformation category;

[0176] If the target filtering parameters are determined according to the cross-component adaptive loop filtering processing logic, then the target filtering parameters do not include the pixel classification category and geometric transformation category of the target image block.

[0177] In one embodiment, when the target filtering related parameters are determined according to the processing logic of the adaptive loop filtering, the target image block is one or more coding tree blocks obtained by dividing the reconstructed image frame of the first video frame, or the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame.

[0178] When the target filtering parameters are determined according to the cross-component adaptive loop filtering processing logic, the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame.

[0179] In one embodiment, motion estimation processing is included before encoding the second video frame; the processor 501 is configured to invoke the program instructions to execute:

[0180] When performing motion estimation processing on the second video frame, the reference image region required for motion estimation of the second video frame is loaded into the motion estimation sliding window;

[0181] When the reference image region loaded in the motion estimation sliding window contains the target image block, and the target image block has not been filtered, the filtering process for the target image block according to the target filtering parameters is triggered.

[0182] If the target image block is included in the reference image region loaded in the motion estimation sliding window, and the target image block has been filtered, the process of using the filtered target image block as the encoding reference information of the second video frame is triggered.

[0183] In one embodiment, the processor 501 is configured to invoke the program instructions to execute:

[0184] Update the motion estimation sliding window;

[0185] When the target image block is removed from the updated motion estimation sliding window, the filtered target image block is stored in external memory, and when the filtered target image is used as encoding reference information again, the filtered target image is retrieved from the external memory.

[0186] In one embodiment, motion compensation processing is included before encoding the second video frame; the target image block includes a target luma block and a target chroma block; and the filtered target image block stored in external memory is the filtered target luma block; the processor 501 is configured to call the program instructions to execute:

[0187] When performing motion compensation processing on the second video frame, the target chroma block is filtered using the target filtering related parameters to obtain the filtered target chroma block.

[0188] The filtered target luminance block and the filtered target chrominance block obtained from the external memory are used as the encoding reference information for the second video frame.

[0189] In one embodiment, the processor 501 is configured to invoke the program instructions to execute:

[0190] Obtain the reconstructed image frame corresponding to the second video frame, and the filtering-related parameters of the reconstructed image frame corresponding to the second video frame;

[0191] The reconstructed image frame of the second video frame is filtered using the filtering-related parameters of the reconstructed image frame corresponding to the second video frame.

[0192] When it is necessary to encode other video frames that use the reconstructed image frame of the second video frame as encoding reference information, the other video frames are encoded using the reconstructed image frame of the filtered second video frame.

[0193] In one embodiment, the reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; the processor 501 is configured to invoke the program instructions to execute:

[0194] The current frame to be processed is filtered using a real-time filtering method.

[0195] In one embodiment, the reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; the processor 501 is configured to invoke the program instructions to execute:

[0196] Obtain the set of available decoding filters for the current frame to be processed, and use the set of available decoding filters as the set of candidate filters for the current frame to be processed; the set of candidate filters contains multiple candidate filter groups.

[0197] Calculate the rate-distortion cost between the current encoded image frame and the current encoded image frame after filtering the current frame to be processed using any candidate filter bank, with the filtered current frame to be processed as the encoding reference information.

[0198] The index of the candidate filter bank that achieves the minimum rate-distortion cost is used as the filter bank index included in the filtering-related parameters of the current frame to be processed.

[0199] In one embodiment, if the target filtering parameters corresponding to the target image block are determined according to the processing logic of adaptive loop filtering, then the set of available filter banks for decoding the current encoded image frame includes one or more of the following: a filter bank based on an adaptive parameter set, or a default filter bank.

[0200] If the target filtering parameters corresponding to the target image block are determined according to the cross-component adaptive loop filtering processing logic, then the set of available filter banks for decoding the current encoded image frame includes filter banks based on the adaptive parameter set.

[0201] In one embodiment, the reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; the processor 501 is configured to invoke the program instructions to execute:

[0202] The disable flag is used as a filtering-related parameter for the current frame to be processed;

[0203] When the slice-level disable flag is on, the image block-level disable flag is either on or off; and when the slice-level disable flag is off, the image block-level disable flag is also off.

[0204] In one embodiment, the processor 501 is configured to invoke the program instructions to perform: calculating the rate distortion cost of the disable flag in the open state and the rate distortion cost in the closed state based on rate distortion, and determining the state of the disable flag to be added to the filter-related parameters based on the calculated rate distortion cost;

[0205] Alternatively, the processor 501 is configured to invoke the program instructions to execute: without performing rate distortion calculation, directly setting the state of the disable flag added to the filter-related parameters to the enable state, wherein the disable flag is a slice-level disable flag or an image block-level disable flag; wherein the slice-level disable flag or the image block-level disable flag in the filter-related parameters is set to the enable state.

[0206] In one embodiment, when the state of the image patch level disable flag is set to the enable state, the filter group for filtering the corresponding image patch includes one or more of the following: a filter group derived based on the current frame to be processed, a filter group based on an adaptive parameter set, and a default filter group.

[0207] When the state of the slice-level disable flag is set to the enable state, the filter group used to filter the corresponding image block includes one or more of the following: a filter group derived based on the current frame to be processed, a filter group based on an adaptive parameter set, and a default filter group; wherein, the filter group set used to filter the corresponding image block is determined from the filter group set selected from the slice where the corresponding image block is located.

[0208] In one embodiment, the reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; the processor 501 is configured to invoke the program instructions to execute:

[0209] Based on the autocorrelation coefficient of the current frame to be processed and the cross-correlation coefficient between the current frame to be processed and the corresponding original image block, a filtering equation corresponding to the pixel classification category of the current frame to be processed is constructed.

[0210] Solving the filtering equation yields multiple filter coefficients;

[0211] The multiple filter coefficients obtained are merged according to the target merging rule, and the filter group coefficients included in the filtering related parameters of the current frame to be processed are determined based on the merged filter coefficients.

[0212] In one embodiment, if the target merging rule is a rule to merge into one, the processor 501 is configured to call the program instructions to execute: merging the plurality of filter coefficients into one filter coefficient;

[0213] If the target merging rule is used to constrain the maximum number of filters after merging, the processor 501 is configured to call the program instructions to execute: merging the plurality of filter coefficients into M filter coefficients, wherein M is greater than 1 and less than or equal to the maximum number of filters.

[0214] In one embodiment, when the current frame to be processed employs cross-component adaptive loop filtering processing logic, and when the current frame to be processed is a chroma image block, the processor 501 is configured to call the program instructions to execute:

[0215] The reconstructed image frame containing the current frame to be processed is taken as the target pixel category, and the filter coefficients corresponding to the target pixel category are obtained;

[0216] The filter coefficients corresponding to the target pixel category are used as the merged filter coefficients.

[0217] In one embodiment, the reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; the processor 501 is configured to invoke the program instructions to execute:

[0218] Obtain the filter group derived from the current frame to be processed, and use the filter group derived from the current frame to be processed as the filter group of the current frame to be processed;

[0219] The slice index of the filter bank derived from the current frame to be processed is used as the slice index of the filter bank included in the filter-related parameters of the current frame to be processed, and the derived filter coefficients included in the filter bank derived from the current frame to be processed are the filter coefficients included in the filter-related parameters of the current frame to be processed.

[0220] In one embodiment, the processor 501 is configured to invoke the program instructions to execute:

[0221] Without calculating rate-distortion costs, the filter bank derived from the current frame to be processed is directly used as the filter bank for the current frame to be processed.

[0222] This invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned actions. Figure 3The method embodiment shown. The computer-readable storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0223] The above-disclosed embodiments are merely partial examples of the present invention and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that all or part of the processes for implementing the above embodiments, and equivalent variations made in accordance with the claims of the present invention, still fall within the scope of the invention.

Claims

1. A video encoding method, characterized in that, include: A second video frame to be encoded is obtained from a target video, the target video containing an encoded first video frame, the reconstructed image frame of the first video frame containing one or more image blocks, and the reconstructed image frame of the first video frame corresponding to the target filtering related parameters; When encoding the second video frame, the target image block is obtained from the reconstructed image frame of the first video frame; The target image block is filtered according to the target filtering parameters to obtain the filtered target image block. The filtered target image block is used as the encoding reference information for the second video frame, and the second video frame is encoded.

2. The method as described in claim 1, characterized in that, If the target filtering related parameters are determined according to the processing logic of adaptive loop filtering, then the target filtering related parameters include at least one of the following: the pixel classification category of the target image block and the geometric transformation category; If the target filtering parameters are determined according to the cross-component adaptive loop filtering processing logic, then the target filtering parameters do not include the pixel classification category and geometric transformation category of the target image block.

3. The method as described in claim 2, characterized in that, When the target filtering related parameters are determined according to the processing logic of the adaptive loop filtering, the target image block is one or more coding tree blocks obtained by dividing the reconstructed image frame of the first video frame, or the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame. When the target filtering parameters are determined according to the cross-component adaptive loop filtering processing logic, the target image block is one or more coding tree units obtained by dividing the reconstructed image frame of the first video frame.

4. The method as described in claim 1, characterized in that, The method includes motion estimation processing before encoding the second video frame; the method further includes: When performing motion estimation processing on the second video frame, the reference image region required for motion estimation of the second video frame is loaded into the motion estimation sliding window; When the reference image region loaded in the motion estimation sliding window contains the target image block, and the target image block has not been filtered, the filtering process for the target image block according to the target filtering parameters is triggered. If the target image block is included in the reference image region loaded in the motion estimation sliding window, and the target image block has been filtered, the process of using the filtered target image block as the encoding reference information of the second video frame is triggered.

5. The method as described in claim 4, characterized in that, The method further includes: Update the motion estimation sliding window; When the target image block is removed from the updated motion estimation sliding window, the filtered target image block is stored in external memory, and when the filtered target image is used as encoding reference information again, the filtered target image is retrieved from the external memory.

6. The method as described in claim 4, characterized in that, The second video frame is processed by motion compensation before encoding. The target image block includes a target luma block and a target chroma block. The filtered target image block stored in external memory is the filtered target luma block. The method further includes: When performing motion compensation processing on the second video frame, the target chroma block is filtered using the target filtering related parameters to obtain the filtered target chroma block. The filtered target luminance block and the filtered target chrominance block obtained from the external memory are used as the encoding reference information for the second video frame.

7. The method as described in claim 1, characterized in that, After encoding the second video frame, the method further includes: Obtain the reconstructed image frame corresponding to the second video frame, and the filtering-related parameters of the reconstructed image frame corresponding to the second video frame; The reconstructed image frame of the second video frame is filtered using the filtering-related parameters of the reconstructed image frame corresponding to the second video frame. When it is necessary to encode other video frames that use the reconstructed image frame of the second video frame as encoding reference information, the other video frames are encoded using the reconstructed image frame of the filtered second video frame.

8. The method as described in claim 1 or 7, characterized in that, The reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; The methods for filtering the current frame to be processed include: The current frame to be processed is filtered using a real-time filtering method.

9. The method as described in claim 1 or 7, characterized in that, The reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; The methods for determining the filtering-related parameters of the current frame to be processed include: Obtain the set of available decoding filters for the current frame to be processed, and use the set of available decoding filters as the set of candidate filters for the current frame to be processed; the set of candidate filters contains multiple candidate filter groups. Calculate the rate-distortion cost between the current encoded image frame and the current encoded image frame after filtering the current frame to be processed using any candidate filter bank, with the filtered current frame to be processed as the encoding reference information. The index of the candidate filter bank that achieves the minimum rate-distortion cost is used as the filter bank index included in the filtering-related parameters of the current frame to be processed.

10. The method as described in claim 9, characterized in that, If the target filtering parameters corresponding to the target image block are determined according to the processing logic of adaptive loop filtering, then the set of available filter banks for decoding the current encoded image frame includes one or more of the following: filter banks based on adaptive parameter sets, and default filter banks. If the target filtering parameters corresponding to the target image block are determined according to the cross-component adaptive loop filtering processing logic, then the set of available filter banks for decoding the current encoded image frame includes filter banks based on the adaptive parameter set.

11. The method as described in claim 1 or 7, characterized in that, The reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; The methods for determining the filtering-related parameters of the current frame to be processed include: The disable flag is used as a filtering-related parameter for the current frame to be processed; When the slice-level disable flag is on, the image block-level disable flag is either on or off; and when the slice-level disable flag is off, the image block-level disable flag is also off.

12. The method as described in claim 11, characterized in that, The method for determining the state of the disabled flag includes: calculating the rate distortion cost of the disabled flag in the open state and the rate distortion cost in the closed state based on rate distortion, and determining the state of the disabled flag added to the filter-related parameters based on the calculated rate distortion cost; Alternatively, the method for determining the state of the disable flag includes: without performing rate distortion calculation, directly setting the state of the disable flag added to the filter-related parameters to the enable state, wherein the disable flag is a slice-level disable flag or an image block-level disable flag; wherein the slice-level disable flag or the image block-level disable flag in the filter-related parameters is set to the enable state.

13. The method as described in claim 12, characterized in that, When the state of the image patch level disable flag is set to the enable state, the filter group used to filter the corresponding image patch includes one or more of the following: a filter group derived based on the current frame to be processed, a filter group based on an adaptive parameter set, and a default filter group. When the state of the slice-level disable flag is set to the enable state, the filter group used to filter the corresponding image block includes one or more of the following: a filter group derived based on the current frame to be processed, a filter group based on an adaptive parameter set, and a default filter group; wherein, the filter group set used to filter the corresponding image block is determined from the filter group set selected from the slice where the corresponding image block is located.

14. The method as described in claim 1 or 7, characterized in that, The reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; The methods for determining the filtering-related parameters of the current frame to be processed include: Based on the autocorrelation coefficient of the current frame to be processed and the cross-correlation coefficient between the current frame to be processed and the corresponding original image block, a filtering equation corresponding to the pixel classification category of the current frame to be processed is constructed. Solving the filtering equation yields multiple filter coefficients; The multiple filter coefficients obtained are merged according to the target merging rule, and the filter group coefficients included in the filtering related parameters of the current frame to be processed are determined based on the merged filter coefficients.

15. The method as described in claim 14, characterized in that, If the target merging rule is to merge into one, the step of merging the multiple filter coefficients obtained according to the target merging rule includes: merging the multiple filter coefficients into one filter coefficient; If the target merging rule is used to constrain the maximum number of filters after merging; merging the multiple filter coefficients obtained according to the target merging rule includes: merging the multiple filter coefficients into M filter coefficients, where M is greater than 1 and less than or equal to the maximum number of filters.

16. The method as described in claim 14, characterized in that, When the current frame to be processed uses cross-component adaptive loop filtering processing logic, and when the current frame to be processed is a chroma image patch, the method further includes: The reconstructed image frame containing the current frame to be processed is taken as the target pixel category, and the filter coefficients corresponding to the target pixel category are obtained; The filter coefficients corresponding to the target pixel category are used as the merged filter coefficients.

17. The method as described in claim 1 or 7, characterized in that, The reconstructed image frame of the second video frame, or the reconstructed image frame of the first video frame, is recorded as the current frame to be processed; The methods for determining the filtering-related parameters of the current frame to be processed include: Obtain the filter group derived from the current frame to be processed, and use the filter group derived from the current frame to be processed as the filter group of the current frame to be processed; The slice index of the filter bank derived from the current frame to be processed is used as the slice index of the filter bank included in the filter-related parameters of the current frame to be processed, and the derived filter coefficients included in the filter bank derived from the current frame to be processed are the filter coefficients included in the filter-related parameters of the current frame to be processed.

18. The method as described in claim 17, characterized in that, The step of using the filter bank derived from the current frame to be processed as the filter bank of the current frame to be processed includes: directly using the filter bank derived from the current frame to be processed as the filter bank of the current frame to be processed without performing rate-distortion cost calculation.

19. A video encoding apparatus, characterized in that, include: An acquisition unit is used to acquire a second video frame to be encoded from a target video, wherein the target video contains an encoded first video frame, the reconstructed image frame of the first video frame contains one or more image blocks, and the reconstructed image frame of the first video frame corresponds to the target filtering related parameters; The acquisition unit is further configured to acquire a target image block from the reconstructed image frame of the first video frame when encoding the second video frame; A filtering unit is used to filter the target image block according to the target filtering parameters to obtain a filtered target image block. The processing unit is used to encode the second video frame by using the filtered target image block as the encoding reference information of the second video frame.

20. A computer device, characterized in that, The device includes a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the method as described in any one of claims 1 to 18.

21. A computer program product comprising computer instructions stored in a computer-readable storage medium; a processor of a computer device reading the computer instructions from the computer-readable storage medium and executing the computer instructions to cause the computer device to perform the method as described in any one of claims 1 to 18.