A video processing method and related device

By employing a chroma block copying intra-prediction mode in video coding, and utilizing the displacement vector of the luma co-position block to determine the predicted value of the chroma block, the problem of low coding efficiency caused by the inability to use intra-frame motion compensation for chroma blocks is solved, achieving more efficient coding performance.

CN119484848BActive Publication Date: 2026-07-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 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
2023-08-10
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing video coding technologies, when chroma blocks and luma blocks use inconsistent partitioning structures, chroma blocks cannot use intra-frame motion compensation techniques, resulting in low coding efficiency.

Method used

By determining the current chroma block in the video bitstream and using the chroma block copy intra-prediction mode, the target displacement vector of the luma co-position block is obtained. Based on the target displacement vector, the predicted value of the chroma block is determined to reconstruct the decoded image corresponding to the current chroma block.

Benefits of technology

It improves the encoding performance of video coding, enhances the encoding and decoding efficiency of chroma blocks, and eliminates the need for intra-frame prediction processing of the current chroma block.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484848B_ABST
    Figure CN119484848B_ABST
Patent Text Reader

Abstract

A video processing method and related device are provided. The method includes: determining a current chroma block in a video bitstream, the current chroma block adopting a chroma block copy intra prediction mode; obtaining a target displacement vector of a luma collocated block corresponding to the current chroma block; determining a prediction value of the current chroma block based on the target displacement vector; and the prediction value being used for reconstructing a decoded image corresponding to the current chroma block. The method can determine the prediction value of the chroma block by using the displacement vector of the luma collocated block, thereby improving the encoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio and video technology, specifically to the field of video coding technology, and in particular to a video processing method, a video processing apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] In existing video coding technologies, a block-based hybrid coding framework is employed, which divides the original video data into a series of coding units (CUs). Combining prediction, transform, and entropy coding methods, video data compression is achieved. Currently, mainstream video coding standards such as AVS3 (Audio Video Coding Standard 3) allow for separate encoding of luma and chroma blocks. However, in practice, it has been found that if the chroma and luma blocks of the current coding unit use inconsistent partitioning structures, intra-frame motion compensation techniques cannot be used for the chroma blocks, resulting in low coding efficiency. Summary of the Invention

[0003] This application provides a video processing method and related equipment that can determine the predicted value of the chroma block by using the displacement vector of the luminance co-position block, thereby improving coding performance.

[0004] On one hand, embodiments of this application provide a video processing method, the method comprising:

[0005] Determine the current chroma block in the video stream, and use the chroma block copy intra-prediction mode for the current chroma block;

[0006] Obtain the target displacement vector of the luminance co-position block corresponding to the current chrominance block;

[0007] Based on the target displacement vector, the predicted value of the current chroma block is determined; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0008] On one hand, embodiments of this application provide a video processing method, the method comprising:

[0009] Determine the current chroma block in the video, and use the chroma block copy intra-prediction mode for the current chroma block;

[0010] Obtain the target displacement vector of the luminance co-position block corresponding to the current chrominance block;

[0011] Based on the target displacement vector, the predicted value of the current chroma block is determined; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0012] The video is encoded based on the predicted values ​​of the current chroma blocks to generate a video stream.

[0013] On one hand, embodiments of this application provide a video processing apparatus, the apparatus comprising:

[0014] The determination unit is used to determine the current chroma block in the video bitstream. The current chroma block adopts the chroma block copy intra-prediction mode.

[0015] The processing unit is used to obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block;

[0016] The processing unit is also used to determine the predicted value of the current chroma block based on the target displacement vector; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0017] In one possible implementation, the chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode; or, the chroma block copy intra-prediction mode is a sub-mode of the normal intra-prediction mode.

[0018] Ordinary intra-frame prediction modes include at least one of the following: intra-frame prediction DC coefficient mode, angle-based intra-frame prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-frame reference pixel derived prediction values.

[0019] In one possible implementation, after determining the current chroma block in the video bitstream, the processing unit 902 is further configured to perform the following operations:

[0020] Divide the current chroma block into P×Q chroma sub-blocks, where P and Q are both integers;

[0021] Obtain the block vector of the corresponding luminance sub-block for each chroma sub-block;

[0022] Based on the obtained P×Q block vectors, the predicted value of the current chroma block is determined.

[0023] In one possible implementation, the processing unit is also used to perform the following operations:

[0024] Decode the video stream to obtain mode indication information. The mode indication information is used to indicate whether the current chroma block adopts the chroma block copy intra-prediction mode.

[0025] The mode indication information includes at least one of the following: sequence header flag, image header flag, slice header flag, coding unit flag, implicit information, and chroma indication information.

[0026] In one possible implementation, if the mode indication information is a sequence header flag, the mode indication information is set in the sequence header of the current sequence to which the current chroma block belongs; when the sequence header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the sequence header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0027] If the mode indication information is an image header flag, the mode indication information is set in the image header of the current image to which the current chroma block belongs; when the image header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the image header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0028] If the mode indication information is a title block flag, the mode indication information is set in the title block of the current slice to which the current chroma block belongs; when the title block flag is the first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the title block flag is the second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0029] If the mode indication information is a coding unit flag, the mode indication information is set in the current coding unit; when the coding unit flag is a first preset value, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode; when the coding unit flag is a second preset value, it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode.

[0030] If the mode indication information is implicit, then when the implicit information indicates that the luminance sample at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset condition, the current chroma block is instructed to adopt the chroma block copy intra-prediction mode.

[0031] If the mode indication information is chroma indication information, then when the chroma indication information indicates that the current chroma block adopts the preset intra-prediction mode, and the luminance sample at the preset position in the luminance co-position block meets the preset conditions, the current chroma block is indicated to adopt the chroma block copy intra-prediction mode; the preset intra-prediction mode includes the inheritance mode.

[0032] In one possible implementation, the processing unit is also used to perform the following operations:

[0033] Check if the video bitstream meets the decoding requirements;

[0034] If the video stream meets the decoding conditions, then the step of decoding the video stream and obtaining the mode indication information is executed.

[0035] In one possible implementation, the decoding conditions include: the color format used by the video stream is a format that includes chroma components;

[0036] When the mode indication information is set in the current coding unit to which the current chroma block belongs, the decoding conditions include any one or more of the following:

[0037] The current coding unit contains only chroma components;

[0038] The luminance sample point at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset conditions;

[0039] If there are multiple preset locations, then the number of brightness samples that meet the preset conditions is at least one, or greater than or equal to a preset threshold.

[0040] In one possible implementation, the preset position can be determined in any of the following ways:

[0041] Determine a preset chromaticity sample point in the current chromaticity block, and determine the preset position of the corresponding luminance sample point in the luminance co-position block based on the position of the preset chromaticity sample point.

[0042] Determine the preset position from the brightness co-position block;

[0043] Based on the division method of the luminance co-position block, the preset position is determined in each sub-block obtained by dividing the luminance co-position block;

[0044] Divide the luminance co-position block into M×N sub-blocks, and use a specified position in the M×N sub-blocks as a preset position. The specified position includes any one of the following positions: the center, top left corner, top right corner, bottom left corner, and bottom right corner of the sub-block. M and N are both positive integers.

[0045] In one possible implementation, the preset conditions include any one or more of the following:

[0046] The luminance samples adopt any one of the modes in a specific mode set, which includes: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, or any one or more prediction modes with intra-frame displacement vectors.

[0047] The brightness samples have valid displacement vectors;

[0048] The intra-frame prediction history motion information table for the current chroma block is not empty.

[0049] In one possible implementation, the processing unit obtains the target displacement vector of the luminance co-position block corresponding to the current chroma block, and performs the following operations:

[0050] Construct a list of candidate displacement vectors for the luminance co-position block corresponding to the current chrominance block;

[0051] Determine the target displacement vector from the list of candidate displacement vectors.

[0052] In one possible implementation, the processing unit constructs a list of candidate shift vectors for the luminance co-position block corresponding to the current chroma block, including any one or more of the following methods:

[0053] Add the displacement vectors of the luminance samples in the luminance co-location block that meet the specified mode to the candidate displacement vector list. The specified mode includes any one of the following: intra-block copy prediction mode, intra-string copy prediction normal string mode, string copy intra-prediction non-normal string mode, intra-template matching mode, inter-frame prediction mode, affine motion mode, inter-frame composite mode, and angle-weighted prediction mode.

[0054] Add the displacement vectors of the spatial adjacent blocks corresponding to the brightness co-position block to the candidate displacement vector list;

[0055] The displacement vectors from the historical motion information table or the intra-frame predicted historical motion information table will be added to the candidate displacement vector list.

[0056] After offsetting, the candidate displacement vectors are added to the candidate displacement vector list. The candidate displacement vectors include any one or more of the following: displacement vectors of luminance samples that meet the specified mode in the luminance co-location block, displacement vectors of spatial adjacent blocks corresponding to the luminance co-location block, and displacement vectors of spatial adjacent blocks corresponding to the luminance co-location block.

[0057] If no valid displacement vector exists in the brightness co-location block, the default displacement vector is added to the candidate displacement vector list; or, the displacement vector in the candidate displacement vector list is set to an invalid value.

[0058] In one possible implementation, the displacement vectors in the candidate displacement vector list must satisfy at least one of the following conditions:

[0059] The reference block of the lumen co-position block satisfies the reference range limitation of the intra-block copy prediction mode;

[0060] The reference block of the luminance co-position block and the displacement vector both satisfy the reference range limitation of the intra-string copy prediction normal string sub-mode;

[0061] The displacement vector is not repeated by any other displacement vector outside the candidate displacement vector list;

[0062] The displacement vector is not repeated with the first N or last N displacement vectors in the candidate displacement vector list, where N is an integer.

[0063] In one possible implementation, the sorting of displacement vectors in the candidate displacement vector list can be any of the following:

[0064] Arranged in a predetermined order;

[0065] The costs are sorted according to the cost of each displacement vector, and the costs include at least: rate distortion cost, sum of absolute errors, sum of absolute errors after transformation, sum of squared differences, sum of absolute errors after mean removal, and sum of absolute variances after mean removal.

[0066] Sort by displacement vector type, the displacement vector types include at least: block vector, string vector, motion vector, and default vector;

[0067] The displacement vectors are sorted according to their type and the cost of each vector.

[0068] In one possible implementation, the processing unit determines the target displacement vector from a list of candidate displacement vectors, including any of the following methods:

[0069] The Kth displacement vector in the candidate displacement vector list is taken as the target displacement vector, where K is a positive integer;

[0070] The target displacement vector is determined from the list of candidate displacement vectors according to the displacement vector index;

[0071] The candidate displacement vector is obtained from the candidate displacement vector list, scaled according to the color format sampling ratio, and the integer pixel precision of the scaled displacement vector is retained to obtain the target displacement vector.

[0072] Retrieve candidate displacement vectors from the list of candidate displacement vectors and use them as target displacement vectors.

[0073] In one possible implementation, the processing unit determines the predicted value of the current chromaticity block based on the target displacement vector, for performing the following operations:

[0074] If the target displacement vector has integer pixel precision, then motion compensation is performed on the target displacement vector to derive the predicted value of the current chroma block; or,

[0075] If the target displacement vector has pixel-level precision, then the target displacement vector is interpolated, and motion compensation is performed on the interpolated target displacement vector to derive the predicted value of the current chroma block.

[0076] In one possible implementation, the processing unit is also used to perform the following operations:

[0077] If there is no target displacement vector in the luma co-location block corresponding to the current chroma block, the intra-frame prediction mode is used to derive the predicted value of the current chroma block.

[0078] The intra-frame prediction modes include: cross-component intra-frame prediction modes or specified intra-frame prediction modes; cross-component intra-frame prediction modes include: cross-component two-step prediction mode and cross-component linear model prediction mode; specified intra-frame prediction modes include any one or more of the following: intra-frame prediction DC coefficient mode, intra-frame prediction bilinear prediction mode, intra-frame prediction planar prediction mode, horizontal intra-frame prediction mode, and vertical intra-frame prediction mode.

[0079] In one possible implementation, the processing unit is also used to perform the following operations:

[0080] If the current chroma block adopts the chroma block copy intra-prediction mode, then based on the information of the target luminance sample in the luminance co-position block corresponding to the current chroma block, it is determined whether the current chroma block needs to be subjected to residual decoding. The target luminance sample is the luminance sample corresponding to the target displacement vector.

[0081] If it is determined that the current chroma block needs to be subjected to residual decoding, then residual decoding is performed on the current chroma block to obtain the residual value;

[0082] Based on the residual value and predicted value of the current chroma block, reconstruct the decoded image corresponding to the current chroma block.

[0083] In one possible implementation, the luma co-position block corresponding to the current chroma block contains multiple luma blocks; the condition for determining that the current chroma block does not need to undergo residual decoding includes any of the following:

[0084] If the target brightness sample point uses intra-frame string copy prediction normal string sub-mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0085] If the target brightness sample point adopts the intra-frame string copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0086] If the target brightness sample uses intra-block copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0087] If the target brightness sample point adopts the intra-string copy prediction normal string mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0088] If the target brightness sample point adopts the intra-string copy prediction mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0089] The criterion for determining whether the luminance block containing the target luminance sample needs residual coding is based on: the coefficient flag of the luminance block or the prediction mode of the current chrominance block.

[0090] On one hand, embodiments of this application provide a video processing apparatus, the apparatus comprising:

[0091] The determination unit is used to determine the current chroma block in the video. The current chroma block adopts the chroma block copy intra-prediction mode.

[0092] The processing unit is used to obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block;

[0093] The processing unit is also used to determine the predicted value of the current chroma block based on the target displacement vector; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block;

[0094] The processing unit is also used to encode the video based on the predicted value of the current chroma block to generate a video bitstream.

[0095] On one hand, embodiments of this application provide a computer device, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the video processing method described above.

[0096] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when read and executed by a processor of a computer device, causes the computer device to perform the aforementioned video processing method.

[0097] On one hand, embodiments of this application provide 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 video processing method.

[0098] In this embodiment, the current chroma block in the video stream can be determined, and the current chroma block adopts the chroma block copy intra-prediction mode; the target displacement vector of the luma co-position block corresponding to the current chroma block is obtained; based on the target displacement vector, the predicted value of the current chroma block is determined; this predicted value is used to reconstruct the decoded image corresponding to the current chroma block. As can be seen above, during the decoding process of the video stream, when it is determined that the current chroma block adopts the chroma block copy intra-prediction mode, the displacement vector information of the luma co-position block can be used to determine the predicted value of the current chroma block, eliminating the need for intra-prediction processing on the current chroma block. This improves the encoding and decoding efficiency of the current chroma block, thereby effectively enhancing coding performance. Attached Figure Description

[0099] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0100] Figure 1 This is a basic workflow diagram of a video encoder provided in an embodiment of this application;

[0101] Figure 2 This is a schematic diagram of an inter-frame prediction provided in an embodiment of this application;

[0102] Figure 3a This is a schematic diagram illustrating the establishment of an airspace list according to an embodiment of this application;

[0103] Figure 3b This is a schematic diagram illustrating the creation of a time-domain list provided in an embodiment of this application;

[0104] Figure 4a This is a schematic diagram of an intra-block copy prediction process provided in an embodiment of this application;

[0105] Figure 4b This is a schematic diagram of an intra-frame string copy prediction process provided in an embodiment of this application;

[0106] Figure 4c This is a schematic diagram of an intra-string copy prediction non-ordinary string sub-mode provided in an embodiment of this application;

[0107] Figure 4d This is a schematic diagram of a common intra-frame prediction mode for luminance provided in an embodiment of this application;

[0108] Figure 4e This is a schematic diagram of a template matching process provided in an embodiment of this application;

[0109] Figure 4f This is a schematic diagram of a video sampling method provided in an embodiment of this application;

[0110] Figure 4g This is a schematic diagram of a basic block partitioning structure provided in an embodiment of this application;

[0111] Figure 4h This is a schematic diagram illustrating the position of intra-frame prediction for chroma block duplication provided in an embodiment of this application;

[0112] Figure 4i This is a schematic diagram of the position of a pixel sample point provided in an embodiment of this application;

[0113] Figure 5This is a schematic diagram of the structure of a video processing system provided in an embodiment of this application;

[0114] Figure 6 This is a flowchart illustrating a video processing method provided in an embodiment of this application;

[0115] Figure 7a This is a schematic diagram of a process for determining a luminance co-location block provided in an embodiment of this application;

[0116] Figure 7b This is a schematic diagram of the sorting of displacement vectors provided in an embodiment of this application;

[0117] Figure 8 This is a flowchart illustrating another video processing method provided in an embodiment of this application;

[0118] Figure 9 This is a schematic diagram of the structure of a video processing device provided in an embodiment of this application;

[0119] Figure 10 This is a schematic diagram of another video processing device provided in an embodiment of this application;

[0120] Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0121] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0122] The following is a description of the technical terms used in this application:

[0123] I. Video Encoding

[0124] A video can consist of one or more video frames, each containing a portion of the video signal. Video signals can be acquired in two ways: by a camera or by a computer. Because the statistical characteristics differ depending on the acquisition method, the compression encoding methods for the video may also vary.

[0125] Among mainstream video coding technologies, taking HEVC (High Efficiency Video Coding, international video coding standard HEVC / H.265), VVC (versatile video coding, international video coding standard VVC / H.266), and AVS3 (Audio Video Coding Standard 3) as examples, a hybrid coding framework is adopted. Under this hybrid coding framework, the following series of operations and processing can be performed on the video:

[0126] 1) Block Partition Structure: Based on the size of the current input frame (i.e., the video frame being encoded or decoded), the current frame can be divided into several non-overlapping processing units. 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 CTU can be further subdivided into one or more basic coding units, called CUs (coding units or coding blocks). It should be understood that a block is a structure after image partitioning. In the encoding process, the block structure can include: coding blocks, coding units, coding tree units, coding sub-blocks, and superblocks; similarly, in the decoding process, the block structure can include: decoding blocks, decoding units, decoding tree units, decoding sub-blocks, and superblocks. Each CU is the most basic element in an encoding process. The following embodiments of this application describe various encoding and decoding processes that may be used for each CU.

[0127] 2) Predictive Coding: This includes intra-frame prediction and inter-frame prediction modes. The original video signal contained in the current CU (i.e., the CU being encoded or decoded in the current frame) is predicted by the reconstructed video signal in a selected reference CU to obtain the residual video signal. Here, the current CU can also be called the current block, the video frame containing the current block is called the current frame, the reference CU used for prediction of the current block can also be called the reference block of the current block, and the video frame containing the reference block is called the reference frame. The encoder needs to select the most suitable predictive coding mode from among many possible predictive coding modes for the current CU and inform the decoder. Predictive coding modes can include:

[0128] a. Intra-picture prediction: The reconstructed video signal used for prediction comes from already coded and reconstructed regions within the same video frame, meaning the current block and the reference block are located in the same video frame. The basic idea of ​​intra-picture prediction is to remove spatial redundancy by utilizing the correlation between adjacent pixels within the same video frame. In video coding, adjacent pixels refer to the reconstructed pixels of already coded CUs surrounding the current CU within the same video frame.

[0129] b. Inter(picture)Prediction: The reconstructed video signal used for prediction comes from other video frames that have already been encoded and are different from the current frame. That is, the current block and the reference block are located in different video frames.

[0130] 3) Transform Coding and Quantization: The residual video signal undergoes transform operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform) to be converted into the transform domain, where the coefficients are called transform coefficients. The residual video signal in the transform domain is then further subjected to lossy quantization, losing some information to make the quantized signal more suitable for compression.

[0131] In some video coding standards, there may be more than one transform option to choose from. Therefore, the encoder needs to select one of the transforms for the current CU and inform the decoder. The fineness of quantization is usually determined by QP (Quantization Parameters). When the QP value is large, it means that a larger range of transform coefficients will be quantized into the same output, which usually results in greater distortion and a lower bitrate. Conversely, when the QP value is small, it means that a smaller range of transform coefficients will be quantized into the same output, which usually results in less distortion and a higher bitrate.

[0132] 4) Entropy Coding or Statistical Coding: The quantized transform domain signal is statistically compressed and encoded based on the frequency of each value, ultimately outputting a binary (0 or 1) video bitstream. Simultaneously, encoding generates other information, such as the selected predictive coding mode and motion vectors, which also require entropy coding to reduce the bitrate. Statistical coding is a lossless coding method that effectively reduces the bitrate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) or Content Adaptive Binary Arithmetic Coding (CABAC).

[0133] 5) Loop Filtering: After the encoded CU has undergone inverse quantization, inverse transform, and prediction compensation operations (the reverse operations of 2) to 4) above, the corresponding decoded image can be reconstructed. Compared with the original image, the reconstructed decoded image differs in some information due to the influence of quantization, resulting in distortion. Therefore, filters can be used to filter the reconstructed decoded image to effectively reduce the degree of distortion caused by quantization. Filters can be, for example, deblocking filters, SAO (sample adaptive offset), or ALF (adaptive loop filter), etc. Since these filtered reconstructed decoded images will serve as reference CUs for other CUs to be encoded subsequently and applied in the prediction process of other CUs, the above filtering operation is also called loop filtering, or filtering operation within the encoding loop.

[0134] Based on the description of steps 1)-5) above, this application embodiment provides a basic workflow diagram of a video encoder. Please refer to... Figure 1 , Figure 1 This is a basic workflow diagram of a video encoder provided in an embodiment of this application. Figure 1 The current block is the k-th CU in the current frame (current image). Figure 1 The s shown k Taking [x, y] as an example, k is a positive integer, and k is less than or equal to the total number of CUs contained in the current frame. k [x, y] represents the pixel (or simply pixel) with coordinates [x, y] in the k-th CU, where x represents the x-coordinate of the pixel and y represents the y-coordinate of the pixel; s kAfter processing such as motion compensation or intra-frame prediction, the predicted signal can be obtained from [x,y]. and the original signal s k Subtracting [x,y] yields the residual video signal u. k [x,y]; then, for the residual video signal u k The [x,y] region undergoes transformation and quantization. The quantization output data has two different destinations, A and B.

[0135] A: The data output from the quantization process can be sent to the entropy encoder for entropy encoding to obtain the encoded bitstream (i.e., video bitstream), and then the bitstream is output to a buffer for storage, waiting to be transmitted.

[0136] B. The data output from the quantization process can be subjected to inverse quantization and inverse transform processing to obtain the inversely transformed residual video signal u. ′ k [x,y]. Then, the inverse-transformed residual video signal u ′ k [x,y] and the predicted signal Adding them together yields a new prediction signal. And new prediction signals The new prediction signal is then saved to the buffer of the current image. After intra-frame prediction processing, the following is obtained: New prediction signals The reconstructed signal s can be obtained after loop filtering. ′ k [x,y], and reconstruct the signal s ′ k [x, y] is stored in the decoded image buffer for use in generating the reconstructed video. Reconstructed signal s ′ k [x,y] is obtained after motion compensation prediction processing. in It can represent a reference block, m x and m y These represent the horizontal and vertical components of the motion vector of the reference block, respectively.

[0137] In some embodiments, mainstream video coding standards such as HEVC, VVC, and AVS3 employ a block-based hybrid coding framework. This framework divides the original video data into a series of coded blocks and combines video coding methods such as prediction, transform, and entropy coding to achieve video data compression. Motion compensation is a commonly used prediction method in video coding. Based on the redundancy characteristics of video content in the temporal or spatial domains, motion compensation derives the predicted value of the current block from already coded reference blocks. These prediction methods include inter-frame prediction, intra-frame block copy prediction, and intra-frame string copy prediction. In specific coding implementations, these prediction methods may be used individually or in combination. For coded blocks using these prediction methods, one or more two-dimensional displacement vectors are typically explicitly or implicitly encoded in the video bitstream. These displacement vectors indicate the displacement of the current block (or its sibling blocks) relative to one or more reference blocks.

[0138] It should be noted that the displacement vector may have different names in different prediction modes and different implementations. This article will describe them in the following ways: 1) The displacement vector in inter-frame prediction is called the motion vector (MV); 2) The displacement vector in intra-frame block copy prediction is called the block vector (BV); 3) The displacement vector in intra-frame string copy prediction is called the string vector (SV).

[0139] The following section introduces the relevant background technology involved in this application:

[0140] (1) Inter-frame prediction

[0141] Inter-frame prediction refers to using the correlation in the temporal domain of video to predict the pixels of the current image using pixels from neighboring encoded images. This effectively removes temporal redundancy and saves bits of encoded residual data. (See section 2.) Figure 2 This is a schematic diagram of an inter-frame prediction method provided in an embodiment of this application. Wherein, in Figure 2 In the image, P is the current frame, Pr is the reference frame, B is the current block, and Br is the reference block of B. B' and B have the same coordinate position in the image (i.e., B' is the co-located block of B), and the coordinate of Br is (x... r y r The coordinates of B' are (x, y). The displacement between the current block and its reference block is called the motion vector (MV), that is: MV = (x, y). r -x, y r -y).

[0142] Considering the strong correlation between neighboring blocks in the temporal or spatial domains, MV prediction techniques can be used to further reduce the bits required to encode MVs. In H.265 / HEVC, inter-frame prediction includes two MV prediction modes: Merge and AMVP (Advanced Motion Vector Prediction). The Merge and AMVP modes are described in detail below.

[0143] 1) Merge Mode: A candidate MV list is created for the current PU (Prediction Unit), containing 5 candidate MVs (and their corresponding reference images). These 5 candidate MVs are iterated through, and the one with the lowest rate-distortion cost is selected as the optimal MV. If the codec creates the candidate list in the same way, the encoder only needs to transmit the index of the optimal MV in the candidate list. It's important to note that HEVC's MV prediction technique also has a skip mode, a special case of Merge mode. In Merge mode, after finding the optimal MV, if the current block and the reference block are essentially the same, then residual data does not need to be transmitted; only the MV index and a skip flag need to be transmitted.

[0144] The Merge mode creates a candidate MV list that includes both spatial and temporal scenarios. For BSlice, it also includes a combined list approach. The spatial list provides a maximum of four candidate MVs, and its creation is as follows: Figure 3a As shown, Figure 3a This is a schematic diagram illustrating the establishment of a spatial domain list according to an embodiment of this application. The spatial domain list is established in the order A1->B1->B0->A0->(B2), where B2 is a substitute. That is, when one or more of A1, B1, B0, and A0 are missing, the motion information of B2 needs to be used. The temporal domain list provides at most one candidate MV. The establishment of the temporal domain list is as follows: Figure 3b As shown, Figure 3b This is a schematic diagram of establishing a time-domain list provided in an embodiment of this application. The MV of the current PU can be obtained by scaling the MV of the corresponding PUs according to the following formula:

[0145] curMV=td * colMV / tb formula (1)

[0146] In formula (1) above, curMV and colMV represent the MV of the current PU and the MV of the peer PU, respectively, and td and tb represent the distances between the current image and the peer image and their reference images, respectively. If the PU at position D0 on the peer block is unavailable, it is replaced by the peer PU at position D1. For PUs in a B Slice, since there are two MVs, their MV candidate list also needs to provide two MVPs (Motion Vector Prediction). HEVC generates a combination list for the B Slice by combining the first four candidate MVs in the MV candidate list in pairs.

[0147] 2) AMVP Mode: Utilizes the correlation of MVs (Motion Messages) between neighboring blocks in the spatial and temporal domains to build a candidate MV list for the current PU (Power Processing Unit). Unlike Merge mode, AMVP mode selects the optimal predicted MV from the built MV candidate list and performs differential coding with the optimal MV obtained through motion search for the current block to be encoded, i.e., encoded MVD = MV - MVP. The decoder builds the same MV candidate list and only needs the MVD and MVP's sequence number (or index) in the MV candidate list to calculate the MV of the current decoded block. The AMVP candidate MV list also includes both spatial and temporal domain cases, but the AMVP list length is 2.

[0148] HMVP is a new motion vector prediction technique adopted in H.266 / VVC. HMVP is a motion vector prediction method based on historical information. The motion vectors (MVs) of historical coding blocks are stored in the HMVP list and used as the MVP of the current CU. H.266 / VVC adds the HMVP to the MV candidate list of the Merge mode, after the spatial and temporal MVPs. The HMVP technique stores the motion vectors (MVs) of historical coding blocks in a first-in-first-out (FIFO) queue. If a stored candidate MV is the same as the MV that was just encoded, this duplicate candidate MV is removed, and all candidate MVs in the HMVP are shifted forward, with the MV of the current coding unit (CU) added to the end of the FIFO. If the MV of the current coding unit is different from any candidate MV in the FIFO, the latest MV is added to the end of the FIFO. When adding a new MV to the HMVP list, if the current HMVP list has reached its maximum length, the first candidate MV in the FIFO is removed, and the latest MV is added to the end of the FIFO. The HMVP list is reset (cleared) when a new CTU line is encountered. In H.266 / VVC, the HMVP list size S is set to 6. To reduce the number of redundant check operations, the following simplification is introduced:

[0149] 1) Set the number of candidates in the HMVP list generated from the Merge list to (N <= 4)? M: (8-N). Where N represents the number of existing candidate MVs in the Merge list, and M represents the number of available HMVP candidate MVs in the table.

[0150] 2) Once the length of the available Merge list reaches the maximum allowed length minus 1, the HMVP merge candidate list building process terminates.

[0151] (2) Intra-block copy prediction

[0152] 1) Intra Block Copy (IBC) is an intra-frame coding tool adopted in the HEVC Screen Content Coding (SCC) extension, significantly improving the coding efficiency of screen content. AVS3 and VVC also employ IBC technology to enhance screen content coding performance; in AVS3, this technique is called Intra Block Copy Prediction. IBC utilizes the spatial correlation of screen content video, using the pixel values ​​of already encoded blocks in the current image to predict the pixel values ​​of the current coding block. This eliminates the need to encode the Block Vector Difference (BVD) value of the current coding block, effectively saving the bits required for encoding pixels. See also... Figure 4a , Figure 4a This is a schematic diagram of an intra-block copy prediction process provided in an embodiment of this application, such as... Figure 4a As shown, in IBC, the displacement between the current block and its reference block (i.e., the displacement between the top-left corner coordinates of the current block and the top-left corner coordinates of the reference block) is called the Block Vector (BV). The reference block refers to the coded block that has already been encoded; therefore, the reference block is located in the encoded region. H.266 / VVC employs a BV prediction technique similar to inter-frame prediction to further save the bits required for encoding the BV.

[0153] 2) Legality judgment of intra-block copy prediction

[0154] In the AVS3 standard, the reference block pointed to by the block vector decoded from an AVS3-compliant video stream should be limited to the current maximum coding unit or the range of N (N is a positive integer) maximum coding units to the left. All reference samples of the reference block should belong to the same slice as the samples of the current block and should have been completely reconstructed. The value of N is as follows:

[0155]

[0156] Let the coordinates of the top-left corner of the current block be (xCur, yCur), the coordinates of the top-left corner of the reference block's luma component be (xRefTL, yRefTL), and the coordinates of the bottom-right corner of the reference block's luma component be (xRefBR, yRefBR). The coordinates (xRefTL, yRefTL) and (xRefBR, yRefBR) should satisfy the following conditions:

[0157]

[0158] When the top-left corner of the reference block pointed to by the block vector is adjacent to the largest coding unit on the left, and the size of the largest coding unit is 128×128, the top-left corner of the 64×64 region where the top-left corner of the reference block is located after shifting 128 pixels to the right should not have been reconstructed, and the coordinates (xCur, yCur) should satisfy the following conditions:

[0159]

[0160] (3) Intra-string copy prediction

[0161] 1) Intra String Copy (ISC) technology divides a coded block into a series of pixel strings or unmatched pixels according to a certain scanning order (raster scan, round-trip scan, and Zig-Zag scan, etc.). In AVS3, ISC prediction modes specifically include: Intra String Copy Prediction (ISC) normal string sub-mode and Intra String Copy Prediction (ISC) non-normal string sub-mode. Similar to IBC, each string searches for a reference string of the same shape in the currently encoded region of the image, thereby deriving the predicted value of the current string based on the reference string. Instead of directly encoding the string pixel values, the string vector difference (SVD) between the current string pixel values ​​and the predicted values ​​is encoded, effectively saving bits. See also... Figure 4b , Figure 4b This is a schematic diagram of an intra-frame copy prediction process provided in an embodiment of this application, such as... Figure 4b As shown, the string containing 14 pixels is the current string to be encoded, string 1. Within the encoded area, a reference string 1 with the same shape (i.e., also containing 14 pixels) can be identified. Therefore, the displacement between the current string to be encoded, string 1, and reference string 1 can be called string vector 1. Similarly, the string containing 15 pixels is the current string to be encoded, string 2. Within the encoded area, a reference string 2 with the same shape (i.e., also containing 15 pixels) can be identified. Therefore, the displacement between the current string to be encoded, string 2, and reference string 2 can be called string vector 2. Additionally, a single black pixel represents an unmatched pixel.

[0162] Intra-frame string copy prediction requires encoding the string vector (SV), string length, and matching string flag for each string in the current block. The string vector (SV) represents the displacement between the current string and its reference string; the string length represents the number of pixels contained in the current string; and the matching string flag indicates whether a matching encoded string exists in the current string. If the value of the matching string flag is 1, a matching encoded string exists in the current string; if the value of the matching string flag is 0, a matching encoded string does not exist in the current string.

[0163] 2) Reference range limitation for intra-frame string copy prediction

[0164] In the AVS3 standard, any reference pixel in the reference string pointed to by the string vector or the constant position pointed to by the point vector obtained from the decoded AVS3 compliant video bitstream should be limited to the range of the current maximum coding unit or the N maximum coding units to the left. The value of N is as follows:

[0165]

[0166] IscSubtypeFlag indicates the type of the current string; a value of 0 indicates a normal string, and a value of 1 indicates a non-normal string. If the value of IscSubtypeFlag is equal to 0, it means that the current string is a normal string. Let the coordinates of the top-left corner of the current block be (xCur, yCur), and the coordinates of any luminance components A and B in the reference string be (xRefA, yRefA) and (xRefB, yRefB), respectively. The coordinates (xRefA, yRefA) and (xRefB, yRefB) should satisfy the following conditions:

[0167]

[0168] If the value of IscSubtypeFlag is equal to 0, and when any luminance component A of the reference string falls on the left adjacent largest coding unit, and the size of the largest coding unit is 128×128, the top left corner of the 64×64 region where the position of luminance component A after shifting 128 pixels to the right should not have been reconstructed, and the coordinates (xCur, yCur) should satisfy the following conditions:

[0169]

[0170] If the value of IscSubtypeFlag is equal to 0, all reference samples in the reference string of the current string should be in the same slice as the samples in the current string and have been fully reconstructed. If the value of the Y component of the string vector is greater than or equal to 0, then any reference pixel in the reference string pointed to by the string vector should not be located in the current string.

[0171] If the value of IscSubtypeFlag is equal to 1, let the coordinates of the top-left corner of the current block be (xCur, yCur), and the coordinates of the luminance component A at the constant position be (xRef, yRef). The coordinates (xCur, yCur) and (xRef, yRef) should satisfy the following conditions:

[0172]

[0173] Let numOfP = IscNumOfNewPv + IscNumofReusedPv. If the value of IscSubtypeFlag = 1:

[0174] i. If the product of the width and height of the current coding unit is greater than 64, then the value of numOfP should not be greater than 15;

[0175] ii. If the product of the width and height of the current coding unit is greater than 32 (i.e., 8×8, 4×16 or 16×4), then numOfP≤10;

[0176] iii. If the product of the width and height of the current coding unit is greater than 16 (i.e., 8×4 or 4×8), then numOfP≤5;

[0177] iv. If the product of the width and height of the current coding unit is 4×4, then numOfP≤2.

[0178] The point vectors used by the current coding unit are all stored in the point prediction information table PpInfoList

[15] [2]. The point vectors in PpInfoList

[15] [2] consist of two parts: one part comes from the historical point prediction information table PrevPpInfoList

[28] [2], and the number of point vectors in the historical point prediction information table is ≤28; the other part is the point vectors that appear in the current coding unit.

[0179] If the current coding unit uses the normal string sub-pattern, the sum of the number of matching strings, the number of incomplete matching strings containing at least one matching sample, the number of unmatched samples, and IscPartNumSplit should be less than or equal to one-quarter of the number of samples in the current coding unit; otherwise, if the current coding unit uses the non-normal string sub-pattern, the sum of the number of equivalent strings, the number of unit basis vector strings, the number of unmatched samples, and IscPartNumSplit should be less than or equal to one-quarter of the number of samples in the current coding unit.

[0180] It should be noted that the reference range constraints for intra-block copy prediction mode and intra-string copy prediction mode may have different constraint methods in different standards. In this application, a valid displacement vector means that the displacement vector should meet the reference range constraints, and the specific constraint method is not limited to the reference range constraints of AVS3.

[0181] 3) Intra-frame string copy prediction non-ordinary string sub-mode

[0182] Intra-frame string copy prediction of non-ordinary string sub-patterns, also known as equivalent string and unit vector string patterns, was adopted into the AVS3 standard in October 2020. Please see [link to AVS3 standard]. Figure 4c , Figure 4c This is a schematic diagram of an intra-frame string copy prediction non-ordinary string sub-pattern provided in an embodiment of this application, such as... Figure 4c As shown, similar to the intra-string copy prediction mode, this mode divides an encoded / decoded block into a series of pixel strings or unmatched pixels according to a certain scanning order. The pixel strings can be of the type of equal-value strings or unit basis vector strings. The characteristic of equal-value strings is that all pixels in the string have the same predicted value. Unit basis vector strings (also known as unit offset strings, copy-above strings, etc.) are characterized by their displacement vector being (0, -1), and their implementation is relatively simple. Each pixel in this string uses the pixel above it as the predicted value for the current pixel. The equal-value string mode requires encoding the type, length, and predicted value information of each string in the current encoded block in the bitstream. Correspondingly, the decoder derives the prediction samples from the information decoded from the bitstream.

[0183] (4) Normal intra-frame prediction mode

[0184] In AVS3, intra-frame prediction modes can include: intra-block copy prediction, intra-string copy prediction, and normal intra-frame prediction mode. Normal intra-frame prediction mode can be further divided into: normal luma intra-frame prediction mode, normal chroma intra-frame prediction mode, and spatial angle-weighted prediction luma intra-frame prediction mode. In this application, the chroma block copy intra-frame prediction mode can also be considered a sub-mode of the normal chroma intra-frame prediction mode.

[0185] 1) Normal Luminance Intra-Frame Prediction Mode:

[0186] Please see Figure 4d , Figure 4d This is a schematic diagram of a common intra-frame prediction mode for luminance provided in an embodiment of this application. For example... Figure 4dAs shown, the normal luminance intra-prediction mode with an IntraLumaPredMode value of 0 is DC mode; the normal luminance intra-prediction mode with an IntraLumaPredMode value of 1 is Planer mode; and the normal luminance intra-prediction mode with an IntraLumaPredMode value of 2 is Bilinear mode. Similarly, according to different IntraLumaPredMode values, the normal luminance intra-prediction modes can be divided into various modes as shown in Table 1 below.

[0187] Table 1. Normal Luminance Intra-Frame Prediction Mode

[0188] IntraLumaPredMode Intra-prediction mode 0 Intra_Luma_DC 1 Intra_Luma_Plane 2 Intra_Luma_Bilinear 3~11 Intra_Luma_Angular 12 Intra_Luma_Vertical 13~23 Intra_Luma_Angular 24 Intra_Luma_Horizontal 25~32 Intra_Luma_Angular 33 Intra_Luma_PCM 34~65 Intra_Luma_Angular

[0189] In Table 1 above, Intra_Luma_Horizontal, Intra_Luma_Vertical, and Intra_Luma_Angular are angular prediction modes, while the others are non-angular prediction modes.

[0190] 2) Normal chroma intra-frame prediction mode:

[0191] Table 2. Intra-frame prediction modes for chroma prediction blocks

[0192]

[0193]

[0194] In Table 2 above, TSCPM, PMC, and EPMC are cross-component prediction modes, while DM mode is an inherited mode.

[0195] (5) Template matching

[0196] To further improve the compression efficiency of the VVC standard, template matching (TM) is proposed to refine motion on the decoding side. In TM mode, motion is refined by constructing a template from the adjacent reconstructed samples on the left and top and finding the closest match between the template in the current image and the reference frame.

[0197] Please see Figure 4e , Figure 4e This is a schematic diagram of a template matching process provided in an embodiment of this application. For example... Figure 4eAs shown, a better MV is searched around the initial motion of the current CU within a search range of [-8, +8] pixels. Template matching was previously proposed in JVET-J0021. In ECM, template matching also employs some modifications: the search step size is determined by the AMVR mode, and the TM can be cascaded with the bilateral matching process. Furthermore, template matching is also used to determine the displacement vector, displacement vector offset, reordering the merge index of the merge candidate list and the AMVP candidate list, the reference row of the intra-prediction mode, and so on.

[0198] (6) Intra-frame prediction motion vector prediction in AVS3

[0199] Intra-Block Copy (IBC) and Intra-String Copy (ISC) are two screen content coding tools in AVS3. Both use the current image as a reference and derive the predicted values ​​of coding units through motion compensation. Considering that IBC and ISC have similar reference areas, the block vector (BV) and string vector (SV) have high correlation, and coding efficiency can be further improved by allowing predictions between the two. AVS3 uses an IntraHMVP-like table to record the displacement vector information, size information, and repetition count of these two types of coding blocks, and derives the predicted block vector (BVP) and predicted string vector (SVP) from IntraHMVP. To support parallel coding, if the current largest coding unit is the first largest coding unit in the current row of the current slice, the value of CntIntraHmvp in the IntraHMVP table is initialized to 0.

[0200] 1) For IBC encoded blocks, AVS3 uses a method called Class-based Block Vector Prediction (CBVP) to derive BVPs. This method first classifies candidate BVs in IntraHMVP according to the following conditions:

[0201] Category 0: The area of ​​a historical coded block is greater than or equal to 64 pixels;

[0202] Category 1: BV frequency is greater than or equal to 2;

[0203] Category 2: The coordinates of the top-left corner of the historical encoded block are located to the left of the top-left corner coordinates of the current block;

[0204] Category 3: The coordinates of the top-left corner of the historical coded block are located above the coordinates of the top-left corner of the current block;

[0205] Category 4: The coordinates of the top-left corner of the historical encoded block are located to the upper left of the top-left corner of the current block;

[0206] Category 5: The coordinates of the top-left corner of the historical coded block are located to the upper right of the top-left corner coordinates of the current block;

[0207] Category 6: The coordinates of the top left corner of the historical encoding block are located to the lower left of the coordinates of the top left corner of the current block.

[0208] Additionally, a displacement vector index (or simply index) can be encoded in the video bitstream. This index represents the index of the category corresponding to the best candidate BV in the CBVP list. For example, if the index is "6", it means that the category corresponding to the best candidate BV in the CBVP list is category 6. Subsequently, the decoding end can decode the corresponding BVP from the CBVP list based on this index.

[0209] 2) For ISC coded blocks, similarly, each string needs to be encoded with an index that indicates the position of the corresponding string's SVP in the IntraHMVP. Similar to the skip mode in inter-frame prediction, the current string's SV equals its SVP, so there is no need to encode the string vector residual value SVD between SV and SVP.

[0210] (7) Color format of video images

[0211] YUV is a color encoding format primarily used to optimize the transmission of color video signals. Compared to RGB video signal transmission, its biggest advantage is that it requires very little bandwidth (RGB requires three independent video signals to be transmitted simultaneously). "Y" represents luminance or lightness (Luminance or Luma), which is the grayscale value; while "U" and "V" represent chrominance (Chrominance or Chroma), which describe the color and saturation of the image and are used to specify the color of a pixel. Luminance is established using the RGB input signals by superimposing specific parts of the RGB signals; chrominance defines two aspects of color: hue and saturation, represented by Cr and Cb respectively. Cr reflects the difference between the red portion of the RGB input signal and the luminance value of the RGB signal, while Cb reflects the difference between the blue portion of the RGB input signal and the luminance value of the RGB signal. The importance of the YUV color format lies in the separation of its luminance signal Y and chrominance signals U and V. If an image only includes the Y component (luminance component) and not the U and V components (chrominance components), then the image is a black and white grayscale image. In daily life, color televisions use the YUV format to describe images in order to solve the compatibility problem between color televisions and black-and-white televisions based on the luminance component Y, ensuring that black-and-white televisions can also receive color television signals.

[0212] The storage format of YUV video streams is closely related to their sampling method; please refer to [link / reference]. Figure 4f , Figure 4f This is a schematic diagram of a video sampling method provided in an embodiment of this application, as shown below. Figure 4fAs shown, the mainstream YUV sampling formats mainly include the following three: YUV4:4:4, YUV4:2:2, and YUV4:2:0. The symbol "A:B:C" is used to describe the sampling frequencies of U and V relative to Y.

[0213] YUV4:4:4 sampling means that the chroma channel is not downsampled, that is, in this sampling method, each Y component corresponds to a set of UV components.

[0214] YUV4:2:2 sampling means that horizontal downsampling is performed according to the 2:1 format, and there is no vertical downsampling. For each scan line, every two U or V samples contain four Y samples; that is, in this sampling method, every two Y components share a set of UV components.

[0215] YUV4:2:2 sampling means that horizontal downsampling is performed in a 2:1 format and vertical downsampling is performed in a 2:1 format. That is, in this sampling method, every four Y components share a set of UV components.

[0216] (8) Block partitioning structure in AVS3

[0217] 1) Basic block partitioning structure

[0218] AVS3 adopts a basic block partitioning structure based on QT, BT, and EQT. The previous generation AVS2 standard used a quadtree (QT) partitioning structure, dividing one CU into four sub-CUs. In addition to quadtree partitioning, AVS3 also supports binary tree (BT) and EQT partitioning. BT can divide a CU into two sub-CUs (left / right or top / bottom); EQT includes both horizontal and vertical I-shaped partitioning methods, dividing one CU into four sub-CUs.

[0219] The representation of the basic block partitioning structures of QT, BT, and EQT in AVS3 within the video bitstream can be found in [link to relevant documentation]. Figure 4g As shown, Figure 4g This is a schematic diagram of a basic block partitioning structure provided in an embodiment of this application. For example... Figure 4g As shown, for any coding unit (CU), the process first determines whether a QT partition is needed. If so, a quadtree partition is performed directly to obtain a QT. If not, a further determination is needed to determine whether to not partition (Non-Split). If no partition is needed, the determination ends. If partitioning is needed, a further determination is needed to determine whether to perform an EQT partition or a BT partition. If an EQT partition is needed, a determination is needed to determine whether to perform a horizontal partition (Hor) or a vertical partition (Ver). Similarly, if a BT partition is needed, a determination is needed to determine whether to perform a horizontal partition (Hor) or a vertical partition (Ver). Finally, according to the above partitioning method, the current coding unit can be divided into a basic block structure of QT, BT, or EQT.

[0220] 2) Colorimetric tree partitioning restrictions

[0221] In AVS3, the luma and chroma components of a video bitstream are typically encoded using the same block partitioning structure. That is, the luma component of an encoding unit is divided into multiple luma blocks, and the chroma component is divided into multiple chroma blocks. To reduce complexity, AVS3 limits the minimum length or width of luma and chroma blocks to at least 4 pixels. For YUV420 format encoding units, 4 pixels of the chroma component correspond to 8 pixels of the luma component. When partitioning blocks, if the resulting block size is smaller than the minimum value, the partitioning will not be performed. Because chroma blocks have a smaller size in YUV420 format, it is possible for chroma block partitioning to stop while luma block partitioning continues. In this case, one chroma block may correspond to multiple luma blocks. This inconsistency between the luma and chroma block partitioning structures is called a Local Separate Tree (LST). AVS3 allows luma and chroma to be encoded separately. Specifically, for a chroma block, the encoding mode is selected based on the information of the luma sample corresponding to its lower right chroma sample position. If the luma co-location block uses inter-frame prediction mode, the chroma block will use the reference frame and displacement vector information of the luma co-location block to perform inter-frame motion compensation and derive the predicted value; otherwise, the chroma block will derive the predicted value from the available intra-frame prediction modes, where the chroma block is allowed to select an intra-frame prediction mode different from that of the luma block.

[0222] (9) Interpolation of intra-frame prediction for chroma block copying

[0223] 1) Colorimetric samples

[0224] Please see Figure 4h , Figure 4h This is a schematic diagram illustrating the position of intra-frame prediction for chroma block replication provided in an embodiment of this application. The sample point positions in the chroma sample point matrix of the reference image are as follows: Figure 4h As shown, where A, B, C, and D are adjacent integer pixel samples, dx and dy are the horizontal and vertical distances between the surrounding sub-pixel samples a(dx,dy) and A, dx equals fx & 1, and dy equals fy & 1, where (fx,fy) are the coordinates of the sub-pixel sample in the chroma sample matrix with 1 / 2 precision. Further, Figure 4i This is a schematic diagram of the position of a sub-pixel sample point provided in an embodiment of this application. For details of the specific positions of the integer pixel Ax,y and the three surrounding sub-pixel sample points ax,y (dx,dy), please refer to [link to relevant documentation]. Figure 4i .

[0225] 2) Chromaticity filtering coefficients

[0226] Table 3. Chromaticity Filtering Coefficients

[0227] Array identifier Filter coefficients C[0] {64,0} C[1] {32,32}

[0228] For pixels where dx = 0 or dy = 0, interpolation can be performed directly based on integer chroma pixels; for pixels where both dx and dy are not equal to 0, calculations are performed using pixels in the integer pixel row (dy == 0).

[0229]

[0230] Where a'x,y(dx,0) is a temporary value for a sub-pixel on an integer pixel row, defined as:

[0231]

[0232] II. Video Decoding

[0233] On the decoding side, for each CU, after obtaining the video bitstream, firstly, entropy decoding is performed on the video bitstream to obtain information on various predictive coding modes and quantized transform coefficients. Then, each transform coefficient undergoes inverse quantization and inverse transform to obtain the residual video signal (also called the residual value). Secondly, based on the known predictive coding mode information, the prediction signal (also called the prediction value) corresponding to the CU can be obtained. The residual video signal and the prediction signal are added together to obtain the reconstructed video signal, which can be used to reconstruct the decoded image corresponding to the CU. Finally, the reconstructed video signal needs to undergo loop filtering to generate the final output signal.

[0234] Based on the above description, this application provides a video processing solution applicable to video encoders or video compression products that use motion compensation techniques (such as inter-frame prediction, intra-frame block copying, and intra-frame string copying modes), which helps improve video compression performance. Specifically, the general principle of this video processing solution is as follows:

[0235] At the encoding end: First, the current chroma block in the video is determined, and the current chroma block adopts the chroma block copy intra-prediction mode. Then, the target displacement vector of the luma co-position block corresponding to the current chroma block is obtained. Next, based on the target displacement vector, the predicted value of the current chroma block is determined. Finally, the video is encoded based on the predicted value of the current chroma block to generate a video stream, which is then sent to the decoding end.

[0236] At the decoding end: After receiving the video stream from the encoding end, the current chroma block in the video stream can be determined, and the current chroma block adopts the chroma block copy intra-prediction mode; then, the target displacement vector of the luma co-position block corresponding to the current chroma block can be obtained; next, based on the target displacement vector, the predicted value of the current chroma block is determined. Finally, the decoded image corresponding to the current chroma block can be reconstructed using the predicted value of the current chroma block.

[0237] As can be seen above, in the video encoding and decoding process, this application proposes a new prediction mode for the current chroma block. That is, when it is determined that the current chroma block adopts the chroma block copy intra-prediction mode, the prediction value of the current chroma block can be determined by using the displacement vector information of the luma co-position block. There is no need to perform intra-prediction processing on the current chroma block, which can improve the encoding and decoding efficiency of the current chroma block and thus effectively improve the coding performance.

[0238] The video processing system provided in the embodiments of this application will be described in detail below.

[0239] Please see Figure 5 , Figure 5 This is a schematic diagram of the architecture of a video processing system provided in an embodiment of this application. The video processing system 50 may include an encoding device 501 and a decoding device 502. The encoding device 501 is located at the encoding end, and the decoding device is located at the decoding end. The encoding device 501 can be a terminal or a server; the decoding device 502 can also be a terminal or a server. The encoding device 501 and the decoding device 502 can establish a communication connection via wired or wireless means. The terminal may be a mobile phone, tablet computer, laptop computer, PDA, mobile internet device (MID), in-vehicle device, aircraft, wearable device (such as smartwatches, smart bracelets, pedometers, etc.), virtual reality device (such as VR (Virtual Reality) devices, AR (Augmented Reality) devices), etc. A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0240] (1) For encoding device 501:

[0241] Encoding device 501 can acquire video to be encoded, which can be obtained by shooting with a camera or generating it with a computer. The camera can be a hardware component installed in encoding device 501; for example, it can be a regular camera, a stereo camera, or a light field camera installed in a terminal. The camera can also refer to a hardware device connected to encoding device 501, such as a camera connected to a server.

[0242] A video consists of one or more video frames. The encoding device 501 can divide each video into one or more control units (CUs) and encode each CU. When encoding any CU, firstly, the current chroma block being encoded can be determined, and the current chroma block adopts the chroma block copy intra-prediction mode; then, the target displacement vector of the luma co-position block corresponding to the current chroma block is obtained; next, based on the target displacement vector, the prediction value of the current chroma block is determined; the prediction value of the current chroma block can be understood as the prediction signal corresponding to the current chroma block, and the prediction value of the current chroma block can be used to reconstruct the decoded image corresponding to the current chroma block; finally, the video is encoded based on the prediction value of the current chroma block to generate a video stream.

[0243] Then, the encoding device 501 performs transform coding, quantization, entropy coding and other operations on the video based on the predicted value of the chroma block of the current CU to obtain the video bitstream, and sends the video bitstream to the decoding device 502 so that the decoding device 502 can perform decoding processing on the video bitstream.

[0244] (2) For decoding device 502:

[0245] After receiving the video stream sent by the encoding device 501, the decoding device 502 can decode the video stream and reconstruct the video corresponding to the video stream. Specifically: when decoding any CU, the decoding device 502 first determines the current chroma block of the CU being decoded (hereinafter referred to as the current coding unit), and the current chroma block adopts the chroma block copy intra-prediction mode; then, it obtains the target displacement vector of the luma co-position block corresponding to the current chroma block; next, based on the target displacement vector, it determines the prediction value of the current chroma block; the prediction value of the current chroma block can be understood as the prediction signal corresponding to the current chroma block, and the prediction value of the current chroma block can be used to reconstruct the decoded image corresponding to the current chroma block; finally, it encodes the video based on the prediction value of the current chroma block to generate a video stream.

[0246] Whether the current chroma block adopts intra-frame copy prediction mode is indicated by mode indication information obtained after decoding the video bitstream. This mode indication information includes at least one of the following: sequence header flag, image header flag, title sequence flag, coding unit flag, implicit information, and context model indication information.

[0247] 1) If the mode indication information is a sequence header flag, the mode indication information is set in the sequence header of the current sequence to which the current chroma block belongs; when the sequence header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the sequence header flag is a second preset value, it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode. 2) If the mode indication information is an image header flag, the mode indication information is set in the image header of the current image to which the current chroma block belongs; when the image header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the image header flag is a second preset value, it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode. 3) If the mode indication information is a slice header flag, the mode indication information is set in the slice header of the current slice to which the current chroma block belongs; when the slice header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the slice header flag is a second preset value, it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode. 4) If the mode indication information is a coding unit flag, the mode indication information is set in the current coding unit; when the coding unit flag is the first preset value, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode, and when the coding unit flag is the second preset value, it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode; 5) If the mode indication information is implicit information, when the implicit information indicates that the luminance sample at the preset position in the luminance co-location block corresponding to the current chroma block meets the preset condition, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode; 6) If the mode indication information is a context model indication information, when the context model indication information; 7) If the mode indication information is chroma indication information, when the chroma indication information indicates that the current chroma block adopts the preset intra-prediction mode (e.g., DM mode), and the luminance sample at the preset position in the luminance co-location block meets the preset condition, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode. As can be seen, the embodiments of this application can obtain mode indication information for the prediction mode used to indicate the current chroma block mode by decoding the video bitstream, and when the current chroma block adopts the intra-prediction mode of chroma block copying, the prediction value of the current chroma block can be determined by using the target displacement vector of the luminance co-position block corresponding to the current chroma block.

[0248] Furthermore, if it is determined that the current chroma block requires residual decoding, the decoding device 502 performs inverse quantization and inverse transform on the quantized transform coefficients to obtain the residual value of the current chroma block. The predicted value and the residual value of the current chroma block are then superimposed to obtain the reconstructed value of the current chroma block. Finally, the decoded image corresponding to the current chroma block is reconstructed based on this reconstructed value. The decoded image can be used as a reference image for decoding by other CUs and can also be used to reconstruct the video.

[0249] In the video encoding and decoding process, this application proposes a new prediction mode for the current chroma block. When it is determined that the current chroma block adopts the intra-frame prediction mode of chroma block copying, the prediction value of the current chroma block can be determined by using the displacement vector information of the luma co-position block. There is no need to perform intra-frame prediction processing on the current chroma block, which can improve the encoding and decoding efficiency of the current chroma block and thus effectively improve the coding performance.

[0250] The video processing method provided in the embodiments of this application will be described below. Please refer to... Figure 6 , Figure 6 This is a flowchart illustrating a video processing method provided in an embodiment of this application. The video processing method can be executed by a decoding device in the aforementioned video processing system. The video processing method described in this embodiment may include the following steps S601-S603:

[0251] S601: Determine the current chroma block in the video stream. The current chroma block adopts the chroma block copy intra-prediction mode.

[0252] In this application, the current chroma block refers to the chroma block currently being decoded, and the chroma block refers to a coding block that contains only chroma components. That is, the chroma block refers to the block of chroma components in the coding unit, and the luma block refers to the block of luma components in the coding unit; wherein, the block here may include, but is not limited to: coding unit, prediction unit, transform unit, prediction block, and transform block.

[0253] In one possible implementation, the video stream is decoded to obtain mode indication information, which indicates whether the current chroma block uses intra-frame copy prediction mode. The mode indication information includes at least one of the following: sequence header flag, image header flag, title sequence flag, coding unit flag, implicit information, and chroma indication information. The chroma block copy intra-frame prediction mode is a prediction mode independent of the ordinary intra-frame prediction mode; or, the chroma block copy intra-frame prediction mode is a sub-mode of the ordinary intra-frame prediction mode. The ordinary intra-frame prediction mode includes at least one of the following: intra-frame prediction DC coefficient mode, angle-based intra-frame prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-frame reference pixel derived prediction values.

[0254] 1) If the mode indication information is the sequence header flag seq_cibc_flag, then the mode indication information is set in the sequence header of the current sequence to which the current chroma block belongs. When the sequence header flag seq_cibc_flag is a first preset value (e.g., 1), it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode. When the sequence header flag seq_cibc_flag is a second preset value (e.g., 0), it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode. In this case, the chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode.

[0255] Optionally, the use of intra-prediction mode for the current chroma block copy can be determined based on other sequence headers, including the following implementations:

[0256] a. The video stream contains a sequence header flag seq_ibc_flag that indicates whether IBC is used. seq_ibc_flag is only decoded when seq_ibc_flag is 1.

[0257] b. The video stream contains a sequence header flag seq_isc_flag that indicates whether ISC is used. seq_cibc_flag is only decoded when seq_isc_flag is 1.

[0258] c. The video stream contains a sequence header flag seq_isc_ordinary_flag that indicates whether the ISC normal string sub-mode is used. seq_cibc_flag is only decoded when seq_isc_ordinary_flag is 1.

[0259] d. The video stream contains a sequence header flag seq_isc_non_ordinary_flag that indicates whether the ISC non-ordinary sub-mode is used. seq_cibc_flag is only decoded when seq_isc_non_ordinary_flag is 1.

[0260] The above methods are combined, for example, if there are seq_ibc_flag and seq_isc_flag in the video bitstream, seq_cibc_flag is only decoded when at least one of them has a value of 1.

[0261] f. The above method (ad) can be implicit, meaning it doesn't require decoding `seq_cibc_flag` from the video stream. The `seq_cibc_flag` is directly determined based on the values ​​of the above flags (`seq_ibc_flag`, `seq_isc_flag`, `seq_isc_ordinary_flag`, `seq_isc_non_ordinary_flag`). For example, if `seq_ibc_flag` and `seq_isc_flag` exist in the video stream, and at least one of them has a value of 1, then `seq_cibc_flag` is set to 1; or if `seq_ibc_flag` exists in the video stream and its value is 1, then `seq_cibc_flag` is set to 1; or if `seq_isc_flag` exists in the stream and its value is 1, then `seq_cibc_flag` is set to 1.

[0262] 2) If the mode indication information is the image header flag pic_cibc_flag, then the mode indication information is set in the image header of the current image to which the current chroma block belongs. When the image header flag pic_cibc_flag is a first preset value (e.g., 1), it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode. When the image header flag pic_cibc_flag is a second preset value (e.g., 0), it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode. In this case, the chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode.

[0263] Optionally, the use of intra-prediction mode for the current chroma block copy can be determined based on other sequence headers, including the following implementations:

[0264] a. The video stream contains a pic_ibc_flag indicating whether IBC is used. pic_ibc_flag is only decoded when pic_ibc_flag is 1.

[0265] b. The video stream contains a picture header flag pic_isc_flag that indicates whether ISC is used. pic_cibc_flag is only decoded when pic_isc_flag is 1.

[0266] c. The video stream contains a picture header flag pic_isc_ordinary_flag that indicates whether the ISC normal string sub-mode is used. pic_cibc_flag is only decoded when pic_isc_ordinary_flag is 1.

[0267] d. The video stream contains a picture header flag pic_isc_non_ordinary_flag that indicates whether ISC non-ordinary sub-mode is used. pic_cibc_flag is only decoded when pic_isc_non_ordinary_flag is 1.

[0268] For combinations of methods above e and ad, such as the presence of pic_ibc_flag and pic_isc_flag in the video stream, pic_ibc_flag is only decoded when at least one of them has a value of 1.

[0269] f. The above method (ad) can be implicit, meaning it doesn't require decoding `pic_cibc_flag` from the video stream. The `pic_cibc_flag` is directly determined based on the values ​​of the above flags (`pic_ibc_flag`, `pic_isc_flag`, `pic_isc_ordinary_flag`, `pic_isc_non_ordinary_flag`). For example, if `pic_ibc_flag` and `pic_isc_flag` exist in the video stream, and at least one of them has a value of 1, then `pic_cibc_flag` is set to 1; or if `pic_ibc_flag` exists in the video stream and its value is 1, then `pic_cibc_flag` is set to 1; or if `pic_isc_flag` exists in the stream and its value is 1, then `pic_cibc_flag` is set to 1.

[0270] 3) If the mode indication information is the patch_cibc_flag header flag, then the mode indication information is set in the header of the current slice to which the current chroma block belongs. When the patch_cibc_flag header flag is a first preset value (e.g., 1), it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode. When the patch_cibc_flag header flag is a second preset value (e.g., 0), it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode. In this case, the chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode.

[0271] Optionally, the use of intra-prediction mode for the current chroma block copy can be determined based on other sequence headers, including the following implementations:

[0272] a. The video stream contains a header flag, patch_ibc_flag, that indicates whether IBC is used. Patch_ibc_flag is only decoded when patch_ibc_flag is 1.

[0273] b. The video stream contains a header flag patch_isc_flag that indicates whether ISC is used. Only when patch_isc_flag is 1 will patch_cibc_flag be decoded.

[0274] c. The video stream contains a header flag, patch_isc_ordinary_flag, that indicates whether the ISC normal string sub-mode is used. Only when patch_isc_ordinary_flag is 1 will patch_cibc_flag be decoded.

[0275] d. The video stream contains a header flag, patch_isc_non_ordinary_flag, indicating whether ISC (Imperial Serial) mode is used. Patch_cibc_flag is only decoded when patch_isc_non_ordinary_flag is 1.

[0276] The above combinations of methods are used, such as when patch_ibc_flag and patch_isc_flag exist in the video stream. Only when at least one of them has a value of 1 will patch_ibc_flag be decoded.

[0277] f. The above method (ad) can be implicit, meaning it doesn't require decoding `patch_cibc_flag` from the video stream. The `patch_cibc_flag` is directly determined based on the values ​​of the above flags (`patch_ibc_flag`, `patch_isc_flag`, `patch_isc_ordinary_flag`, `patch_isc_non_ordinary_flag`). For example, if `patch_ibc_flag` and `patch_isc_flag` exist in the video stream, and at least one of them has a value of 1, then `patch_cibc_flag` is set to 1; or if `patch_ibc_flag` exists in the video stream and its value is 1, then `patch_cibc_flag` is set to 1; or if `patch_isc_flag` exists in the stream and its value is 1, then `patch_cibc_flag` is set to 1.

[0278] 4) If the mode indication information is the coding unit flag cu_cibc_flag, then the mode indication information is set in the current coding unit; when the coding unit flag cu_cibc_flag is the first preset value (e.g., 1), it indicates that the current chroma block adopts the chroma block copy intra-prediction mode; when the coding unit flag cu_cibc_flag is the second preset value (e.g., 0), it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode.

[0279] 5) If the mode indication information is implicit, then when the implicit information indicates that the luminance sample point at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset condition, the current chroma block is instructed to adopt the chroma block copy intra-prediction mode.

[0280] 6) If the mode indication information is chroma indication information, then when the chroma indication information indicates that the current chroma block adopts the preset intra-prediction mode, for example, the preset intra-prediction mode is DM mode (derived mode, a mode specific to chroma prediction), and the luminance sample point at the preset position in the luminance co-position block meets the preset condition, the current chroma block is indicated to adopt the chroma block copy intra-prediction mode.

[0281] As can be seen from the above, the embodiments of this application can indicate whether the prediction mode adopted by the current chroma block of the current coding unit in the video bitstream is the intra-frame copy prediction mode by decoding the mode indication information set at different positions in the video bitstream (e.g., sequence header, image header, title sequence, coding unit). It should be understood that the mode indication information 1)-6) used to indicate whether the current chroma block adopts the chroma block copy intra-frame prediction mode can be used alone or in combination. For example, the mode indication information may include: the sequence header flag of the current sequence and the coding unit flag of the current coding unit. When the sequence header flag is a first preset value and the coding unit flag is a first preset value, it indicates that the current chroma block adopts the chroma block copy intra-frame prediction mode; or, the mode indication information includes the coding unit flag of the current coding unit. When the coding unit flag is a first preset value, it indicates that the current chroma block adopts the chroma block copy intra-frame prediction mode, etc. This application does not specifically limit this.

[0282] In one possible implementation, during the decoding of the video stream, it is necessary to check whether the video stream meets the decoding conditions. If the video stream meets the decoding conditions, then the step of decoding the video stream and obtaining mode indication information is performed. Specifically, the decoding conditions include: the color format used by the video stream is a format that includes chroma components, and the format that includes chroma components includes any one or more of the following: YUV420 format, YUV422 format, and YUV444 format. When the mode indication information is set in the current coding unit to which the current chroma block belongs, the decoding conditions include any one or more of the following:

[0283] i. The current coding unit contains only chroma components; where the chroma components can be determined by the component types of the current coding tree, the component types of the current coding tree include at least three types: luma components, chroma components, and luma-chroma components, where coding tree refers to the partitioning structure of coding units.

[0284] ii. The luminance samples at preset positions in the luminance co-position block corresponding to the current chroma block meet the preset conditions; wherein, if there are multiple preset positions (e.g., 10), the number of luminance samples that meet the preset conditions includes: at least one, or greater than or equal to a preset threshold (T=6).

[0285] 1) The method for determining the preset location includes any one or more of the following:

[0286] a. In one example, you can first determine the preset chroma sample point in the current chroma block, and then determine the preset position of the corresponding luminance sample point in the luminance co-location block based on the position of the preset chroma sample point. The so-called chroma sample point refers to the sample point (i.e., pixel point) in the current chroma block. For example, the preset positions of chromaticity samples include any one or more of the following: center point position (xC+wC / 2, yC+hC / 2), (xC+wC / 2-1, yC+hC / 2-1), (xC+wC / 2-1, yC+hC / 2), (xC+wC / 2, yC+hC / 2-1), upper left corner position (xC+wC-1, yC), upper right corner position (xC+wC, yC), lower left corner position (xC, yC+hC-1), and lower right corner position (xC+wC-1, yC+hC-1); then, the position of the corresponding luminance sample in the luminance co-position block can be calculated according to the following formula (2).

[0287] (xL, yL) = (xC * scaleX, yC * scaleY) Formula (2)

[0288] In formula (2), (xC, yC) refers to the coordinates of the upper left corner of the current chroma block, and (xL, yL) refers to the coordinates of the upper left corner of the corresponding luminance block. scaleX refers to the horizontal sampling ratio between the luminance and chroma components in the currently used YUV color format, and scaleY refers to the vertical sampling ratio between the luminance and chroma components in the currently used YUV color format. For example, if the currently used YUV color format is YUV420, then scaleX = 2 (2:1), scaleY = 2 (2:1); if the currently used YUV color format is YUV422, then scaleX = 2 (2:1), scaleY = 1; and if the currently used YUV color format is YUV444, then scaleX = 1, scaleY = 1.

[0289] b. In another example, the preset position can be determined directly from the luminance co-location block. For example, it could include the preset positions of the luminance samples corresponding to the following: (xL+wL / 2, yL+hL / 2), (xL+wL / 2-1, yL+hL / 2-1), (xL+wL / 2-1, yL+hL / 2), (xC+wC / 2, yC+hC / 2-1), the top left (xL, yL), the top right (xL+wL-1, yL), the bottom left ((xL, yL+hL-1), and the bottom right (xL+wL-1, yL+hL-1). It should be noted that in current video coding standards, motion information is stored in fixed-size blocks (e.g., 4x4), and the information of each sample within this size is identical. Therefore, the preset position obtained by this method is actually equivalent to step a above.

[0290] c. In another example, based on the division method of the luminance co-location block, a preset position is determined in each sub-block obtained by dividing the luminance co-location block. For example, the preset position can be the upper left corner of each sub-block; wherein, the information of each sample point within the sub-block is the same.

[0291] d. In another example, the luminance-coordinated block is divided into M×N sub-blocks, and a specified position within each of these M×N sub-blocks is selected as the preset position. The specified position includes any one of the following: the center, top-left corner, top-right corner, bottom-left corner, or bottom-right corner of the sub-block, where M and N are both positive integers. For example, the top-left corner of a 4x4 sub-block is selected as the preset position.

[0292] 2) The methods for determining the preset conditions include any one or more of the following:

[0293] a. The luminance samples adopt any one of the modes in a specific mode set, which includes: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, or any one or more prediction modes with intra-frame displacement vectors.

[0294] b. The luminance sample has a valid displacement vector. A valid displacement vector means that: the luminance co-location block to which the luminance sample belongs should meet the reference range limit of the intra-block copy prediction mode; or, the luminance co-location block to which the luminance sample belongs should meet the reference range limit of the intra-string copy prediction normal string sub-mode, and allow the reference block corresponding to the luminance co-location block to overlap with the luminance co-location block.

[0295] c. The intra-prediction history motion information table (or intra-block copy history motion information table) of the current chroma block is not empty.

[0296] It should be noted that, in the embodiments of this application, the prediction mode adopted by the current chroma block can be represented in other ways besides as chroma block copy intra-prediction mode. For example, it can also be represented as: intra-frame copy mode, intra-frame block copy mode, chroma intra-frame copy mode, chroma string copy mode, or other prediction mode names, etc. This application does not limit the specific name of the prediction mode adopted by the current chroma block. The characteristic of the chroma block copy intra-prediction mode in the embodiments of this application is that it derives the prediction value of the chroma block with the current frame as the reference frame. In the process of deriving the prediction value, it can be done on a chroma block basis or on a chroma sub-block basis.

[0297] S602: Obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block.

[0298] 1. Determine the luminance co-position block corresponding to the current chroma block.

[0299] In one possible implementation, the position and size of the corresponding luminance co-location block can be determined based on the position and size of the current chroma block, as well as the color format of the video image. Assuming the coordinates of the top-left corner of the current chroma block are (xC, yC), its size is (wC, hC), and the horizontal and vertical sampling ratios between the luminance and chroma components corresponding to the color format are (scaleX, scaleY), for example, if the color format is YUV420, then scaleX = 2 and scaleY = 2. Then, the position (xL, yL) and size (wL, hL) of the luminance co-location block corresponding to the current chroma block can be calculated using the following formulas 3-1 and 3-2:

[0300] (xL, yL) = (xC * scaleX, yC * scaleY) (3-1)

[0301] (wL, hL) = (wC * scaleX, hC * scaleY) (3-2)

[0302] Where (xL, yL) refers to the x-coordinate xL and y-coordinate yL of the top-left corner of the luminance block, and (wL, hL) refers to the length wL and height hL of the luminance block; (xC, yC) refers to the x-coordinate xC and y-coordinate yC of the top-left corner of the current chroma block, and (wC, hC) refers to the length wC and height hC of the top-left corner of the current chroma block. Please refer to [link / reference]. Figure 7a , Figure 7a This is a schematic diagram of a process for determining a luminance co-location block provided in an embodiment of this application, such as... Figure 7aAs shown, assuming the coordinates (xC, yC) of the top left corner of the current chroma block are (1, 2), the size (wC, hC) of the current chroma block is (8, 4), and the color format is YUV420, then according to the formulas 3-1 and 3-2 above, the position of the luminance co-position block corresponding to the current chroma block can be determined as (xL, yL) = (1*2, 2*2) = (2, 4), with the size (wL, hL) = (8*2, 4*2) = (16, 8).

[0303] II. Determining the target displacement vector from the brightness co-location block

[0304] In one possible implementation, obtaining the target displacement vector of the luma coordinate block corresponding to the current chroma block includes: first, constructing a candidate displacement vector list for the luma coordinate block corresponding to the current chroma block; then, determining the target displacement vector from the candidate displacement vector list. It should be noted that in practical applications, it is not necessarily necessary to allocate memory for constructing the candidate displacement vector list; it can also be implemented in other ways, such as sequentially checking each candidate displacement vector in the candidate displacement vector list.

[0305] (1) First, the specific process of how to construct a list of candidate displacement vectors is explained in detail.

[0306] 1) Construct a candidate displacement vector list for the luma coordinate block corresponding to the current chroma block, including one or more of the following methods:

[0307] i. Add the displacement vectors of the luminance samples in the luminance co-location block that satisfy the specified mode to the candidate displacement vector list. The specified mode includes any one of the following: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, intra-template matching mode, inter-frame prediction mode, affine motion mode, inter-frame composite mode, Angular Weighted Prediction (AWP) mode, Spatial Angular Weighted Prediction (SAWP) mode, and Geometric Partitioning Mode (GPM) mode.

[0308] ii. Add the displacement vectors of the spatially adjacent blocks corresponding to the luminance co-position blocks to the candidate displacement vector list. Here, the spatially adjacent block refers to the coded block in the current frame of the video that is adjacent to the current coded block (also known as the coding unit), the current frame refers to the video frame to which the current coding unit belongs, and the current coded block refers to the coded block being decoded in the current frame.

[0309] iii. Add the displacement vectors from the historical motion information table or the intra-frame predicted historical motion information table to the candidate displacement vector list.

[0310] iv. Add the candidate displacement vectors from steps i-iii to the candidate displacement vector list after offset processing. The candidate displacement vectors include: displacement vectors of luminance samples satisfying the specified pattern within the luminance co-location block, displacement vectors of spatially adjacent blocks corresponding to the luminance co-location block, and any one or more of the following: displacement vectors. Specifically, assuming a displacement vector (mvX, mvY) exists, the offset displacement vector can be represented as (mvX + offsetX, mvY + offsetY), where the values ​​of offsetX and offsetY can be any integers, for example, offsetX = 1, offsetY = 2.

[0311] v. If no valid displacement vector exists, the list can be filled with default displacement vectors, which include: (-w, 0), (0, -h), (-w, -h), (-2*w, 0), (0, -2*h), where "w" refers to the width of the luminance parity block and "h" refers to the height of the luminance parity block; or, the displacement vectors in the candidate displacement vector list can be set to invalid values, such as (0, 0).

[0312] The displacement vectors in the candidate displacement vector list must satisfy at least one of the following conditions:

[0313] i. The reference block of the lumen co-position block satisfies the reference range limitation of the intra-block copy prediction mode;

[0314] ii. The reference block of the lumen co-position block and the displacement vector both satisfy the reference range limitation of the intra-string copy prediction normal string sub-mode;

[0315] iii. The displacement vector is unique and does not repeat any displacement vector in any other displacement vector list besides the candidate displacement vector list. In other words, the displacement vector added to the candidate displacement vector list is unique and will not exist in any other displacement vector list besides the candidate displacement vector list.

[0316] 2) The sorting methods for the displacement vectors in the candidate displacement vector list include any of the following:

[0317] i. Sort according to a predetermined order. For example, arrange the displacement vectors in order of their acquisition time from oldest to newest (or vice versa). For instance, if the acquisition times of displacement vectors MV1, MV2, and MV3 used to construct the candidate displacement vector list are t1, t2, and t3 respectively, and t1 < t2 < t3, then the order of these three displacement vectors MV1, MV2, and MV3 in the candidate displacement vector list is: MV1, MV2, MV3. It should be understood that the displacement vectors in the candidate displacement vector list can be sorted sequentially from left to right or from top to bottom. For example, if the displacement vectors in the candidate displacement vector list are sorted sequentially from top to bottom, the sorted candidate displacement vector list is shown in Table 4-1 below:

[0318] Table 4-1. List of Candidate Displacement Vectors

[0319] Displacement vector Acquisition Time MV1 t1 MV2 t2 MV3 t3

[0320] Optional, please see Figure 7b , Figure 7b This is a schematic diagram illustrating the sorting of displacement vectors provided in an embodiment of this application. For example... Figure 7b As shown, if the coding blocks corresponding to the displacement vectors in the candidate displacement vector list include C0, C1, TL, TR, BL, and BR respectively, then the predetermined order can be: C0, C1, TL, TR, BL, and BR.

[0321] ii. Sort according to the cost of each displacement vector. For example, the cost may include but is not limited to: rate distortion cost, sum of absolute differences (SAD), sum of absolute transformed differences (SATD), sum of squared errors (SSE), mean-removed SAD, mean-removed SSE. The above costs can be calculated by using template matching. Taking the rate distortion cost as an example, for instance, the displacement vectors used to construct the candidate displacement vector list include: MV1, MV2, MV3, MV4, MV5, and are calculated by using template matching: the rate distortion cost of MV1 < the rate distortion cost of MV2 < the rate distortion cost of MV3 < the rate distortion cost of MV4 < the rate distortion cost of MV5. Then, the sorting order of each displacement vector in the candidate displacement vector list is: MV1, MV2, MV3, MV4, MV5. It should be understood that each displacement vector in the candidate displacement vector list can be sorted in sequence from left to right or from top to bottom. For example, if the displacement vectors in the candidate displacement vector list are sorted in sequence from left to right, the sorted candidate displacement vector list is shown in Table 4-2 below:

[0322] Table 4-2. Candidate Displacement Vector List

[0323] MV1 MV2 MV3 MV4 MV5 ... Loss1 Loss2 Loss3 Loss4 Loss5 ...

[0324] Among them, Loss1 refers to the rate distortion cost of MV1, Loss2 refers to the rate distortion cost of MV2, and so on. In Table 4-2, each displacement vector is sorted in ascending order of the rate distortion cost. It should be understood that in other feasible embodiments, each displacement vector can also be sorted in descending order of the rate distortion cost, and the present application does not make specific limitations on this.

[0325] Optionally, the costs of each displacement vector (such as rate distortion cost, SAD, SATD, SSE, mean-removed SAD, mean-removed SSE) can be weighted to obtain the total cost of each displacement vector; then sort according to the total cost of each displacement vector.

[0326] iii. Sort the displacement vectors according to their type. The displacement vector types must include at least: block vectors, string vectors, motion vectors (motion vectors for inter-frame motion), and default vectors. The priority of block vectors is higher than that of string vectors, which in turn is higher than that of motion vectors, which are higher than the priority of default vectors. Therefore, the candidate displacement vector list is sorted in the following order: block vectors, string vectors, motion vectors, and default vectors. For example, the sorted candidate displacement vector list is shown in Table 4-3 below:

[0327] Table 4-3. List of Candidate Displacement Vectors

[0328]

[0329]

[0330] In Table 4-3, displacement vectors MV1 and MV2 are both block vectors, MV3 and MV4 are both string vectors, MV5 is the motion vector for inter-frame motion, and MV6 is the default vector.

[0331] iv. Sort the displacement vectors comprehensively according to their type and rate-distortion cost. Specifically, the displacement vectors in the list can be first divided into different categories (block vector category, string vector category, default vector category), and then sorted according to the cost of the displacement vectors within each category. For example, the sorted candidate displacement vector list is shown in Table 4-4 below:

[0332] Table 4-4. List of Candidate Displacement Vectors

[0333]

[0334] In Table 4-4, displacement vectors MV1 and MV2 are both block vectors, and the cost of MV1 is less than that of MV2; MV3 and MV4 are both string vectors, and the cost of MV3 is less than that of MV4; MV5 and MV6 are both motion vectors, and the cost of MV5 is less than that of MV6; MV7 is the default vector.

[0335] (2) Then, the specific process of determining the target displacement vector is explained in detail.

[0336] In one possible implementation, the target displacement vector is determined from a list of candidate displacement vectors, including any of the following methods:

[0337] 1) Select the Kth displacement vector in the candidate displacement vector list as the target displacement vector, where K is a positive integer. For example, select the 1st displacement vector in the candidate displacement vector list as the target displacement vector.

[0338] 2) Determine the target displacement vector from the candidate displacement vector list according to the displacement vector index. The displacement vector index indicates the position of the displacement vector in the candidate displacement vector list and can be decoded from the video stream. For example, if the displacement vector index is m (m is a positive integer), then the target displacement vector determined based on this index is the displacement vector with index m in the displacement vector list. Optionally, the displacement vector index can only be decoded from the video stream if the number of displacement vectors in the displacement vector list is greater than one.

[0339] 3) Obtain candidate displacement vectors from the candidate displacement vector list, scale the candidate displacement vectors according to the color format sampling ratio, and retain the integer pixel precision of the scaled displacement vectors to obtain the target displacement vector. Specifically, if the obtained candidate displacement vector MV is represented as (5, 3) and the color format is YUV420, then the sampling ratio under the YUV420 format is scaleX = 2, scaleY = 2. Therefore, the displacement vector MV' obtained after scaling the displacement vector represented as (5, 3) is (2.5, 1.5); further, after retaining the integer pixel precision of MV', the target displacement vector can be (2, 1). When retaining the integer pixel precision of the displacement vector, it can be rounded up or down; this application does not limit this.

[0340] 4) Obtain candidate displacement vectors from the candidate displacement vector list, and use the displacement vector of the luminance component as the target displacement vector. For example, if the obtained candidate displacement vector MV is represented as (5.1, 3.2), then retain the precision of the displacement vector (integer pixel precision or fractional pixel precision) and directly use the obtained displacement vector (5.1, 3.2) as the target displacement vector.

[0341] It is important to note that in steps 3) and 4) above, MV is usually stored with a certain precision. For example, in AVS3, MV is stored with a precision of 1 / 4 pixel. An MV with an integer pixel precision is (2,1), which is magnified to (8,4) when stored. In this case, the integer pixel part of MV can be obtained by MV / 4, and the fractional pixel part can be obtained by MV%4, where " / " means integer division and rounding down, and "%" means remainder.

[0342] S603: Based on the target displacement vector, determine the predicted value of the current chroma block. The predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0343] In one possible implementation, if the target displacement vector has integer pixel precision, motion compensation is performed on the target displacement vector to derive the predicted value of the current chroma block; or, if the target displacement vector has fractional pixel precision, interpolation is performed on the target displacement vector, and motion compensation is performed on the interpolated target displacement vector to derive the predicted value of the current chroma block.

[0344] In another possible implementation, if the target displacement vector does not exist in the luma co-location block corresponding to the current chroma block, then the predicted value of the current chroma block is derived using an intra-frame prediction mode. The intra-frame prediction mode includes: cross-component intra-frame prediction mode, or a specified intra-frame prediction mode. 1) Cross-component intra-frame prediction modes include: Two-Step Cross-component Prediction Mode (TSPCM) and Cross Component Linear Model Prediction (CCLM) prediction modes; 2) Specified intra-frame prediction modes include: any one or more of the following: Intra-frame prediction Direct Coefficient (DC), Intra-frame prediction Bilinear Prediction Mode (Blinear Prediction Mode), Intra-frame prediction Planar / Plane Prediction Mode, Horizontal Intra-frame Prediction Mode, and Vertical Intra-frame Prediction Mode.

[0345] In one possible implementation: 1) If the current chroma block uses the chroma block copy intra-prediction mode, then based on the information of the target luminance sample in the corresponding luminance co-location block, determine whether the current chroma block needs to undergo residual decoding, where the target luminance sample is the luminance sample corresponding to the target displacement vector; 2) If it is determined that the current chroma block needs to undergo residual decoding, then perform residual decoding on the current chroma block to obtain the residual value; 3) Based on the residual value and the predicted value of the current chroma block, reconstruct the decoded image corresponding to the current chroma block. The luminance co-location block corresponding to the current chroma block contains multiple luminance blocks, and the condition for determining whether the current chroma block does not need to undergo residual decoding includes any of the following:

[0346] i. If the target brightness sample uses intra-frame string copy prediction normal string sub-mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0347] ii. If the target brightness sample uses intra-frame string copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0348] iii. If the target luminance sample uses intra-block copy prediction mode, and the luminance block containing the target luminance sample does not need to be residual encoded;

[0349] iv. If the target brightness sample uses intra-string copy prediction normal string mode or intra-block copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0350] v. If the target luminance sample uses intra-string copy prediction mode or intra-block copy prediction mode, and the luminance block where the target luminance sample is located does not need to be residual encoded;

[0351] The criterion for determining whether the luminance block containing the target luminance sample needs residual coding is based on either the coefficient flag of the luminance block or the prediction mode of the current chroma block. For example, in video encoding and decoding, each coding block corresponds to a coefficient flag, which indicates whether the current coding block needs to encode residual values ​​(also called residual coefficients). If the coefficient flag of the luminance block containing the target luminance sample is 0, it can be deduced that the coefficient flag of the current chroma block is also 0, indicating that the current chroma block does not need residual decoding. Similarly, if the prediction mode of the current chroma block is skip mode, then the current chroma block does not need residual decoding.

[0352] In one possible implementation, the determination of the predicted value of the current chroma block may further include the following scheme: determining the current chroma block in the video bitstream; dividing the current chroma block into P×Q chroma sub-blocks, where P and Q are both integers; obtaining the block vector of the corresponding luminance co-position sub-block for each chroma sub-block; and determining the predicted value of the current chroma block based on the obtained P×Q block vectors. The specific process of obtaining the block vector of any chroma sub-block can be detailed in step S602 above, where the target displacement vector is determined, and will not be repeated here. Similarly, the specific process of determining the predicted value of the current chroma block according to each block vector can be detailed in step S603 above, where the predicted value is determined, and will also not be repeated here.

[0353] In this embodiment, the current chroma block in the video stream can be determined, and the current chroma block adopts the chroma block copy intra-prediction mode; the target displacement vector of the luma co-position block corresponding to the current chroma block is obtained; based on the target displacement vector, the predicted value of the current chroma block is determined; this predicted value is used to reconstruct the decoded image corresponding to the current chroma block. As can be seen above, during the decoding process of the video stream, when it is determined that the current chroma block adopts the chroma block copy intra-prediction mode, the displacement vector information of the luma co-position block can be used to determine the predicted value of the current chroma block, eliminating the need for intra-prediction processing on the current chroma block. This improves the encoding and decoding efficiency of the current chroma block, thereby effectively enhancing coding performance.

[0354] Please see Figure 8 , Figure 8This is a flowchart illustrating another video processing method provided in an embodiment of this application. This video processing method can be executed by an encoding device in a video processing system. The video processing method described in this embodiment may include the following steps S801-S804:

[0355] S801: Determine the current chroma block in the video. The current chroma block uses the chroma block copy intra-prediction mode.

[0356] In one possible implementation, whether the current chroma block adopts the chroma block copy intra-prediction mode is indicated by mode indication information, which includes at least one of the following: sequence header flag, image header flag, slice header flag, coding unit flag, implicit information, and chroma indication information. The chroma block copy intra-prediction mode is a prediction mode independent of the ordinary intra-prediction mode; or, the chroma block copy intra-prediction mode is a sub-mode of the ordinary intra-prediction mode. The ordinary intra-prediction mode includes at least one of the following: intra-prediction DC coefficient mode, angle-based intra-prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-reference pixel derived prediction values.

[0357] (1) Chroma block copy intra-prediction mode is a prediction mode that is independent of ordinary intra-prediction mode.

[0358] 1) If the mode indication information is the sequence header flag seq_cibc_flag, then when the sequence header flag seq_cibc_flag is the first preset value (e.g., 1), it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode. When the sequence header flag seq_cibc_flag is the second preset value (e.g., 0), it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0359] 2) If the mode indication information is the image header flag pic_cibc_flag, then when the image header flag pic_cibc_flag is the first preset value (e.g., 1), it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode. When the image header flag pic_cibc_flag is the second preset value (e.g., 0), it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0360] 3) If the mode indication information is the header flag patch_cibc_flag, then when the header flag patch_cibc_flag is the first preset value (e.g., 1), it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode. When the header flag patch_cibc_flag is the second preset value (e.g., 0), it indicates that the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0361] 4) If the mode indication information is the coding unit flag cu_cibc_flag, then when the coding unit flag cu_cibc_flag is the first preset value (e.g., 1), it indicates that the current chroma block adopts the chroma block copy intra-prediction mode. When the coding unit flag cu_cibc_flag is the second preset value (e.g., 0), it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode.

[0362] It should be noted that steps 1)-4) above can be used individually or in combination. For example, when the sequence header flag seq_cibc_flag = 1, it can be determined that the current chroma block in the current sequence adopts the chroma block copy intra-prediction mode; similarly, when the sequence header flag seq_cibc_flag = 1 and the coding unit flag cu_cibc_flag = 1, it can be determined that the current chroma block adopts the chroma block copy intra-prediction mode; furthermore, it can be determined that the current chroma block adopts the chroma block copy intra-prediction mode only when seq_cibc_flag = 1, pic_cibc_flag = 1, patch_cibc_flag = 1, and cu_cibc_flag are all present, and so on.

[0363] (2) Chroma block copy intra-prediction mode is a sub-mode of normal intra-prediction mode. In this mode, the chroma block copy intra-prediction mode is turned on or off in relation to the intra-prediction mode (e.g., IBC or ISC).

[0364] 1) If it is determined that the current sequence is in IBC mode or ISC mode, then the current chroma block is allowed to use the chroma block copy intra-prediction mode; if it is determined that the current sequence is in IBC mode or ISC mode, then the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0365] 2) If it is determined that the current image is in IBC mode or ISC mode, then the current chroma block is allowed to use the chroma block copy intra-prediction mode; if it is determined that the current image is in IBC mode or ISC mode, then the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0366] 3) If it is determined that the current slice is in IBC mode or ISC mode, then the current chroma block is allowed to use the chroma block copy intra-prediction mode; if it is determined that the current slice is in IBC mode or ISC mode, then the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0367] 4) If it is determined that the current coding unit is in IBC mode or ISC mode, then the current chroma block is allowed to use the chroma block copy intra-prediction mode; if it is determined that the current coding unit is in IBC mode or ISC mode, then the current chroma block is not allowed to use the chroma block copy intra-prediction mode.

[0368] It should be noted that, in the embodiments of this application, the prediction mode adopted by the current chroma block can be represented not only as the chroma block copy intra-prediction mode, but also in other different ways. For example, it can be represented as a sub-mode of a normal intra-prediction mode, or other prediction mode names, etc. This application does not limit the specific name of the prediction mode adopted by the current chroma block.

[0369] S802: Obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block.

[0370] First, the corresponding luminance isotope block needs to be determined. In one possible implementation, the position and size of the corresponding luminance isotope block can be determined based on the position and size of the current chroma block, as well as the color format of the video image. Assuming the coordinates of the top-left corner of the current chroma block are (xC, yC), its size is (wC, hC), and the horizontal and vertical sampling ratios between the luminance and chroma components corresponding to the color format are (scaleX, scaleY), for example, if the color format is YUV420, then scaleX = 2 and scaleY = 2.

[0371] Then, the target displacement vector is determined from the luma coordinate blocks. In one possible implementation, obtaining the target displacement vector of the luma coordinate block corresponding to the current chroma block includes: first, constructing a candidate displacement vector list of the luma coordinate blocks corresponding to the current chroma block; then, determining the target displacement vector from the candidate displacement vector list.

[0372] (1) The displacement vectors used to construct the candidate displacement vector list include the following:

[0373] i. The displacement vector of luminance samples in the luminance co-location block that satisfies the specified mode. The specified mode includes any one of the following: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, intra-template matching mode, inter-frame prediction mode, affine motion mode, inter-frame composite mode, Angular Weighted Prediction (AWP) mode, Spatial Angular Weighted Prediction (SAWP) mode, and Geometric Partitioning Mode (GPM) mode.

[0374] ii. Displacement vector of spatially adjacent blocks corresponding to the luminance co-position block. Here, spatially adjacent blocks refer to the coded blocks in the current frame of the video that are adjacent to the current coded block (also known as the coding unit). The current frame refers to the video frame to which the current coding unit belongs; the current coded block refers to the coded block in the current frame that is being decoded.

[0375] iii. Displacement vectors in the intra-predictive history motion information table (e.g., HMVP, IntraHMVP) of the lumen co-block.

[0376] iv. The displacement vector obtained by offsetting the candidate displacement vectors in steps i-iii above.

[0377] v. If no valid displacement vector exists, the list can be filled with default displacement vectors, which include: (-w, 0), (0, -h), (-w, -h), (-2*w, 0), (0, -2*h); or, the displacement vectors in the candidate displacement vector list can be set to invalid values, such as (0, 0).

[0378] The displacement vectors in the candidate displacement vector list must satisfy at least one of the following conditions:

[0379] i. The reference block of the lumen co-position block satisfies the reference range limitation of the intra-block copy prediction mode;

[0380] ii. The reference block of the lumen co-position block and the displacement vector both satisfy the reference range limitation of the intra-string copy prediction normal string sub-mode;

[0381] iii. The displacement vector is unique and does not repeat any displacement vector in any other displacement vector list besides the candidate displacement vector list. In other words, the displacement vector added to the candidate displacement vector list is unique and will not exist in any other displacement vector list besides the candidate displacement vector list.

[0382] (2) Determine the target displacement vector from the candidate displacement vector list, including any of the following methods:

[0383] 1) Take the Kth displacement vector in the candidate displacement vector list as the target displacement vector, where K is a positive integer.

[0384] 2) Determine the target displacement vector from the list of candidate displacement vectors according to the displacement vector index.

[0385] 3) Obtain candidate displacement vectors from the candidate displacement vector list, scale the candidate displacement vectors according to the color format sampling ratio, and retain the integer pixel precision of the scaled displacement vectors to obtain the target displacement vector.

[0386] 4) Obtain candidate displacement vectors from the candidate displacement vector list, and use the displacement vector of the brightness component as the target displacement vector.

[0387] It should be noted that the specific process of constructing the candidate displacement vector list and the specific process of determining the target displacement vector can be referred to the relevant steps in the above embodiments, and will not be repeated here in the embodiments of this application.

[0388] S803: Determine the predicted value of the current chromaticity block based on the target displacement vector.

[0389] In one possible implementation, if the target displacement vector has integer pixel precision, motion compensation is performed on the target displacement vector to derive the predicted value of the current chroma block; or, if the target displacement vector has fractional pixel precision, interpolation is performed on the target displacement vector, and motion compensation is performed on the interpolated target displacement vector to derive the predicted value of the current chroma block.

[0390] In another possible implementation, if the target displacement vector does not exist in the luma co-location block corresponding to the current chroma block, then the predicted value of the current chroma block is derived using an intra-frame prediction mode. The intra-frame prediction mode includes: cross-component intra-frame prediction mode, or a specified intra-frame prediction mode. Cross-component intra-frame prediction modes include: Two-Step Cross-component Prediction Mode (TSPCM) and Cross Component Linear Model Prediction (CCLM) prediction modes. Specified intra-frame prediction modes include: Intra-frame prediction Direct Coefficient (DC) mode, Intra-frame prediction Bilinear Prediction Mode (Blinear Prediction Mode), Intra-frame prediction Planar / Plane Prediction Mode, Horizontal Intra-frame Prediction Mode, and Vertical Intra-frame Prediction Mode, or any one or more of these.

[0391] S804: Encode the video based on the predicted value of the current chroma block to generate a video stream.

[0392] In one possible implementation, before encoding the video based on the predicted value of the current chroma block to generate the video bitstream, it is also necessary to check whether the current chroma block needs residual coding. Specifically, this includes the following two cases:

[0393] (1) If the current chroma block does not need to be residual encoded, the current chroma block is directly encoded based on the predicted value of the current chroma block to obtain the encoded image corresponding to the current chroma block.

[0394] (2) If the current chroma block needs to be residual encoded, the current chroma block is residual encoded to obtain the residual value; and based on the residual value and the predicted value of the current chroma block, the current chroma block is encoded to obtain the encoded image corresponding to the current chroma block.

[0395] The current chroma block corresponds to a luminance co-position block containing multiple luminance blocks. The criteria for determining whether the current chroma block needs residual coding include any of the following:

[0396] i. If the target brightness sample uses intra-frame string copy prediction normal string sub-mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0397] ii. If the target brightness sample uses intra-frame string copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0398] iii. If the target luminance sample uses intra-block copy prediction mode, and the luminance block containing the target luminance sample does not need to be residual encoded;

[0399] iv. If the target brightness sample uses intra-string copy prediction normal string mode or intra-block copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0400] v. If the target luminance sample uses intra-string copy prediction mode or intra-block copy prediction mode, and the luminance block containing the target luminance sample does not need to be residual encoded.

[0401] In this embodiment, the current chroma block in the video can be determined, and the current chroma block adopts the chroma block copy intra-prediction mode; the target displacement vector of the luma co-position block corresponding to the current chroma block is obtained; based on the target displacement vector, the predicted value of the current chroma block is determined; and the video is encoded based on the predicted value of the current chroma block to generate a video bitstream. During the video encoding process, when the current chroma block adopts the chroma block copy intra-prediction mode, the displacement vector information of the luma co-position block can be used to determine the predicted value of the current chroma block, eliminating the need for encoding prediction and other processing on the current chroma block. This improves the efficiency of chroma block decoding and effectively enhances encoding performance.

[0402] The following is in conjunction with the appendix Figures 9-11 The relevant apparatuses in the embodiments of this application will be described accordingly.

[0403] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a video processing device provided in an embodiment of this application. Figure 9As shown, the video processing device 900 can be applied to the computer device mentioned in the foregoing embodiments, and the computer device can be the decoding device mentioned in the above method embodiments. Specifically, the video processing device 900 can be a computer program (including program code) running on the computer device, for example, the video processing device 900 is an application software; the video processing device 900 can be used to execute the corresponding steps in the video processing method provided in the embodiments of this application. In specific implementation, the video processing device 900 may specifically include:

[0404] The determining unit 901 is used to determine the current chroma block in the video bitstream. The current chroma block adopts the chroma block copying intra-prediction mode.

[0405] Processing unit 902 is used to obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block;

[0406] The processing unit 902 is also used to determine the predicted value of the current chroma block based on the target displacement vector; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0407] In one possible implementation, the chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode; or, the chroma block copy intra-prediction mode is a sub-mode of the normal intra-prediction mode.

[0408] Ordinary intra-frame prediction modes include at least one of the following: intra-frame prediction DC coefficient mode, angle-based intra-frame prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-frame reference pixel derived prediction values.

[0409] In one possible implementation, after determining the current chroma block in the video bitstream, the processing unit 902 is further configured to perform the following operations:

[0410] Divide the current chroma block into P×Q chroma sub-blocks, where P and Q are both integers;

[0411] Obtain the block vector of the corresponding luminance sub-block for each chroma sub-block;

[0412] Based on the obtained P×Q block vectors, the predicted value of the current chroma block is determined.

[0413] In one possible implementation, the processing unit 902 is further configured to perform the following operations:

[0414] Decode the video stream to obtain mode indication information. The mode indication information is used to indicate whether the current chroma block adopts the chroma block copy intra-prediction mode.

[0415] The mode indication information includes at least one of the following: sequence header flag, image header flag, slice header flag, coding unit flag, implicit information, and chroma indication information.

[0416] In one possible implementation, if the mode indication information is a sequence header flag, the mode indication information is set in the sequence header of the current sequence to which the current chroma block belongs; when the sequence header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the sequence header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0417] If the mode indication information is an image header flag, the mode indication information is set in the image header of the current image to which the current chroma block belongs; when the image header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the image header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0418] If the mode indication information is a title block flag, the mode indication information is set in the title block of the current slice to which the current chroma block belongs; when the title block flag is the first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the title block flag is the second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0419] If the mode indication information is a coding unit flag, the mode indication information is set in the current coding unit; when the coding unit flag is a first preset value, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode; when the coding unit flag is a second preset value, it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode.

[0420] If the mode indication information is implicit, then when the implicit information indicates that the luminance sample at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset condition, the current chroma block is instructed to adopt the chroma block copy intra-prediction mode.

[0421] If the mode indication information is chroma indication information, then when the chroma indication information indicates that the current chroma block adopts the preset intra-prediction mode, and the luminance sample at the preset position in the luminance co-position block meets the preset conditions, the current chroma block is indicated to adopt the chroma block copy intra-prediction mode; the preset intra-prediction mode includes the inheritance mode.

[0422] In one possible implementation, the processing unit 902 is further configured to perform the following operations:

[0423] Check if the video bitstream meets the decoding requirements;

[0424] If the video stream meets the decoding conditions, then the step of decoding the video stream and obtaining the mode indication information is executed.

[0425] In one possible implementation, the decoding conditions include: the color format used by the video stream is a format that includes chroma components;

[0426] When the mode indication information is set in the current coding unit to which the current chroma block belongs, the decoding conditions include any one or more of the following:

[0427] The current coding unit contains only chroma components;

[0428] The luminance sample point at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset conditions;

[0429] If there are multiple preset locations, then the number of brightness samples that meet the preset conditions is at least one, or greater than or equal to a preset threshold.

[0430] In one possible implementation, the preset position can be determined in any of the following ways:

[0431] Determine a preset chromaticity sample point in the current chromaticity block, and determine the preset position of the corresponding luminance sample point in the luminance co-position block based on the position of the preset chromaticity sample point.

[0432] Determine the preset position from the brightness co-position block;

[0433] Based on the division method of the luminance co-position block, the preset position is determined in each sub-block obtained by dividing the luminance co-position block;

[0434] Divide the luminance co-position block into M×N sub-blocks, and use a specified position in the M×N sub-blocks as a preset position. The specified position includes any one of the following positions: the center, top left corner, top right corner, bottom left corner, and bottom right corner of the sub-block. M and N are both positive integers.

[0435] In one possible implementation, the preset conditions include any one or more of the following:

[0436] The luminance samples adopt any one of the modes in a specific mode set, which includes: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, or any one or more prediction modes with intra-frame displacement vectors.

[0437] The brightness samples have valid displacement vectors;

[0438] The intra-frame prediction history motion information table for the current chroma block is not empty.

[0439] In one possible implementation, the processing unit 902 obtains the target displacement vector of the luminance co-position block corresponding to the current chroma block, and performs the following operations:

[0440] Construct a list of candidate displacement vectors for the luminance co-position block corresponding to the current chrominance block;

[0441] Determine the target displacement vector from the list of candidate displacement vectors.

[0442] In one possible implementation, the processing unit 902 constructs a list of candidate displacement vectors for the luminance co-position block corresponding to the current chroma block, including any one or more of the following methods:

[0443] Add the displacement vectors of the luminance samples in the luminance co-location block that meet the specified mode to the candidate displacement vector list. The specified mode includes any one of the following: intra-block copy prediction mode, intra-string copy prediction normal string mode, string copy intra-prediction non-normal string mode, intra-template matching mode, inter-frame prediction mode, affine motion mode, inter-frame composite mode, and angle-weighted prediction mode.

[0444] Add the displacement vectors of the spatial adjacent blocks corresponding to the brightness co-position block to the candidate displacement vector list;

[0445] The displacement vectors from the historical motion information table or the intra-frame predicted historical motion information table will be added to the candidate displacement vector list.

[0446] After offsetting, the candidate displacement vectors are added to the candidate displacement vector list. The candidate displacement vectors include any one or more of the following: displacement vectors of luminance samples that meet the specified mode in the luminance co-location block, displacement vectors of spatial adjacent blocks corresponding to the luminance co-location block, and displacement vectors of spatial adjacent blocks corresponding to the luminance co-location block.

[0447] If no valid displacement vector exists in the brightness co-location block, the default displacement vector is added to the candidate displacement vector list; or, the displacement vector in the candidate displacement vector list is set to an invalid value.

[0448] In one possible implementation, the displacement vectors in the candidate displacement vector list must satisfy at least one of the following conditions:

[0449] The reference block of the lumen co-position block satisfies the reference range limitation of the intra-block copy prediction mode;

[0450] The reference block of the luminance co-position block and the displacement vector both satisfy the reference range limitation of the intra-string copy prediction normal string sub-mode;

[0451] The displacement vector is not repeated by any other displacement vector outside the candidate displacement vector list;

[0452] The displacement vector is not repeated with the first N or last N displacement vectors in the candidate displacement vector list, where N is an integer.

[0453] In one possible implementation, the sorting of displacement vectors in the candidate displacement vector list can be any of the following:

[0454] Arranged in a predetermined order;

[0455] The costs are sorted according to the cost of each displacement vector, and the costs include at least: rate distortion cost, sum of absolute errors, sum of absolute errors after transformation, sum of squared differences, sum of absolute errors after mean removal, and sum of absolute variances after mean removal.

[0456] Sort by displacement vector type, the displacement vector types include at least: block vector, string vector, motion vector, and default vector;

[0457] The displacement vectors are sorted according to their type and the cost of each vector.

[0458] In one possible implementation, the processing unit 902 determines the target displacement vector from the candidate displacement vector list, including any of the following methods:

[0459] The Kth displacement vector in the candidate displacement vector list is taken as the target displacement vector, where K is a positive integer;

[0460] The target displacement vector is determined from the list of candidate displacement vectors according to the displacement vector index;

[0461] The candidate displacement vector is obtained from the candidate displacement vector list, scaled according to the color format sampling ratio, and the integer pixel precision of the scaled displacement vector is retained to obtain the target displacement vector.

[0462] Retrieve candidate displacement vectors from the list of candidate displacement vectors and use them as target displacement vectors.

[0463] In one possible implementation, processing unit 902 determines the predicted value of the current chromaticity block based on the target displacement vector, for performing the following operations:

[0464] If the target displacement vector has integer pixel precision, then motion compensation is performed on the target displacement vector to derive the predicted value of the current chroma block; or,

[0465] If the target displacement vector has pixel-level precision, then the target displacement vector is interpolated, and motion compensation is performed on the interpolated target displacement vector to derive the predicted value of the current chroma block.

[0466] In one possible implementation, the processing unit 902 is further configured to perform the following operations:

[0467] If there is no target displacement vector in the luma co-location block corresponding to the current chroma block, the intra-frame prediction mode is used to derive the predicted value of the current chroma block.

[0468] The intra-frame prediction modes include: cross-component intra-frame prediction modes or specified intra-frame prediction modes; cross-component intra-frame prediction modes include: cross-component two-step prediction mode and cross-component linear model prediction mode; specified intra-frame prediction modes include any one or more of the following: intra-frame prediction DC coefficient mode, intra-frame prediction bilinear prediction mode, intra-frame prediction planar prediction mode, horizontal intra-frame prediction mode, and vertical intra-frame prediction mode.

[0469] In one possible implementation, the processing unit 902 is further configured to perform the following operations:

[0470] If the current chroma block adopts the chroma block copy intra-prediction mode, then based on the information of the target luminance sample in the luminance co-position block corresponding to the current chroma block, it is determined whether the current chroma block needs to be subjected to residual decoding. The target luminance sample is the luminance sample corresponding to the target displacement vector.

[0471] If it is determined that the current chroma block needs to be subjected to residual decoding, then residual decoding is performed on the current chroma block to obtain the residual value;

[0472] Based on the residual value and predicted value of the current chroma block, reconstruct the decoded image corresponding to the current chroma block.

[0473] In one possible implementation, the luma co-position block corresponding to the current chroma block contains multiple luma blocks; the condition for determining that the current chroma block does not need to undergo residual decoding includes any of the following:

[0474] If the target brightness sample point uses intra-frame string copy prediction normal string sub-mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0475] If the target brightness sample point adopts the intra-frame string copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0476] If the target brightness sample uses intra-block copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0477] If the target brightness sample point adopts the intra-string copy prediction normal string mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0478] If the target brightness sample point adopts the intra-string copy prediction mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0479] The criterion for determining whether the luminance block containing the target luminance sample needs residual coding is based on: the coefficient flag of the luminance block or the prediction mode of the current chrominance block.

[0480] In this embodiment, the current chroma block in the video stream can be determined, and the current chroma block adopts the chroma block copy intra-prediction mode; the target displacement vector of the luma co-position block corresponding to the current chroma block is obtained; based on the target displacement vector, the predicted value of the current chroma block is determined; this predicted value is used to reconstruct the decoded image corresponding to the current chroma block. As can be seen above, during the decoding process of the video stream, when it is determined that the current chroma block adopts the chroma block copy intra-prediction mode, the displacement vector information of the luma co-position block can be used to determine the predicted value of the current chroma block, eliminating the need for intra-prediction processing on the current chroma block. This improves the encoding and decoding efficiency of the current chroma block, thereby effectively enhancing coding performance.

[0481] Please see Figure 10 , Figure 10 This is a schematic diagram of another video processing apparatus provided in an embodiment of this application. Figure 10 As shown, the video processing device 1000 can be applied to the computer device mentioned in the foregoing embodiments, and the computer device can be the encoding device mentioned in the above method embodiments. Specifically, the video processing device 1000 can be a computer program (including program code) running on the computer device, for example, the video processing device 1000 is an application software; the video processing device 1000 can be used to execute the corresponding steps in the video processing method provided in the embodiments of this application. In specific implementation, the video processing device 1000 may specifically include:

[0482] The determining unit 1001 is used to determine the current chroma block in the video, and the current chroma block adopts the chroma block copying intra-frame prediction mode.

[0483] Processing unit 1002 is used to obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block;

[0484] The processing unit 1002 is also used to determine the predicted value of the current chroma block based on the target displacement vector; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block;

[0485] The processing unit 1002 is also configured to encode the video based on the predicted value of the current chroma block to generate a video bitstream.

[0486] In this embodiment, the current chroma block in the video bitstream can be determined. The current chroma block refers to the current coding unit that does not contain a luminance component. The current chroma block adopts the chroma block copy intra-prediction mode. The target displacement vector of the luminance co-position block corresponding to the current chroma block is obtained. Based on the target displacement vector, the predicted value of the current chroma block is determined. This predicted value is used to reconstruct the decoded image corresponding to the current chroma block. As can be seen from the above, in the video bitstream decoding process, when it is determined that the current chroma block adopts the chroma block copy intra-prediction mode, the displacement vector information of the luminance co-position block can be used to determine the predicted value of the current chroma block, eliminating the need for intra-prediction processing on the current chroma block. This improves the encoding and decoding efficiency of the current chroma block, thereby effectively improving coding performance.

[0487] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 11 As shown, the computer device 1100 may include a processor 1101, an input device 1102, an output device 1103, and a memory 1104. The processor 1101, input device 1102, output device 1103, and memory 1104 are connected via a bus 1105. The memory 1104 stores computer programs, which include program instructions. The processor 1101 executes the program instructions stored in the memory 1104.

[0488] Specifically, the processor 1101 executes the following operations by running program instructions stored in memory 1104:

[0489] In one embodiment, the computer device 1100 can be the decoding device described above. In this embodiment, the processor 1101 performs the following operations by running program instructions in the memory 1104:

[0490] Determine the current chroma block in the video stream, and use the chroma block copy intra-prediction mode for the current chroma block;

[0491] Obtain the target displacement vector of the luminance co-position block corresponding to the current chrominance block;

[0492] Based on the target displacement vector, the predicted value of the current chroma block is determined; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0493] In one possible implementation, the chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode; or, the chroma block copy intra-prediction mode is a sub-mode of the normal intra-prediction mode.

[0494] Ordinary intra-frame prediction modes include at least one of the following: intra-frame prediction DC coefficient mode, angle-based intra-frame prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-frame reference pixel derived prediction values.

[0495] In one possible implementation, after determining the current chroma block in the video bitstream, the processing unit 902 is further configured to perform the following operations:

[0496] Divide the current chroma block into P×Q chroma sub-blocks, where P and Q are both integers;

[0497] Obtain the block vector of the corresponding luminance sub-block for each chroma sub-block;

[0498] Based on the obtained P×Q block vectors, the predicted value of the current chroma block is determined.

[0499] In one possible implementation, processor 1101 is also used to perform the following operations:

[0500] Decode the video stream to obtain mode indication information. The mode indication information is used to indicate whether the current chroma block adopts the chroma block copy intra-prediction mode.

[0501] The mode indication information includes at least one of the following: sequence header flag, image header flag, slice header flag, coding unit flag, implicit information, and chroma indication information.

[0502] In one possible implementation, if the mode indication information is a sequence header flag, the mode indication information is set in the sequence header of the current sequence to which the current chroma block belongs; when the sequence header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the sequence header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0503] If the mode indication information is an image header flag, the mode indication information is set in the image header of the current image to which the current chroma block belongs; when the image header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the image header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0504] If the mode indication information is a title block flag, the mode indication information is set in the title block of the current slice to which the current chroma block belongs; when the title block flag is the first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the title block flag is the second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode.

[0505] If the mode indication information is a coding unit flag, the mode indication information is set in the current coding unit; when the coding unit flag is a first preset value, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode; when the coding unit flag is a second preset value, it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode.

[0506] If the mode indication information is implicit, then when the implicit information indicates that the luminance sample at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset condition, the current chroma block is instructed to adopt the chroma block copy intra-prediction mode.

[0507] If the mode indication information is chroma indication information, then when the chroma indication information indicates that the current chroma block adopts the preset intra-prediction mode, and the luminance sample at the preset position in the luminance co-position block meets the preset conditions, the current chroma block is indicated to adopt the chroma block copy intra-prediction mode; the preset intra-prediction mode includes the inheritance mode.

[0508] In one possible implementation, processor 1101 is also used to perform the following operations:

[0509] Check if the video bitstream meets the decoding requirements;

[0510] If the video stream meets the decoding conditions, then the step of decoding the video stream and obtaining the mode indication information is executed.

[0511] In one possible implementation, the decoding conditions include: the color format used by the video stream is a format that includes chroma components;

[0512] When the mode indication information is set in the current coding unit to which the current chroma block belongs, the decoding conditions include any one or more of the following:

[0513] The current coding unit contains only chroma components;

[0514] The luminance sample point at the preset position in the luminance co-position block corresponding to the current chroma block meets the preset conditions;

[0515] If there are multiple preset locations, then the number of brightness samples that meet the preset conditions is at least one, or greater than or equal to a preset threshold.

[0516] In one possible implementation, the preset position can be determined in any of the following ways:

[0517] Determine a preset chromaticity sample point in the current chromaticity block, and determine the preset position of the corresponding luminance sample point in the luminance co-position block based on the position of the preset chromaticity sample point.

[0518] Determine the preset position from the brightness co-position block;

[0519] Based on the division method of the luminance co-position block, the preset position is determined in each sub-block obtained by dividing the luminance co-position block;

[0520] Divide the luminance co-position block into M×N sub-blocks, and use a specified position in the M×N sub-blocks as a preset position. The specified position includes any one of the following positions: the center, top left corner, top right corner, bottom left corner, and bottom right corner of the sub-block. M and N are both positive integers.

[0521] In one possible implementation, the preset conditions include any one or more of the following:

[0522] The luminance samples adopt any one of the modes in a specific mode set, which includes: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, or any one or more prediction modes with intra-frame displacement vectors.

[0523] The brightness samples have valid displacement vectors;

[0524] The intra-frame prediction history motion information table for the current chroma block is not empty.

[0525] In one possible implementation, processor 1101 obtains the target displacement vector of the luminance co-position block corresponding to the current chroma block, and performs the following operations:

[0526] Construct a list of candidate displacement vectors for the luminance co-position block corresponding to the current chrominance block;

[0527] Determine the target displacement vector from the list of candidate displacement vectors.

[0528] In one possible implementation, processor 1101 constructs a list of candidate shift vectors for the luminance co-position block corresponding to the current chroma block, including any one or more of the following methods:

[0529] Add the displacement vectors of the luminance samples in the luminance co-location block that meet the specified mode to the candidate displacement vector list. The specified mode includes any one of the following: intra-block copy prediction mode, intra-string copy prediction normal string mode, string copy intra-prediction non-normal string mode, intra-template matching mode, inter-frame prediction mode, affine motion mode, inter-frame composite mode, and angle-weighted prediction mode.

[0530] Add the displacement vectors of the spatial adjacent blocks corresponding to the brightness co-position block to the candidate displacement vector list;

[0531] The displacement vectors from the historical motion information table or the intra-frame predicted historical motion information table will be added to the candidate displacement vector list.

[0532] After offsetting, the candidate displacement vectors are added to the candidate displacement vector list. The candidate displacement vectors include any one or more of the following: displacement vectors of luminance samples that meet the specified mode in the luminance co-location block, displacement vectors of spatial adjacent blocks corresponding to the luminance co-location block, and displacement vectors of spatial adjacent blocks corresponding to the luminance co-location block.

[0533] If no valid displacement vector exists in the brightness co-location block, the default displacement vector is added to the candidate displacement vector list; or, the displacement vector in the candidate displacement vector list is set to an invalid value.

[0534] In one possible implementation, the displacement vectors in the candidate displacement vector list must satisfy at least one of the following conditions:

[0535] The reference block of the lumen co-position block satisfies the reference range limitation of the intra-block copy prediction mode;

[0536] The reference block of the luminance co-position block and the displacement vector both satisfy the reference range limitation of the intra-string copy prediction normal string sub-mode;

[0537] The displacement vector is not repeated by any other displacement vector outside the candidate displacement vector list;

[0538] The displacement vector is not repeated with the first N or last N displacement vectors in the candidate displacement vector list, where N is an integer.

[0539] In one possible implementation, the sorting of displacement vectors in the candidate displacement vector list can be any of the following:

[0540] Arranged in a predetermined order;

[0541] The costs are sorted according to the cost of each displacement vector, and the costs include at least: rate distortion cost, sum of absolute errors, sum of absolute errors after transformation, sum of squared differences, sum of absolute errors after mean removal, and sum of absolute variances after mean removal.

[0542] Sort by displacement vector type, the displacement vector types include at least: block vector, string vector, motion vector, and default vector;

[0543] The displacement vectors are sorted according to their type and the cost of each vector.

[0544] In one possible implementation, processor 1101 determines the target displacement vector from a list of candidate displacement vectors, including any of the following methods:

[0545] The Kth displacement vector in the candidate displacement vector list is taken as the target displacement vector, where K is a positive integer;

[0546] The target displacement vector is determined from the list of candidate displacement vectors according to the displacement vector index;

[0547] The candidate displacement vector is obtained from the candidate displacement vector list, scaled according to the color format sampling ratio, and the integer pixel precision of the scaled displacement vector is retained to obtain the target displacement vector.

[0548] Retrieve candidate displacement vectors from the list of candidate displacement vectors and use them as target displacement vectors.

[0549] In one possible implementation, processor 1101 determines the predicted value of the current chroma block based on the target displacement vector, for performing the following operations:

[0550] If the target displacement vector has integer pixel precision, then motion compensation is performed on the target displacement vector to derive the predicted value of the current chroma block; or,

[0551] If the target displacement vector has pixel-level precision, then the target displacement vector is interpolated, and motion compensation is performed on the interpolated target displacement vector to derive the predicted value of the current chroma block.

[0552] In one possible implementation, the processing unit 902 is further configured to perform the following operations:

[0553] If there is no target displacement vector in the luma co-location block corresponding to the current chroma block, the intra-frame prediction mode is used to derive the predicted value of the current chroma block.

[0554] The intra-frame prediction modes include: cross-component intra-frame prediction modes or specified intra-frame prediction modes; cross-component intra-frame prediction modes include: cross-component two-step prediction mode and cross-component linear model prediction mode; specified intra-frame prediction modes include any one or more of the following: intra-frame prediction DC coefficient mode, intra-frame prediction bilinear prediction mode, intra-frame prediction planar prediction mode, horizontal intra-frame prediction mode, and vertical intra-frame prediction mode.

[0555] In one possible implementation, processor 1101 is also used to perform the following operations:

[0556] If the current chroma block adopts the chroma block copy intra-prediction mode, then based on the information of the target luminance sample in the luminance co-position block corresponding to the current chroma block, it is determined whether the current chroma block needs to be subjected to residual decoding. The target luminance sample is the luminance sample corresponding to the target displacement vector.

[0557] If it is determined that the current chroma block needs to be subjected to residual decoding, then residual decoding is performed on the current chroma block to obtain the residual value;

[0558] Based on the residual value and predicted value of the current chroma block, reconstruct the decoded image corresponding to the current chroma block.

[0559] In one possible implementation, the luma co-position block corresponding to the current chroma block contains multiple luma blocks; the condition for determining that the current chroma block does not need to undergo residual decoding includes any of the following:

[0560] If the target brightness sample point uses intra-frame string copy prediction normal string sub-mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0561] If the target brightness sample point adopts the intra-frame string copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0562] If the target brightness sample uses intra-block copy prediction mode, and the brightness block where the target brightness sample is located does not need to be residual encoded;

[0563] If the target brightness sample point adopts the intra-string copy prediction normal string mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0564] If the target brightness sample point adopts the intra-string copy prediction mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded;

[0565] The criterion for determining whether the luminance block containing the target luminance sample needs residual coding is based on: the coefficient flag of the luminance block or the prediction mode of the current chrominance block.

[0566] In another embodiment, the computer device 1100 can be the encoding device described above. In this embodiment, the processor 1101 performs the following operations by running program instructions in the memory 1104:

[0567] Determine the current chroma block in the video, and use the chroma block copy intra-prediction mode for the current chroma block;

[0568] Obtain the target displacement vector of the luminance co-position block corresponding to the current chrominance block;

[0569] Based on the target displacement vector, the predicted value of the current chroma block is determined; the predicted value is used to reconstruct the decoded image corresponding to the current chroma block.

[0570] The video is encoded based on the predicted values ​​of the current chroma blocks to generate a video stream.

[0571] In this embodiment, the current coding block in the video is determined, and the coding information of its neighboring coding blocks is also determined. Then, based on the coding information of the neighboring coding blocks, the transform information of the current coding block is determined. Based on the determined transform information, the current coding block is encoded. During video encoding, the transform information of the current coding block is determined directly based on the coding information of its neighboring coding blocks. This reduces the cost of encoding the transform information of the coding block at the encoding end, thereby reducing the bitrate consumption in the entire encoding and decoding process and improving encoding efficiency.

[0572] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When a processor executes these program instructions, it can execute the aforementioned... Figure 5 and Figure 9 The methods described in the corresponding embodiments are therefore not repeated here. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions may be deployed on a computer device, executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network.

[0573] According to one aspect of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, enabling the computer device to perform the methods described in the above embodiments; therefore, further details will not be provided here.

[0574] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0575] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A video processing method, characterized in that, include: Determine the current chroma block in the video bitstream, wherein the current chroma block adopts the chroma block copy intra-prediction mode; The chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode; or, the chroma block copy intra-prediction mode is a sub-mode of the normal intra-prediction mode; the normal intra-prediction mode includes at least one of the following: intra-prediction DC coefficient mode, angle-based intra-prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-reference pixel derived prediction value. Obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block; Based on the target displacement vector, determine the predicted value of the current chromaticity block; Based on the predicted value, the image corresponding to the current color block is reconstructed.

2. The method as described in claim 1, characterized in that, After determining the current chroma block in the video bitstream, the method further includes: The current chroma block is divided into P×Q chroma sub-blocks, where P and Q are both integers; Obtain the block vector of the corresponding luminance sub-block for each chroma sub-block; Based on the obtained P×Q block vectors, the predicted value of the current chroma block is determined.

3. The method as described in claim 1, characterized in that, The method further includes: Decode the video stream to obtain mode indication information, which is used to indicate whether the current chroma block adopts the chroma block copy intra-prediction mode. The mode indication information includes at least one of the following: sequence header flag, image header flag, slice header flag, coding unit flag, implicit information, and chroma indication information.

4. The method as described in claim 3, characterized in that, If the mode indication information is a sequence header flag, then the mode indication information is set in the sequence header of the current sequence to which the current chroma block belongs; when the sequence header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the sequence header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode. If the mode indication information is an image header flag, then the mode indication information is set in the image header of the current image to which the current chroma block belongs; when the image header flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the image header flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode. If the mode indication information is a title block flag, then the mode indication information is set in the title block of the current slice to which the current chroma block belongs; when the title block flag is a first preset value, it indicates that the current chroma block is allowed to use the chroma block copy intra-prediction mode; when the title block flag is a second preset value, it indicates that the current chroma block is not using the chroma block copy intra-prediction mode. If the mode indication information is a coding unit flag, then the mode indication information is set in the current coding unit to which the current chroma block belongs; When the coding unit flag is a first preset value, it indicates that the current chroma block adopts the chroma block copy intra-prediction mode; when the coding unit flag is a second preset value, it indicates that the current chroma block does not adopt the chroma block copy intra-prediction mode. If the mode indication information is implicit information, then when the implicit information indicates that the luminance sample point at a preset position in the luminance co-position block corresponding to the current chroma block meets the preset condition, the current chroma block is instructed to adopt the chroma block copy intra-prediction mode. If the mode indication information is chroma indication information, then when the chroma indication information indicates that the current chroma block adopts a preset intra-prediction mode, and the luminance sample at a preset position in the luminance co-position block meets the preset condition, the current chroma block is indicated to adopt the chroma block copy intra-prediction mode. The preset intra-frame prediction mode includes an inheritance mode.

5. The method as described in claim 3 or 4, characterized in that, The method further includes: Check whether the video stream meets the decoding conditions; If the video stream meets the decoding conditions, then the step of decoding the video stream to obtain mode indication information is performed.

6. The method as described in claim 5, characterized in that, The decoding conditions include: the color format used by the video stream is a format that includes chroma components; When the mode indication information is set in the current coding unit to which the current chroma block belongs, the decoding conditions include any one or more of the following: The current encoding unit contains only chroma components; The luminance sample point at the preset position in the luminance co-position block corresponding to the current chroma block satisfies the preset condition. If there are multiple preset positions, then the number of brightness samples that meet the preset conditions is at least one, or greater than or equal to a preset threshold.

7. The method as described in claim 6, characterized in that, The method for determining the preset position includes any of the following: A preset chromaticity sample point is determined in the current chromaticity block, and a preset position of the corresponding luminance sample point in the luminance co-position block is determined based on the position of the preset chromaticity sample point. Determine a preset position from the brightness co-position block; According to the division method of the luminance co-position block, a preset position is determined in each sub-block obtained by dividing the luminance co-position block; The brightness co-position block is divided into M×N sub-blocks, and a specified position in the M×N sub-blocks is used as a preset position. The specified position includes any one of the following: the center, upper left corner, upper right corner, lower left corner, and lower right corner of the sub-block, where M and N are both positive integers.

8. The method as described in claim 6, characterized in that, The preset conditions include any one or more of the following: The brightness samples adopt any one of the modes in a specific mode set, which includes: intra-block copy prediction mode, intra-string copy prediction normal string mode, intra-string copy prediction non-normal string mode, or any one or more prediction modes with intra-frame displacement vector. The brightness samples have valid displacement vectors; The intra-frame prediction history motion information table for the current chroma block is not empty.

9. The method as described in claim 1, characterized in that, The step of obtaining the target displacement vector of the luminance co-position block corresponding to the current chroma block includes: Construct a candidate displacement vector list for the luminance co-position block corresponding to the current chroma block; The target displacement vector is determined from the list of candidate displacement vectors.

10. The method as described in claim 9, characterized in that, The process of constructing the candidate shift vector list for the luminance co-position block corresponding to the current chroma block includes one or more of the following methods: Add the displacement vectors of the luminance samples that satisfy the specified mode in the luminance co-position block to the candidate displacement vector list. The specified mode includes any one of the following: intra-block copy prediction mode, intra-string copy prediction normal string mode, string copy intra-prediction non-normal string mode, intra-template matching mode, inter-frame prediction mode, affine motion mode, inter-frame composite mode, and angle-weighted prediction mode. Add the displacement vector of the spatial adjacent block corresponding to the brightness co-position block to the candidate displacement vector list; Add the displacement vectors from the historical motion information table or the intra-frame predicted historical motion information table to the candidate displacement vector list; The candidate displacement vectors are added to the candidate displacement vector list after being offset. The candidate displacement vectors include any one or more of the following: the displacement vector of the luminance sample point that satisfies the specified mode in the luminance co-position block, the displacement vector of the spatial adjacent block corresponding to the luminance co-position block, and the displacement vector of the spatial adjacent block corresponding to the luminance co-position block. If there is no valid displacement vector in the brightness co-location block, the default displacement vector is added to the candidate displacement vector list; or, the displacement vector in the candidate displacement vector list is set to an invalid value.

11. The method as described in claim 9 or 10, characterized in that, The displacement vectors in the candidate displacement vector list must satisfy at least one of the following conditions: The reference block of the luminance co-position block satisfies the reference range limitation of the intra-block copy prediction mode; The reference block of the brightness co-position block and the displacement vector both satisfy the reference range limitation of the intra-string copy prediction normal string sub-mode. The displacement vector is not repeated with any other displacement vector outside the candidate displacement vector list; The displacement vector is not repeated with the first N or last N displacement vectors in the candidate displacement vector list, where N is an integer.

12. The method as described in claim 11, characterized in that, The sorting method for each displacement vector in the candidate displacement vector list includes any of the following: Arranged in a predetermined order; The costs are ordered according to the cost of each displacement vector, and the costs include at least one of the following: rate distortion cost, sum of absolute errors, sum of absolute errors after transformation, sum of squared differences, sum of absolute errors after mean removal, and sum of absolute variances after mean removal. Sorted according to the type of displacement vector, the type of displacement vector includes at least one of: block vector, string vector, motion vector, and default vector; The displacement vectors are sorted according to their type and the cost of each vector.

13. The method as described in claim 9, characterized in that, The determination of the target displacement vector from the candidate displacement vector list includes any of the following methods: The Kth displacement vector in the candidate displacement vector list is taken as the target displacement vector, where K is a positive integer; The target displacement vector is determined from the list of candidate displacement vectors according to the displacement vector index; Candidate displacement vectors are obtained from the candidate displacement vector list, and the candidate displacement vectors are scaled according to the color format sampling ratio, while retaining the integer pixel precision of the scaled displacement vectors, to obtain the target displacement vector. Candidate displacement vectors are obtained from the list of candidate displacement vectors, and the candidate displacement vectors are used as the target displacement vectors.

14. The method as described in claim 1, characterized in that, The method further includes: If there is no target displacement vector in the luminance co-position block corresponding to the current chroma block, then the predicted value of the current chroma block is derived using the intra-frame prediction mode. The intra-frame prediction mode includes: cross-component intra-frame prediction mode or a specified intra-frame prediction mode; the cross-component intra-frame prediction mode includes any one or more of the following: cross-component two-step prediction mode and cross-component linear model prediction mode; the specified intra-frame prediction mode includes any one or more of the following: intra-frame prediction DC coefficient mode, intra-frame prediction bilinear prediction mode, intra-frame prediction planar prediction mode, horizontal intra-frame prediction mode, and vertical intra-frame prediction mode.

15. The method as described in claim 1, characterized in that, The method further includes: If the current chroma block adopts the chroma block copy intra-prediction mode, then based on the information of the target luminance sample in the luminance co-position block corresponding to the current chroma block, it is determined whether the current chroma block needs to be subjected to residual decoding, and the target luminance sample is the luminance sample corresponding to the target displacement vector; If it is determined that the current chroma block needs to be subjected to residual decoding, then residual decoding is performed on the current chroma block to obtain the residual value; Based on the residual value and predicted value of the current chroma block, the decoded image corresponding to the current chroma block is reconstructed.

16. The method as described in claim 15, characterized in that, The luminance parity block corresponding to the current chroma block contains multiple luminance blocks; the judgment condition that the current chroma block does not need to be subjected to residual decoding includes any of the following: If the target brightness sample point adopts the intra-frame string copy prediction normal string sub-mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded; If the target brightness sample point adopts the intra-frame string copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded; If the target luminance sample point adopts the intra-block copy prediction mode, and the luminance block where the target luminance sample point is located does not need to be residual encoded; If the target brightness sample point adopts the intra-frame string copy prediction normal string mode or the intra-frame block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded; If the target brightness sample point adopts the intra-string copy prediction mode or the intra-block copy prediction mode, and the brightness block where the target brightness sample point is located does not need to be residual encoded; The criterion for determining whether the luminance block containing the target luminance sample needs residual coding is based on: the coefficient flag of the luminance block or the prediction mode of the current chrominance block.

17. A video processing method, characterized in that, include: Determine the current chroma block in the video, wherein the current chroma block adopts the chroma block copy intra-prediction mode; The chroma block copy intra-prediction mode is a prediction mode independent of the normal intra-prediction mode; or, the chroma block copy intra-prediction mode is a sub-mode of the normal intra-prediction mode; the normal intra-prediction mode includes at least one of the following: intra-prediction DC coefficient mode, angle-based intra-prediction mode, cross-component two-step prediction mode, and prediction mode based on intra-reference pixel derived prediction value. Obtain the target displacement vector of the luminance co-position block corresponding to the current chroma block; Based on the target displacement vector, determine the predicted value of the current chromaticity block; The video is encoded based on the predicted value of the current chroma block to generate a video stream.

18. A computer device, characterized in that, include: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, performs the video processing method as described in any one of claims 1-17.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the video processing method as described in any one of claims 1-17.

20. A computer program product, characterized in that, The computer program product includes 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 the processor executing the computer instructions to cause the computer device to perform the video processing method as described in any one of claims 1-17.