Video processing method, video processing device, computer equipment, and computer program
Adaptive weight selection based on the importance of reference prediction values addresses low prediction accuracy in video coding standards, enhancing prediction accuracy and coding performance.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2023-07-07
- Publication Date
- 2026-06-30
Smart Images

Figure 0007882980000004 
Figure 0007882980000005 
Figure 0007882980000006
Abstract
Description
[Technical Field]
[0001] This application claims priority based on Chinese patent application No. 2022112305931, filed with the China National Intellectual Property Office on September 30, 2022, with the title of the invention "Video Processing Method and Related Equipment," and all of its contents are incorporated into this application by reference. This application relates to the field of audio and video, more specifically to the field of video encoding, and in particular to video processing methods, video processing devices, computer equipment, computer-readable storage media, and computer program products. [Background technology]
[0002] Conventional video coding techniques employ a block-based hybrid coding framework, dividing the original video data into a series of coding units (CUs). Compression of video data is achieved by combining video coding methods such as prediction, transformation, and entropy coding. To achieve better prediction performance, current mainstream video coding standards, such as AV1 (the first-generation video coding standard developed by the Open Media Alliance, Alliance for Open Media Video 1) and the developing Open Media Alliance (AOM) next-generation standard AV2 (the next-generation video coding standard developed by the Open Media Alliance, Alliance for Open Media Video 2), include a prediction mode called compound prediction. This compound prediction mode allows the use of multiple types of reference video signals for weighted prediction. However, practical experience shows that current compound prediction does not have high prediction accuracy during weighted prediction, impacting the performance of video coding and decoding. [Overview of the Initiative] [Problems that the invention aims to solve]
[0003] The various embodiments provided in this application provide a video processing method and related equipment. [Means for solving the problem]
[0004] According to one embodiment of the present application, a video processing method is provided that is performed by a computer device. This method is A step of obtaining N reference prediction values (N is an integer greater than 1) of the current block by performing a composite prediction of the current block in a video bitstream, wherein the current block is an encoded block in the video bitstream that is to be decoded, the N reference prediction values are derived from N reference blocks of the current block, the N reference blocks are encoded blocks in the video bitstream that are referenced when the current block is decoded, and there is a one-to-one correspondence between the reference prediction values and the reference blocks; a step of determining a target weight group for weighted prediction of the current block based on the importance of the N reference prediction values, the target weight group includes one or more weight values, the importance of which represents the degree to which each reference prediction value influences the decoding performance of the current block; and a step of obtaining a prediction value of the current block by performing a weighted prediction process of the N reference prediction values based on the weight values in the target weight group, the prediction value of the current block is for reconstructing the decoded image corresponding to the current block.
[0005] According to one embodiment of the present application, a video processing method is provided that is performed by a computer device. This method is The process includes: obtaining the current block by splitting the current frame in the video; obtaining N reference prediction values (N is an integer greater than 1) of the current block by performing a composite prediction of the current block, wherein the N reference prediction values are derived from N reference blocks of the current block, and the N reference blocks are coding blocks in the video that are referenced when coding the current block, and there is a one-to-one correspondence between the reference prediction values and the reference blocks; determining a target weight group for weighted prediction for the current block based on the importance of the N reference prediction values, wherein the target weight group contains one or more weight values, and the importance represents the degree to which each reference prediction value influences the coding performance of the current block; obtaining a prediction value of the current block by performing a weighted prediction of the N reference prediction values based on the weight values in the target weight group, wherein the prediction value of the current block is for reconstructing the decoded image corresponding to the current block; and generating a video bitstream by coding the video based on the prediction value of the current block.
[0006] According to one embodiment of the present invention, a video processing device is provided. This device is A processing unit that obtains N reference prediction values (N is an integer greater than 1) of the current block by performing composite prediction of the current block in a video bitstream, wherein the current block is an encoded block in the video bitstream that is subject to decoding, the N reference prediction values are derived from N reference blocks of the current block, the N reference blocks are encoded blocks in the video bitstream that are referenced when decoding the current block, and there is a one-to-one correspondence between the reference prediction values and the reference blocks; and a decision unit that determines a target weight group for weighted prediction for the current block based on the importance of the N reference prediction values, the target weight group contains one or more weight values, and the importance represents the degree to which each reference prediction value influences the decoding performance of the current block, and the processing unit further obtains a prediction value of the current block by performing weighted prediction processing of the N reference prediction values based on the weight values in the target weight group, and the prediction value of the current block is for reconstructing the decoded image corresponding to the current block.
[0007] According to one embodiment of the present invention, a video processing device is provided. This device is A processing unit obtains the current block by splitting the current frame in a video, and further obtains N reference prediction values (N is an integer greater than 1) of the current block by performing composite prediction of the current block, wherein the N reference prediction values are derived from N reference blocks of the current block, and the N reference blocks are encoded blocks in the video that are referenced when encoding the current block, and there is a one-to-one correspondence between the reference prediction values and the reference blocks; and a decision unit determines a target weight group for weighted prediction for the current block based on the importance of the N reference prediction values, wherein the target weight group contains one or more weight values, and the importance represents the degree to which each reference prediction value influences the encoding performance of the current block, and the processing unit further obtains a prediction value of the current block by performing weighted prediction of the N reference prediction values based on the weight values in the target weight group, the prediction value of the current block is for reconstructing the decoded image corresponding to the current block, and the processing unit further generates a video bitstream by encoding the video based on the prediction value of the current block.
[0008] According to one embodiment of the present application, a computer device is provided. This computer device is The system comprises a processor suitable for executing computer-readable instructions, and a computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, realize the video processing method described above.
[0009] In one embodiment of the present invention, a computer-readable storage medium storing computer-readable instructions is provided. These computer-readable instructions are loaded by a processor and cause it to execute the video processing method described above.
[0010] In one embodiment of the present invention, a computer program product including computer-readable instructions is further provided. The computer-readable instructions are stored in a computer-readable storage medium. The processor of a computer device reads the computer-readable instructions from the computer-readable storage medium, and when the processor executes the computer-readable instructions, causes the computer device to execute the video processing method described above.
[0011] Details of one or more embodiments of the present application are described in the following drawings and description. Other features, purposes, and advantages of the present application will become apparent from the specification, drawings, and claims. [Brief explanation of the drawing]
[0012] To more clearly describe the embodiments of the present application or the configuration of the prior art, the following is a brief introduction of the drawings necessary for describing the embodiments or the prior art. Clearly, the drawings in the following description only show some embodiments of the present application, and those skilled in the art can obtain other drawings from these without any creative work. [Figure 1a] This is a basic operation flowchart of video encoding provided in one exemplary embodiment of the present application. [Figure 1b] This is a schematic diagram of interpretation provided in one exemplary embodiment of the present application. [Figure 2] This is a schematic diagram of the configuration of a video processing system provided in one exemplary embodiment of the present application. [Figure 3] This is a schematic diagram of the flow of a video processing method provided in one exemplary embodiment of the present application. [Figure 4] This is a schematic diagram of the flow of a video processing method provided in other exemplary embodiments of the present application. [Figure 5] This is a schematic diagram of the configuration of a video processing device provided in one exemplary embodiment of the present application. [Figure 6] This is a schematic diagram of the configuration of a video processing device provided in other exemplary embodiments of the present application. [Figure 7]It is a schematic diagram of the configuration of a computer device provided in one exemplary embodiment of the present application.
Embodiments for Carrying Out the Invention
[0013] Hereinafter, while referring to the drawings of the embodiments of the present application, the configuration of the embodiments of the present application will be clearly and completely described. As is clear, the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments obtained by those skilled in the art from the embodiments of the present application without creative labor belong to the protection scope of the present application.
[0014] Hereinafter, technical terms related to the present application will be introduced.
[0015] I. Video Encoding
[0016] Video can be composed of one or more video frames, and each video frame contains a part of the video signal of the video. The acquisition methods of video signals can be divided into two types: the method of shooting with a camera and the method of generating with a computer. Since the statistical characteristics corresponding to different acquisition methods are different, the compression encoding method of video may also be different.
[0017] In mainstream video coding technologies, hybrid coding frameworks are used, such as High Efficiency Video Coding (HEVC / H.265), Versatile Video Coding (VVC / H.266), AV1 (Alliance for Open Media Video 1), AV2 (Alliance for Open Media Video 2), and AVS3 (Audio Video Coding Standard 3). These hybrid coding frameworks allow the following series of operations and processes to be performed on video.
[0018] 1) Block partition structure: Based on the size of the input current frame (i.e., the video frame being encoded or decoded), the current frame can be divided into several non-overlapping processing units, and a similar compression operation is performed on each processing unit. This processing unit is called a coding tree unit (CTU) or Largest Coding Unit (LCU). Further subdivision downwards from the CTU can yield one or more basic coding units called coding units or coding blocks (CU). Each CU is the most fundamental element of the encoding process. Various encoding and decoding processing flows that can be used for each CU are described in the following embodiments of this application.
[0019] 2) Predictive coding: This includes modes such as intra-prediction and inter-prediction. The original video signal contained in the current CU (i.e., the CU being coded or decoded in the current frame) is predicted using the reconstructed video signal in the selected reference CU, and the residual video signal is obtained. Here, the current CU is also called the current block, the video frame in which the current block is located is called the current frame, the reference CU used to predict the current block is also called the reference block of the current block, and the video frame in which the reference block is located is called the reference frame. Here, the coding side needs to decide to select the most appropriate one from among many possible predictive coding modes for the current CU and inform the decoding side of this decision. Here, the predictive coding modes may include the following:
[0020] a. Intra (picture) Prediction: The reconstructed video signal used for prediction is from an encoded and reconstructed region within the same video frame, i.e., the current block and the reference block are located within the same video frame. The basic idea of intra prediction is to eliminate spatial redundancy by utilizing the correlation of neighboring pixels within the same video frame. In video encoding, neighboring pixels refer to the reconstructed pixels of an encoded CU around the current CU within the same video frame.
[0021] b. Inter(picture) Prediction: The reconstructed video signal used for prediction is from another encoded video frame different from the current frame, i.e., the current block and the reference block are located in different video frames.
[0022] 3) Transform & Quantization: The residual video signal can be transformed into the transformation domain by transformation operations called transformation coefficients, such as the Discrete Fourier Transform (DFT) and the Discrete Cosine Transform (DCT). The residual video signal in the transformation domain undergoes further irreversible quantization, resulting in the loss of certain information, and the quantized signal becomes more favorable for compressed representation.
[0023] Some video encoding standards offer multiple conversion methods to choose from. Therefore, the encoding side must currently inform the CU (Computer Unit) of one of these conversion methods and the decoding side. The fineness of quantization is usually determined by the quantization parameters (QP). A large QP value indicates that conversion coefficients within a larger range are quantized as the same output, typically resulting in greater distortion and a lower bitrate. Conversely, a small QP value indicates that conversion coefficients within a smaller range are quantized as the same output, typically resulting in less distortion and supporting a higher bitrate.
[0024] 4) Entropy Coding or Statistical Coding: Statistical compression coding is performed on the quantized transformation domain signal according to the frequency of occurrence of each value, ultimately outputting a binarized (0 or 1) video bitstream. Coding also generates other information, such as the selected predictive coding mode and motion vectors. Entropy coding is also necessary for this other information to reduce the bitrate. Statistical coding is a lossless coding method that can effectively reduce the bitrate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) and Content Adaptive Binary Arithmetic Coding (CABAC).
[0025] 5) Loop Filtering: By performing inverse quantization, inverse transform, and prediction compensation operations (the reverse operations of 2) to 4) above) on the encoded CU, a decoded image corresponding to the CU can be reconstructed. The reconstructed decoded image, compared to the original image, has the effect of quantization, so some information differs from the original image and distortion occurs. Therefore, by performing a filtering operation on the reconstructed decoded image, the degree of distortion caused by quantization can be effectively reduced. The filter may be, for example, deblocking, sample adaptive offset (SAO), or adaptive loop filtering (ALF). Since these filtered reconstructed decoded images are used as reference CUs for other CUs that subsequently require encoding, the filtering operations described above are loop filtering, In other words This is also called a filtering operation within an encoding loop.
[0026] Based on the related explanations of steps 1) to 5) above, the embodiments of the present application provide a basic operation flowchart of a video encoder. Refer to Figure 1a. Figure 1a is an illustrative basic operation flowchart of a video encoder. Here, in Figure 1a, the current block is the kth CU (shown in Figure 1a) in the current frame (current image). k Let's explain using the case [x,y]) as an example. k is a positive integer less than or equal to the total number of CUs currently contained in the frame. k [x,y] represents a pixel point (abbreviated as a pixel) in the k-th CU whose coordinates are [x,y], where x is the horizontal coordinate of the pixel and y is the vertical coordinate of the pixel. k After performing motion compensation and intra-prediction on [x,y], a predicted signal is obtained, and the predicted signal
number
[0027] A: Alternatively, the output data from the quantization process can be sent to an entropy encoder to perform entropy encoding, thereby obtaining an encoded bitstream (i.e., a video bitstream). This bitstream can then be output to a buffer for storage and awaited for transmission.
number
[0028] In several implementations, mainstream video coding standards such as HEVC, VVC, AVS3, AV1, and AV2 all employ a block-based hybrid coding framework, dividing the original video data into a series of coded blocks and achieving video data compression by combining video coding methods such as prediction, transformation, and entropy coding. Here, motion compensation is a prediction method commonly used in video coding. Motion compensation derives a predicted value for the current block from a coded reference block based on the redundancy characteristics of the video content in the time domain or spatial domain. Such prediction methods include interpretation, intrablock copy prediction, and intrastring copy prediction. In specific coding implementations, these prediction methods can be used individually or in combination. For coded blocks using these prediction methods, it is usually necessary to explicitly or implicitly encode one or more two-dimensional displacement vectors in the video bitstream that indicate the displacement of the current block (or a block at the same position as the current block) relative to one or more reference blocks.
[0029] It should be noted that displacement vectors may have different names in different prediction modes and different realizations. In this specification, they are uniformly described as follows. That is, 1) the displacement vector in inter-prediction is called a motion vector (abbreviated as MV), 2) the displacement vector in intra-block copy prediction is called a block vector (abbreviated as BV), and 3) the displacement vector in intra-string copy prediction is called a string vector (abbreviated as SV). In the following, the related technologies of inter-prediction will be introduced taking inter-prediction as an example.
[0030] Inter-prediction: Inter-prediction utilizes the correlation in the temporal domain of a video, predicts the pixels of the current image by using the pixels of adjacent encoded images, thereby achieving the purpose of effectively removing the redundancy in the temporal domain of the video and being able to efficiently save the bits of the encoded residual data. As shown in Figure 1b, Figure 1b is a schematic diagram of inter-prediction provided in an embodiment of the present application. Here, in Figure 1b, 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 positions in the image (that is, B' is the block at the same position as B), the coordinates of Br are (x r , y r ), and the coordinates of B' are (x, y). The displacement between the current block and its reference block is called a motion vector (MV), that is, MV = (x r - x, y r - y).
[0031] Here, considering that neighboring blocks in the time or spatial domain have a strong correlation, MV prediction techniques can be used to further reduce the bits required to encode MVs. H.265 / HEVC includes two MV prediction techniques in interpretation: Merge and Advanced Motion Vector Prediction (AMVP). In Merge mode, an MV candidate list is created for the current prediction unit (PU), containing five candidate MVs (and their corresponding reference images). These five candidate MVs are scanned, and the one with the minimum rate distortion cost is selected as the optimal MV. If the encoder and decoder create the candidate list in the same way, the encoder only needs to transmit the index of the optimal MV in the candidate list. AV1 and AV2 use a technique called Dynamic Motion Vector Prediction (DMVP) to predict MVs.
[0032] To achieve better prediction effectiveness, current mainstream video coding standards all allow the use of multiple reference frames for inter-prediction. The AV1 standard and the currently developing AOM next-generation standard AV2 include a prediction mode called compound prediction. In this compound prediction mode, it is permitted to perform inter-prediction on the current block using two reference frames and derive the predicted value of the current block by a weighted combination of the inter-prediction values, or to derive the predicted value of the current block by a weighted combination of the inter-prediction value derived using one reference frame and the intra-prediction value derived using the current frame. Here, the current block refers to the coded block being coded (or decoded). In the embodiments of this application, both the inter-prediction value and the intra-prediction value are referred to as reference prediction values below. The following is a formula for deriving the predicted value of the current block during compound prediction.
[0033] P(x,y)=(w(x,y)·P0(x,y) + (1-w(x,y))·P1(x,y)) / 2 Here, P(x,y) is the predicted value of the current block, P0(x,y) and P1(x,y) are two reference predicted values corresponding to the current block (x,y), and w(x,y) is the weight used for the first reference predicted value P0(x,y).
[0034] Optionally, in video coding, integer calculations are typically used instead of floating-point calculations to reduce the complexity of weighted predictions. The following is a formula for deriving the predicted value of the current block using integer calculations.
[0035] P(x,y)=(w(x,y)×P0(x,y) + (64-w(x,y))×P1(x,y) + 32)>>6 Here, both the weight w(x,y) and the reference predicted values P0(x,y) and P1(x,y) are of integer type, and a right shift operation is used instead of division. ">>6" represents a 6-bit right shift, which divides 64, and 32 is the offset added for rounding.
[0036] According to current video encoding standards, a special weighting mode is used for composite prediction. That is, P0 and P1 have equal weight values, and the weights corresponding to the reference prediction values at different positions are all set to fixed values. The specific formula is as follows: P(x,y)=(32×P0(x,y) + 32×P1(x,y) + 32)>>6
[0037] 2. Video Decoding
[0038] On the decoding side, after acquiring the video bitstream for each CU, entropy decoding of the video bitstream is performed to obtain information on various predictive coding modes and quantized transformation coefficients. Then, inverse quantization and inverse transformation are performed on each transformation coefficient to obtain the residual video signal. On the other hand, based on the information of known predictive coding modes, a predicted signal (hereinafter referred to as the predicted value) corresponding to the CU can be obtained, and the reconstructed video signal is obtained by adding the residual video signal and the predicted signal. This reconstructed video signal can be used to reconstruct the decoded image corresponding to the CU. Finally, loop filtering must be performed on this reconstructed video signal to generate the final output signal.
[0039] Based on the above related explanation, embodiments of the present application provide a video processing method applicable to video encoders or video compression products using composite prediction (or weighted prediction based on multiple reference frames). The general principle of this video processing method is as follows:
[0040] Encoding side: By using composite prediction for CUs included in the video frame, N reference prediction values (N is an integer greater than 1) for the CU are obtained. Based on the importance of the N reference prediction values, appropriate weights are adaptively selected for the CU to perform weighted prediction, thereby obtaining the predicted value of the CU. Weighted prediction refers to the process of performing weighted prediction of the N reference prediction values of the CU using the adaptively selected weights. Next, a video bitstream is generated by encoding the video based on the predicted values of the CU, and this video bitstream is sent to the decoding side.
[0041] Decoding side: When decoding CUs in a video bitstream, it is decided to perform composite prediction of CUs in the video bitstream based on the information of the predictive coding mode. Based on the importance of N reference prediction values, appropriate weights are adaptively selected for the CUs to perform weighted prediction. Next, based on the adaptively selected weights, weighted predictions are performed on the N reference prediction values to obtain the predicted value of the CU, and the decoded image corresponding to the CU can be reconstructed using the predicted value of the CU.
[0042] As mentioned above, current video coding standards stipulate that in composite prediction, weighted predictions should be performed using equal weight values for reference prediction values derived from different reference blocks. However, in actual application, reference prediction values derived from different reference blocks may have unequal importance, and using equal weight values cannot represent the differences in importance of the reference prediction values. In this case, using the conventional standard will affect the prediction accuracy. The embodiment of the present application improves upon the current video coding standard, and in composite prediction, the importance of reference prediction values derived from different reference blocks is fully considered. In composite prediction, appropriate weights are adaptively selected for CUs based on the importance of each reference prediction value to perform weighted predictions. This extends the weighted prediction method in the video coding standard, improves the prediction accuracy of CUs, and enhances coding performance.
[0043] Next, the video processing system provided in the embodiment of the present application will be described. Refer to Figure 2. Figure 2 is a schematic diagram of the architecture of the video processing system provided in the embodiment of the present application. This video processing system 20 may include an encoding device 201 and a decoding device 202. The encoding device 201 is located on the encoding side, and the decoding device is located on the decoding side. The encoding device 201 may be a terminal or a server. The decoding device 202 may be a terminal or a server. A communication connection can be established between the encoding device 201 and the decoding device 202. Here, the terminal may be, but is not limited to, a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, in-vehicle terminal, smart TV, etc. The server may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and base cloud computing services such as big data and artificial intelligence platforms.
[0044] (1) Regarding encoding device 201
[0045] The encoding device 201 can acquire the video to be encoded, which can be acquired by capturing it with a recording device or by generating it with a computer. The recording device may be a hardware component provided within the encoding device 201. For example, the recording device may be a regular camera, a stereoscopic camera, or an optical field camera provided within a terminal. The recording device may also be a hardware device connected to the encoding device 201, such as a camera connected to a server.
[0046] Here, a single video contains one or more video frames, and the encoding device 201 can divide each video frame into one or more CUs and encode each CU. When encoding any CU, a composite prediction of the CU being encoded (hereinafter referred to as the current block) is performed to obtain N reference prediction values for the current block. The importance of each reference prediction value is determined by comprehensively considering factors such as the bitrate consumed in the weighted prediction process and the quality loss in encoding the current block. Furthermore, an appropriate target weight group can be adapted and selected for the current block based on the importance of each reference prediction value. This target weight group may contain one or more weight values. Next, the prediction value of the current block is obtained by performing a weighted prediction process on the N reference prediction values using the weight values in the target weight group. Here, the prediction value of the current block can be understood as a prediction signal corresponding to the current block. The prediction value of the current block can be used to reconstruct the decoded image corresponding to the current block.
[0047] Here, the N reference predicted values of the current block are derived from the N reference blocks of the current block. Each reference predicted value corresponds to one reference block. The video frame in which a reference block is located is the reference frame, and the video frame in which the current block is located is the current frame. The positional relationship between the N reference blocks and the current block may include, but is not limited to, any one of the following (1) to (4): (1) The N reference blocks are each located in N reference frames, and the N reference frames and the current frame belong to different video frames in the video bitstream. (2) The N reference blocks are located in the same reference frame, and the same reference frame and the current frame belong to different video frames in the video bitstream. (3) One or more of the N reference blocks are located in the current frame, and the remaining N reference blocks are located in one or more reference frames, and one or more of the reference frames and the current frame belong to different video frames in the video bitstream. (4) Both the N reference blocks and the current block are located in the current frame. As can be seen from here, the prediction modes of the composite prediction of the embodiments of the present application include the interprediction mode (i.e., at least two reference frames are permitted to be used for interprediction), the combined prediction mode (i.e., at least one reference frame is permitted to be used for interprediction, and the current frame is permitted to be used for intraprediction), and the intraprediction mode (i.e., the current frame is permitted to be used for intraprediction).
[0048] In response to different prediction modes of composite prediction, the derivation method for the N reference prediction values of the current block may include one of the following (1) or (2): (1) The N reference prediction values of the current block are derived by performing interpretation using each of the N reference blocks of the current block. In this case, any of the N reference prediction values can be called interpretation values. (2) At least one of the N reference prediction values of the current block is derived by performing interpretation using at least one of the N reference blocks of the current block. This portion of the reference prediction value can be called an interpretation value. The remaining reference prediction values are derived by performing intrapretation using the remaining reference blocks of the N reference blocks. This portion of the reference prediction value can be called an intrapretation value.
[0049] Next, the encoding device 201 obtains a video bitstream by performing operations such as transform coding, quantization, and entropy coding on the video based on the predicted values of CUs contained in the video frame, and transmits this video bitstream to the decoding device 202 so that the decoding device 202 can perform the decoding process of the video bitstream.
[0050] (2) Regarding the decryption device 202
[0051] After receiving the video bitstream transmitted from the encoding device 201, the decoding device 202 can decode the video bitstream to reconstruct the video corresponding to the video bitstream. Specifically, on the one hand, the decoding device 202 may perform entropy coding of the video bitstream to obtain the prediction mode and quantized transformation coefficients of each CU in the video bitstream, and then perform a composite prediction of the current block (i.e., the CU being decoded) based on the prediction mode of the current block to obtain N reference prediction values of the current block, and determine whether or not the use of adaptive weighted prediction is permitted for the current block.
[0052] If it is determined that adaptive weighted prediction is permitted for the current block, a target weight list may be determined from one or more weight lists based on the importance of the N reference prediction values, and a target weight group for weighted prediction for the current block may be determined from the target weight list. This target weight group contains one or more weight values. Next, the prediction value for the current block is obtained by directly performing weighted prediction on the N reference prediction values using the weight values in the target weight group. If it is determined that adaptive weighted prediction is not permitted for the current block, weighted prediction on the N reference prediction values may be performed according to conventional video coding standards. For example, the prediction value for the current block is obtained by performing weighted prediction on each reference prediction value using equal weight values.
[0053] On the other hand, the decoding device 202 obtains the residual signal value of the current block by performing inverse quantization and inverse transformation on the quantized conversion coefficients, obtains the reconstructed value of the current block by superimposing the predicted value and the residual signal value of the current block, and then reconstructs the decoded image corresponding to the current block based on the reconstructed value. Here, the decoded image may be used as a reference image for decoding other CUs, or it may be used for video reconstruction.
[0054] In the embodiments of this application, composite prediction is used for both video encoding and decoding, and in composite prediction, the importance of reference prediction values derived from different reference blocks is fully considered, and in composite prediction, appropriate weights are adaptively selected for CUs based on the importance of each reference prediction value to perform weighted prediction, extending the weighted prediction scheme in the video encoding standard, improving the prediction accuracy of CUs, and improving the performance of encoding and decoding.
[0055] Next, the video processing method provided in the embodiment of the present application will be described. Refer to Figure 3. Figure 3 is a schematic diagram of the flow of the video processing method provided in the embodiment of the present application. This video processing method may be performed by a decoding device in the video processing system described above. The video processing method in this embodiment may include the following steps S301 to S303.
[0056] In S301, a composite prediction of the current block in the video bitstream is performed to obtain N reference prediction values (where N is an integer greater than 1) of the current block. The current block refers to the encoded block being decoded in the video bitstream, and the N reference prediction values are derived from the N reference blocks of the current block. The N reference blocks are the encoded blocks referenced during the decoding of the current block in the video bitstream, and there is a one-to-one correspondence between the reference prediction values and the reference blocks.
[0057] A video bitstream contains one or more video frames, each of which may contain one or more encoded blocks. When decoding a video bitstream, the decoding device can obtain encoded blocks from the video bitstream, and the currently decoded encoded block may be the current block. The N reference prediction values may be derived from N reference blocks, with one reference prediction value corresponding to one reference block; that is, the N reference prediction values are obtained based on N reference blocks, with a one-to-one correspondence between reference prediction values and reference blocks, and the N reference blocks are encoded blocks in the video bitstream that are referenced when decoding the current block. In the embodiments of this application, the video frame in which a reference block is located may be a reference frame, and the video frame in which the current block is located is the current frame.
[0058] Here, the positional relationship between the N reference blocks and the current block includes one of the following (1) to (4): (1) The N reference blocks are each located in N reference frames, and the N reference frames and the current frame may belong to different video frames in the video bitstream. For example, if N=2, one of the two reference blocks is located in reference frame 1, and the other reference block is located in reference frame 2, and reference frame 1, reference frame 2, and the current frame belong to different video frames in the video bitstream. (2) The N reference blocks are located in the same reference frame, and the same reference frame and the current frame may belong to different video frames in the video bitstream. For example, if N=2, both of the two reference blocks are located in reference frame 1, and reference frame 1 and the current frame belong to different video frames in the video bitstream. (3) One or more of the N reference blocks are located in the current frame, the remaining N reference blocks are located in one or more reference frames, and one or more reference frames and the current frame belong to different video frames in the video bitstream. For example, if N=4, the four reference blocks are reference block 1, reference block 2, reference block 3, and reference block 4, respectively, with reference block 1 located in the current frame, and all of the remaining reference blocks 2, 3, and 4 located in reference frame 1, and reference frame 1 and the current frame belong to different video frames in the video bitstream. Alternatively, for example, reference blocks 1 and 2 may be located in the current frame, the remaining reference block 3 may be located in reference frame 1, reference block 4 may be located in reference frame 2, and reference frames 1, 2, and the current frame may belong to different video frames in the video bitstream. (4) All of the N reference blocks and the current block are located in the current frame, for example, if N=2, both of the two reference blocks are located in the current frame.
[0059] As can be seen from the positional relationship between the N reference blocks and the current block shown in (1) to (4) above, the prediction modes of the composite prediction in the embodiment of the present application include the interprediction mode (i.e., at least two reference frames are permitted to be used for interprediction), the combined prediction mode (i.e., at least one reference frame is permitted to be used for interprediction, and the current frame is permitted to be used for intraprediction), and the intraprediction mode (i.e., the current frame is permitted to be used for intraprediction).
[0060] In response to different prediction modes of composite prediction, the derivation method for the N reference prediction values of the current block may include one of the following (1) or (2): (1) The N reference prediction values of the current block are derived by performing interpretation using the N reference blocks of the current block. In this case, any of the N reference prediction values can be called interpretation values. (2) At least one of the N reference prediction values of the current block is derived by performing interpretation using at least one of the N reference blocks of the current block. This portion of the reference prediction value can be called an interpretation value. The remaining reference prediction values are derived by performing intrapretation using the remaining reference blocks of the N reference blocks. This portion of the reference prediction value can be called an intrapretation value. In this embodiment, the N reference blocks may be from different video frames, specifically from the current frame in which the current block is located, or from different reference frames, thereby enabling application to different composite prediction scenarios and ensuring the performance of encoding and decoding composite predictions in different scenarios.
[0061] In one embodiment, before executing step S302, the decoding device may first determine whether the current block satisfies the conditions for adaptive weighting prediction, that is, determine the conditions for adaptive weighting prediction, and if the current block satisfies the conditions for adaptive weighting prediction, execute step S302. By determining whether the current block satisfies the conditions for adaptive weighting prediction, the decoding device can perform weighting prediction by adaptively selecting weights, further improving prediction accuracy and enhancing coding performance.
[0062] Here, if the current block satisfies the conditions for adaptive weighted prediction, it includes at least one of the following a) to j).
[0063] a) The sequence header of the frame sequence to which the current block belongs contains a first instruction field, and the first instruction field indicates that adaptive weighting prediction is permitted for any of the encoded blocks in the frame sequence. Here, a frame sequence refers to a sequence of multiple video frames in a video bitstream. It should be understood that if the sequence header of a frame sequence contains a first instruction field, the first instruction field indicates that adaptive weighting prediction is permitted for all encoded blocks contained in the entire frame sequence.
[0064] As one implementation, the first indicator field can be represented as seq_acp_flag. The value of this first indicator field can indicate whether or not the use of adaptive weighting prediction is permitted for the encoded blocks in the frame sequence. If the first indicator field is a first predetermined value (e.g., 1), it indicates that the use of adaptive weighting prediction is permitted for all encoded blocks in the frame sequence, and it can be determined that the current block satisfies the adaptive weighting prediction conditions. If the first indicator field is a second predetermined value (e.g., 0), it indicates that the use of adaptive weighting prediction is not permitted for all encoded blocks in the frame sequence, and it can be determined that the current block does not satisfy the adaptive weighting prediction conditions.
[0065] b) The slice header of the current slice to which the current block belongs contains a second instruction field, and the second instruction field indicates that the use of adaptive weighted prediction is permitted for the coded block in the current slice. Here, a single video frame can be divided into multiple image slices, each image slice containing one or more coded blocks. The current slice refers to the image slice to which the current block belongs, i.e., the image slice being decoded. It should be understood that if the slice header of the current slice contains a second instruction field, this second instruction field can be used to indicate that the use of adaptive weighted prediction is permitted for all coded blocks contained in the current slice.
[0066] As one implementation, the second instruction field can be represented as slice_acp_flag. The value of this second instruction field can indicate whether or not the use of adaptive weighting prediction is permitted for the coded blocks in the current slice. If the second instruction field is a first predetermined value (e.g., 1), it indicates that the use of adaptive weighting prediction is permitted for all coded blocks in the current slice, and it can be determined that the current block satisfies the adaptive weighting prediction conditions. If the second instruction field is a second predetermined value (e.g., 0), it indicates that the use of adaptive weighting prediction is not permitted for all coded blocks in the current slice, and it can be determined that the current block does not satisfy the adaptive weighting prediction conditions.
[0067] c) The frame header of the current frame in which the current block is located contains a third instruction field, and the third instruction field indicates that the use of adaptive weighting prediction is permitted for the coded block in the current frame. It should be understood that if the frame header of the current frame contains a third instruction field, the third instruction field can be used to indicate that the use of adaptive weighting prediction is permitted for all coded blocks contained in the current frame.
[0068] As one implementation, the third instruction field can be represented as pic_acp_flag. The value of this third instruction field indicates whether or not the use of adaptive weighting prediction is permitted for the current frame. If the third instruction field is a first predetermined value (e.g., 1), it indicates that the use of adaptive weighting prediction is permitted for the encoded block in the current frame, and it can be determined that the current block satisfies the adaptive weighting prediction conditions. If the third instruction field is a second predetermined value (e.g., 0), it indicates that the use of adaptive weighting prediction is not permitted for the encoded block in the current frame, and it can be determined that the current block does not satisfy the adaptive weighting prediction conditions.
[0069] d) During composite prediction, at least two reference frames are used for interpretation for the current block.
[0070] e) During composite prediction, for the current block, at least one reference frame is used for interpretation and the current frame is used for intrapretation. For example, if for the current block, reference frame 1 is used for interpretation and the current frame is used for intrapretation, it can be determined that the current block satisfies the conditions for adaptive weighted prediction.
[0071] f) If the current block's motion type is the specified motion type, for example, if the current block's motion type is simple_translation (simple equilibrium), then it is determined that the current block satisfies the conditions for adaptive weighting prediction.
[0072] g) If a predetermined motion vector prediction mode is used for the current block, for example, if the predetermined motion vector prediction mode used for the current block is NEAR_NEARMV, then it can be determined that the current block satisfies the conditions for adaptive weighted prediction.
[0073] The AV1 and AV2 standards use a technique called Dynamic Motion Vector Prediction (DMVP) to predict Motion Values (MVs). MVs can be predicted using spatially adjacent blocks in the current frame or temporally adjacent blocks in the reference frame. In single-reference interpretation, each reference frame has its own separate predicted MV list. In composite interpretation, predictions are made for different reference frames. MV A list of predictive MV groups is formed from the list, and the use of multiple types of predictive MV modes, such as NEAR_NEARMV, NEAR_NEWMV, NEW_NEAR_MV, NEW_NEWMV, GLOBAL_GLOBALMV, JOINT_NEWMV, etc., is permitted.
[0074] NEAR_NEARMV: Indicates that the MV corresponding to the two reference frames is the MV in the predicted MV grape.
[0075] NEAR_NEWMV: The first MV is the first prediction in the prediction MV group. MV The second MV is derived from the decoded MVD in the video bitstream and the second predicted MV in the predicted MV group. Here, Motion Vector Difference (MVD) refers to the difference between the current MV and the predicted MV (MVP).
[0076] NEW_NEARMV: The first MV is derived from the decoded MVD in the video bitstream and the first predicted MV in the predicted MV group, and the second MV is the second predicted MV in the predicted MV group.
[0077] NEW_NEWMV: The first MV is derived from the decoded MVD1 in the video bitstream and the first predicted MV in the predicted MV group, and the second MV is derived from the decoded MVD2 in the video bitstream and the second predicted MV in the predicted MV group.
[0078] GLOBAL_GLOBALMV: Derives MV from global motion information at each frame level.
[0079] JOINT Similar to _NEWMV:NEW_NEWMV, but the video bitstream contains only one MVD, and other MVDs are derived from information between reference frames.
[0080] The predetermined motion vector prediction modes in the embodiments of this application are NEAR_NEARMV, NEAR_NEWMV, NEW_NEARMV, NEW_NEWMV, GLOBAL_GLOBALMV, JOINT_ NEWIt may be one or more of the MVs. Note that the predetermined motion vector prediction mode is not limited to the MV prediction mode described above, and in the case of other standards such as H.265 and H.266, the motion vector prediction mode may be determined by combining merge and AMVP.
[0081] h) A predetermined interpolation filter is applied to the current block. Video coding typically involves many coding tools, which include several types of interpolation filters, such as linear interpolation filters and cascaded integrator comb (CIC) interpolation filters. The predetermined interpolation filter in the embodiments of this application may be any one of these several types of interpolation filters. For example, the predetermined interpolation filter may be a linear interpolation filter. When a linear interpolation filter is applied to the current block, it can be determined that the current block satisfies the conditions for adaptive weighted prediction.
[0082] i) No specific encoding tool is used for the current block. For example, no optical flow-based motion vector optimization method is used for the current block. In this case, it can be determined that the current block satisfies the conditions for adaptive weighting prediction. Here, video encoding standards such as AV2 and H.266 allow the use of optical flow-based motion vector optimization methods. This method subdivides the motion vector based on the derivation of the optical flow equation.
[0083] j) If the reference frames used for the current block during composite prediction satisfy certain conditions, it can be determined that the current block satisfies the conditions for adaptive weighted prediction. Here, certain conditions include one or more of the following (i.e., certain conditions may include one or more of (1) and (2)): (1) The orientation relationship in the video bitstream between the reference frames used for composite prediction and the current frame satisfies a predetermined relationship. Here, the orientation relationship satisfies a predetermined relationship, which includes any one of the following: all of the reference frames used are located before the current frame; all of the reference frames used are located after the current frame; or some of the reference frames used are located before the current frame and the remaining reference frames are located after the current frame. A video bitstream contains multiple video frames, and any video frame corresponds to a frame display time in the video, and the orientation relationship can actually be understood as the chronological order of the frame display times. For example, all of the reference frames used being located before the current frame can be understood as the frame display time of the reference frames being earlier than the frame display time of the current frame. The fact that all the reference frames used are located after the current frame suggests that the frame display time of the reference frames is slower than the frame display time of the current frame.
[0084] (2) If the absolute value of the importance difference between the reference prediction values corresponding to the reference frames used in the composite prediction is greater than or equal to a predetermined threshold, it can be determined that the current block satisfies the conditions for adaptive weighted prediction. Here, the predetermined threshold can be set as needed. In one implementation, the importance of the reference prediction values corresponding to the reference frames can be measured by an importance metric value. In this case, the importance difference between the reference prediction values corresponding to the reference frames used in the composite prediction can be determined based on the importance metric value between the reference prediction values corresponding to the reference frames used. For example, if N=2, in the composite prediction, the two reference prediction values are reference prediction value 1 corresponding to reference frame 1 and reference prediction value 2 corresponding to reference frame 2, respectively. If the importance metric value of reference prediction value 1 is D0 and the importance metric value of reference prediction value 2 is D1, then the importance difference between the two reference prediction values corresponding to the two reference frames is the difference between the importance metric value D0 of reference prediction value 1 and the importance metric value D1 of reference prediction value 2, D0-D1. That is, the absolute value of the importance difference between the two reference prediction values is ΔD=abs(D0-D1), where abs() represents calculating the absolute value.
[0085] It should be understood that the conditions for adaptive weighted prediction that the current block satisfies, as described above, may be used individually or in combination. For example, if the current block satisfies the conditions for adaptive weighted prediction, this may include a first instruction field in the sequence header of the frame sequence to which the current block belongs, indicating that the use of adaptive weighted prediction is permitted for the encoded block in the frame sequence, and the motion type of the current block is a specified motion type. Alternatively, for example, the frame header of the current frame in which the current block is located may include a third instruction field, indicating that the use of adaptive weighted prediction is permitted for the encoded block in the current frame, and a predetermined motion vector prediction mode is used for the current block. However, this application is not limited in any way. This embodiment supports the decoding device in flexibly arranging each condition term of the adaptive weighted prediction conditions, applying them to different composite prediction scenarios, and ensuring the encoding and decoding performance of composite predictions in different scenarios.
[0086] In S302, a target weight group for weighted prediction is determined for the current block based on the importance of N reference prediction values, where importance represents the degree to which each reference prediction value influences the decoding performance of the current block.
[0087] The importance of a reference prediction may be determined comprehensively based on factors such as the bitrate consumed in the weighted prediction process and the quality loss in the current block encoding. For example, if performing weighted prediction using a certain reference prediction for the current block significantly increases bitrate consumption, it indicates that the contribution of this reference prediction to reducing bitrate consumption is not significant, and therefore its importance is low. Similarly, if performing weighted prediction using a certain reference prediction for the current block significantly increases quality loss, it indicates that the contribution of this reference prediction to reducing quality loss is small, and therefore its importance is low. Based on the importance of the reference prediction, the degree to which it influences the decoding performance of the current block can be determined. A target weight group contains one or more weight values, and these weight values act on each reference prediction in the weighted prediction. If a reference prediction has low importance, it corresponds to a small weight value in the target weight group; if a reference prediction has high importance, it corresponds to a large weight value in the target weight group. In other words, the target weight group is a group of weights selected after considering the impact of each reference prediction on factors such as bitrate consumption and quality loss, so that the overall cost of the weighted prediction (i.e., the cost of bitrate consumption, the cost of quality loss, and the cost of both bitrate consumption and quality loss) is small and the encoding / decoding performance is good.
[0088] In one embodiment, a video bitstream includes one or more weight lists, each weight list includes one or more weight groups, each weight group includes one or more weight values, the number of weight values in each weight group may be the same or different, the values of the weight values in each weight group may be the same or different, and the order of the weight values in each weight group may be the same or different. Below is an example of a weight list.
[0089] i. Weight list 1 is represented as {2,4,6,8,10,12,14} / 16. This means that weight list 1 contains seven weight groups, which are weight group 1: {2} / 16, weight group 2: {4} / 16, weight group 3: {6} / 16, ..., weight group 7: {14} / 16.
[0090] ii. Weight list 2 is represented as {14,8,4,12,2} / 16. This indicates that weight list 2 contains five weight groups, which are weight group 1: {14} / 16, weight group 2: {8} / 16, ..., weight group 5: {2} / 16, respectively.
[0091] iii. Weight list 3 is represented as {4,{8,8},12} / 16. This indicates that weight list 3 contains three weight groups: weight group 1:{4} / 16, weight group 2:{8,8} / 16, and weight group 3:{12} / 16, respectively.
[0092] As can be seen from the example above, (1) the number of weight groups in each weight list is allowed to be different, for example, the number of weight groups in weight list 1 is 7 and the number of weight groups in weight list 2 is 5, and weight list 3 The number of weight groups in is 3. (2) Each weight group may contain the same number of weight values, for example, each weight group in weight list 1 may contain 1 weight value. (3) Each weight group may contain a different number of weight values, for example, weight group 1 in weight list 3 may contain 1 weight value, but weight group 2 in weight list 3 may contain 2 weight values. (4) Each weight group may contain the same weight values, for example, weight group 1 in weight list 1 may contain weight value 2 / 16, and weight group 2 in weight list 2 may contain weight value 5This also includes the weight value 2 / 16. (5) It is also permitted that the weight values in each weight group are different, for example, weight group 1 in weight list 1 contains the weight value 2 / 16, but weight group 2 in weight list 1 contains the weight value 4 / 16. As can be seen, the sum of each weight value provided in one weight group should be equal to 1. In the example above, each weight group contains only one weight value, but since each weight value is less than 1, each weight group implicitly contains other weight values. That is, in a specific application, two weight values are actually provided for each weight group, and the sum of these two weight values is 1. For example, weight group 1 in weight list 1 contains only the weight value 2 / 16, but in a specific application, this weight group 1 provides a total of two weight values: weight 2 / 16 and weight 14 / 16. Furthermore, for example, weight group 3 in weight list 3 contains only the weight value 12 / 16, but in a specific application, this weight group 3 provides a total of two weight values: weight value 12 / 16 and weight value 4 / 16. As can be seen from this, in the embodiment of the present application, if the sum of each weight value included in a weight group in the weight list is less than 1, the implicit weight value of the weight group can be obtained by calculation.
[0093] The following is another example of a weight list.
[0094] i. Weight list 4 contains four weight groups, weight group 1: {2,14} / 16, weight group 2: {4,12} / 16, weight group 3: {6,10} / 16, and weight group 4: {8,8} / 16.
[0095] ii) Weight list 5 contains two weight groups, weight group 1: {4,12} / 16 and weight group 2: {10,6} / 16.
[0096] As can be seen from the example above, (1) the sum of all weight values in a weight group in a weight list is equal to 1. (2) The order of the weight values in each weight group can be different. For example, weight group 3 in weight list 4 and weight group 2 in weight list 5 may contain the same weight values, but in a different order.
[0097] In one embodiment, step S302 may include steps s31 to s32.
[0098] In step s31, a target weight list is determined from one or more weight lists based on the importance of N reference prediction values.
[0099] Here, the decoding device may determine a target weight list from one or more weight lists based on the importance of N reference prediction values, by combining the number of weight lists and the importance metric value of each reference prediction value. Specific implementations may include several methods, as described below.
[0100] Method 1: If there is only one weight list in the video bitstream, the decoding device may directly determine this single weight list in the video bitstream as the target weight list.
[0101] Method 2: If the video bitstream has multiple weight lists, the decoding device may introduce importance metric values for reference predictions and determine a target weight list from among the multiple weight lists based on the importance metric values of N reference predictions.
[0102] (1) Determine the target weight list based on the absolute difference between the importance metric values of N reference prediction values.
[0103] If the number of weight lists in a video bitstream is M+1 (where M is a positive integer greater than or equal to 1), then the weight lists of the M+1 groups can be written as {w_list1, w_list2, ... w_listM+1}, where each weight list corresponds to one threshold interval, and thus the number of threshold intervals is also M+1. In one implementation, the decoding device may directly set M+1 threshold intervals as needed. In another implementation, the decoding device may obtain M thresholds and divide M+1 threshold intervals based on these M thresholds. For example, if M thresholds are obtained, namely T1, T2, ..., TM, then the decoding device divides M+1 threshold intervals based on these M thresholds, namely [0, T1], (T1, T2], (T2, T3], ..., (TM, +∞). Here, [0, T1] may be associated with w_list1, (T1, T2) with w_list2, and so on by analogy. T is a non-negative integer.
[0104] The decoding device may obtain importance metric values for N reference prediction values and calculate the importance difference between the N reference prediction values. The importance difference between any two reference prediction values is measured by the difference between the importance metric values of any two reference prediction values. Next, the decoding device may determine a threshold interval in which the absolute value of the importance difference between the N reference prediction values lies, and determine a weight list corresponding to the threshold interval in which the absolute value of the importance difference between the N reference prediction values lies as the target weight list. Here, if the importance metric values of any two reference prediction values are D0 and D1, respectively, the importance difference between these two reference prediction values is expressed as D0-D1, and the absolute value of this importance difference between these two reference prediction values is expressed as ΔD=abs(D0-D1). Note that the importance metric value is an indicator for measuring the degree of importance, but there can be multiple criteria for measurement. For example, the criterion for measurement may be that a larger importance metric value indicates a higher degree of importance. Furthermore, for example, the criterion for measurement may be such that a smaller importance metric value indicates a higher degree of importance. This application does not limit the criterion for measurement.
[0105] In one embodiment, if N=2, i.e., only two reference prediction values are included, and the importance metric values of these two reference prediction values are D0 and D1, respectively, the decoding device directly determines the weight list corresponding to the threshold interval in which ΔD=abs(D0-D1) lies as the target weight list. For example, if the number of weight lists in the video bitstream is 2, these two weight lists are denoted as {w_list1, w_list2}, respectively. Here, w_list1 is {8,12,14} / 16 and w_list2 is {12,8,4} / 16. If the threshold interval corresponding to w_list1 is [0,1] and the threshold interval corresponding to w_list2 is (1,+∞), then if ΔD=abs(D0-D1) is less than or equal to 1, the threshold interval in which it is located is [0,1], so w_list1 is determined as the target weight list. Conversely, if ΔD=abs(D0-D1) is greater than 1, the threshold interval in which it is located is (1,+∞), so w_list2 is determined as the target weight list.
[0106] In another embodiment, if N > 2, the decoding device may calculate the absolute importance difference between any two reference prediction values, find the weight list corresponding to the threshold interval in which each absolute value lies, and determine the weight list with the most corresponding values as the target weight list. For example, if N = 3 and the importance metric values of the three reference prediction values are D0, D1, and D2, the decoding device may calculate the absolute importance difference between any two reference prediction values, i.e., ΔD = abs(D0 - D1), ΔD' = abs(D1 - D2), and ΔD'' = abs(D0 - D 2 The following parameters are calculated for each of ΔD, ΔD', and ΔD'': the weight lists corresponding to the threshold intervals in which each of them is located are determined, and if two or more of the three correspond to the same weight list, this same weight list may be decided as the target weight list.
[0107] In other embodiments, if N > 2, the decoding device may calculate the absolute value of the importance difference between any two reference prediction values, find the maximum value among these absolute values, and determine the weight list corresponding to the threshold interval in which the maximum value lies as the target weight list. For example, in the above example of N = 3, after calculating ΔD, ΔD', and ΔD'', the decoding device finds the maximum value among ΔD, ΔD', and ΔD'', and if the maximum value is ΔD', it determines the weight list corresponding to the threshold interval in which ΔD' lies as the target weight list.
[0108] In other embodiments, if N > 2, the decoding device may calculate the absolute value of the importance difference between any two reference prediction values, find the minimum of each absolute value, and determine the weight list corresponding to the threshold interval in which the minimum value is located as the target weight list. For example, in the above example of N = 3, after calculating ΔD, ΔD', and ΔD'', the decoding device finds the minimum of ΔD, ΔD', and ΔD'', and if the minimum value is ΔD, it determines the weight list corresponding to the threshold interval in which ΔD is located as the target weight list.
[0109] In other embodiments, if N > 2, the decoding device may calculate the absolute value of the importance difference between any two reference prediction values, calculate the average of each absolute value, and determine the weight list corresponding to the threshold interval in which the average value lies as the target weight list. For example, in the above example of N = 3, after calculating ΔD, ΔD', and ΔD'', the decoding device calculates the average of ΔD, ΔD', and ΔD'' = (ΔD + ΔD' + ΔD'') / 3, and determines the weight list corresponding to the threshold interval in which the average value lies as the target weight list.
[0110] In this embodiment, the target weight list may also be determined using other numerical properties of the absolute values of the importance differences between the N reference prediction values, such as the maximum, minimum, and average values of the squares of each absolute value. This invention is not limited to these properties. In this embodiment, the decoding device determines the target weight list by the threshold interval in which the differences between the importance metric values of the N reference prediction values are located. This makes it possible to determine weight values suitable for the reconstruction of the current block, which is advantageous for improving the prediction accuracy of the current block and improving the encoding and decoding performance.
[0111] (2) Determine the target weight list by comparing the magnitudes of the importance metric values of the reference prediction values.
[0112] The N reference prediction values in the current block may include a first reference prediction value and a second reference prediction value, and the video bitstream may include a first weight list and a second weight list. The decoding device compares the importance metric value of the first reference prediction value with the importance metric value of the second reference prediction value. If it determines that the importance metric value of the first reference prediction value is greater than the importance metric value of the second reference prediction value, it may determine the first weight list as the target weight list. If it determines that the importance metric value of the first reference prediction value is less than or equal to the importance metric value of the second reference prediction value, it may determine the second weight list as the target weight list.
[0113] For example, the importance metric value of the first reference prediction value is D0, the importance metric value of the second reference prediction value is D1, the first weight list is w_list1, and the second weight list is w_list2. The decoding device compares the magnitudes of D0 and D1. If D0 > D1, it determines the first weight list w_list1 as the target weight list. If D0 ≤ D1, it determines the second weight list w_list2. 2 The weight list w_list2 may be chosen as the target weight list.
[0114] Optionally, the weight values in the first weight list and the weight values in the second weight list are inverse, i.e., w_list2[x]=1-w_list1[x], where x represents the weight value in the weight list. For example, w_list1={0.2,0.4}, w_list2[x]=1-w_list1[x], i.e., w_list2[x]={0.8,0.6}. The sum of weight values in the same order in the first and second weight lists is 1. Alternatively, the weight values in the first weight list and the weight values in the second weight list may be set separately.
[0115] In this embodiment, the decoding device can improve the targeting accuracy of the target weight list by determining a corresponding weight list as the target weight list for the current block based on the relative magnitudes of the values between two reference predicted values. This is advantageous for improving the prediction accuracy of the current block and can improve the encoding and decoding performance.
[0116] (3) Determine the target weight list using the mathematical sign function and the importance metric value of the reference prediction.
[0117] The current block of N reference predictions includes a first reference prediction and a second reference prediction, and the video bitstream includes a first weight list, a second weight list, and a third weight list. The decoding device may obtain a sign value by calling a mathematical coding function and processing the difference between the importance metric value of the first reference prediction and the importance metric value of the second reference prediction. If the sign value is a first predetermined value (e.g., -1), the first weight list is determined as the target weight list; if the sign value is a second predetermined value (e.g., 0), the second weight list is determined as the target weight list; and if the sign value is a third predetermined value (e.g., 1), the third weight list is determined as the target weight list. Here, the first, second, and third weight lists are all different weight lists, or two of the three weight lists may be the same weight list.
[0118] Here, the importance metric value of the first reference forecast value is D0, and the importance metric value of the second reference forecast value is D1. mathematics The sign value is obtained by calling the sign function and processing the difference between D0 and D1. That is, the sign value = sign(D0-D1), and sign() is mathematics This represents the coding function. The decoding device can improve the targeting accuracy of the target weight list by determining a suitable weight list from among three weight lists as the target weight list for the current block based on the relative magnitudes of the values between two reference predicted values. This is advantageous for improving the prediction accuracy of the current block and can improve the encoding and decoding performance.
[0119] (4) The above methods (1), (2), and (3) may be used individually, or methods (1), (2), and (3) may be combined to determine the target weight list. As one implementation, if there are M+1 weight lists, for any two reference prediction values, the decoding device first determines a candidate weight list using method (1) based on the threshold interval in which the absolute value of the importance difference between these two reference prediction values lies, then compares the importance metric value of the first reference prediction value with the importance metric value of the second reference prediction value using method (2). If it is determined that the importance metric value of the first reference prediction value is greater than the importance metric value of the second reference prediction value, the candidate weight list is directly determined as the target weight list. If it is determined that the importance metric value of the first reference prediction value is less than or equal to the importance metric value of the second reference prediction value, the weight list corresponding to the weight values inversely to the weight values in the candidate weight list is determined as the target weight list.
[0120] For example, the importance metric value of the first reference forecast is D0, and the importance metric of the second reference forecast is... valueIf D0 is D1, the candidate weight list w_list1 can be determined by method (1). If D0 > D1, the decoding device determines the weight list w_list1 as the target weight list, and if D0 ≤ D1, the decoding device determines the weight list w_list2 as the target weight list, where the weight values in w_list2 are inversely related to the weight values in w_list1, i.e., w_list2[x] = 1 - w_list1[x].
[0121] Another implementation involves a video bitstream having 3*(M+1) weight lists, i.e., one threshold interval can correspond to three weight lists. For any two reference predictions, the decoding device first determines the threshold interval in which the absolute value of the importance difference between the first and second reference predictions lies, using method (1), and may determine any of the three weight lists corresponding to this threshold interval as a candidate weight list. That is, the candidate weight list may include the first weight list, the second weight list, and the third weight list. Next, the decoding device obtains a sign value by calling a mathematical coding function in method (2) and processing the difference between the importance metric value of the first reference prediction and the importance metric value of the second reference prediction. If the code value is a first predetermined value, the decoding device determines the first weight list as the target weight list; if the code value is a second predetermined value, the decoding device determines the second weight list as the target weight list; and if the code value is a third predetermined value, the decoding device determines the third weight list as the target weight list.
[0122] For example, in method (1), three weight lists {w_list1, w_list2, w_list3} are determined as candidate weight lists, and then the sign value is obtained by calling a mathematical coding function and processing the difference between the importance metric value of the first reference prediction and the importance metric value of the second reference prediction. If the sign value is -1, the decoding machine determines w_list1 as the target weight list; if the sign value is 0, the decoding machine determines w_list2 as the target weight list; and if the sign value is 1, the decoding machine determines w_list3 as the target weight list.
[0123] One of the N reference predictions is represented as reference prediction i (where i is an integer less than or equal to N), where reference prediction i is derived from reference block i, the video frame in which reference block i is located is reference frame i, the video frame in which the current block is located is the current frame, and the importance metric value of reference prediction i may be determined by one of the following methods:
[0124] Method 1: Calculation is performed based on the picture order count (POC) of the current frame in the video bitstream and the picture order count of reference frame i in the video bitstream. Specifically, the decoding device may calculate the difference between the picture order count of the current frame in the video bitstream and the picture order count of reference frame i in the video bitstream, and use the absolute value of this difference as the importance metric value of the reference predicted value i. For example, if the picture order count of the current frame in the video bitstream is represented as cur_poc and the picture order count of reference frame i in the video bitstream is ref_poc, then the importance metric value D of the reference predicted value i is D = abs(cur_poc - ref_poc), where abs() indicates calculating the absolute value.
[0125] Method 2: The calculation is performed based on the picture sequence count of the current frame in the video bitstream, the picture sequence count of reference frame i in the video bitstream, and a quality metric Q. Here, the quality metric Q may be determined by various means, but is not limited to this. Specifically, the quality metric Q of reference frame i may be derived from the quantization information of the current block. For example, the quality metric Q may be set as the base quantization index (base_qindex) of reference frame i. The base_qindex of any two reference frames may be different or the same. In other implementations, the quality metric Q of reference frame i may be derived from other encoding information. For example, the quality metric Q of reference frame i may be derived from the encoding information difference between the encoded CU in reference frame i and the encoded CU in the current frame.
[0126] As one implementation, the decoding device may calculate the difference between the picture sequence count of the current frame in the video bitstream and the picture sequence count of the reference frame i in the video bitstream, and then, using an objective function, determine the importance metric value of the reference predicted value i based on the above difference, quality metric Q, and importance metric value list.
[0127] Here, the objective function is D = f(cur_poc - ref_poc) + Q, where D represents the importance metric value of the reference predicted value i, f(x) is an increasing function, x = cur_poc - ref_poc, where cur_poc represents the picture order count of the current frame in the video bitstream, and ref_poc represents the picture order count of the reference frame i in the video bitstream. As shown in Table 1, the above list of importance metric values includes the correspondence between f(x) and the reference importance metric value.
[0128] [Table 1] The above-mentioned functional expression for f(x) is merely illustrative, and in the embodiments of this application, variations in the functional expression for f(x) are permitted; that is, the embodiments of this application do not limit the specific form of expression for f(x).
[0129] In one embodiment, the importance metric value of the reference frame i may be calculated based on the orientation relationship between the reference frame i and the current frame, and the quality metric Q. In one implementation, the decoding device may establish a correspondence between the reference orientation relationship and the reference importance metric value. For example, if the reference frame is located in front of the current frame in terms of the reference orientation relationship, the reference importance metric value may be associated with a first value, and if the reference frame is located behind the current frame in terms of the reference orientation relationship, the reference importance metric value may be associated with a second value. Next, the decoding device can calculate the importance metric value of the reference predicted value i based on the reference importance metric value and the quality metric Q corresponding to the reference frame i.
[0130] Method 3: Based on the calculation results of Method 1 and Method 2, calculate the importance metric score of reference frame i, order the importance metric scores of the reference frames corresponding to the N reference prediction values in ascending order, and determine the index of reference frame i in the ordering as the importance metric value of the reference prediction value i.
[0131] One implementation is to calculate the first importance metric value of the reference prediction value i by method 1 above, and the second importance metric value of the reference prediction value i by method 2 above. Next, the importance metric score (e.g., score) of the reference frame i is calculated based on the first and second importance metric values. Then, the importance metric scores of the reference frames corresponding to the N reference prediction values are ordered in ascending order, and the index of the reference frame i in the ordering is determined as the importance metric value of the reference prediction value i.
[0132] For example, the importance metric score of reference frame 1, which corresponds to reference prediction value 1, is 20; the importance metric score of reference frame 2, which corresponds to reference prediction value 2, is 30; and the importance metric score of reference frame 3, which corresponds to reference prediction value 3, is 40. Next, the importance metric scores of the reference frames corresponding to the three reference prediction values are ordered in ascending order, resulting in reference frame 1, reference frame 2, and reference frame 3. Here, since the index of reference frame 1 in the ordering is 1, the importance metric value of reference prediction value 1 is 1; since the index of reference frame 2 in the ordering is 2, the importance metric value of reference prediction value 2 is 2; and since the index of reference frame 3 in the ordering is 3, the importance metric value of reference prediction value 3 is 3.
[0133] Here, the importance metric score of reference frame i can be calculated based on the first importance metric value and the second importance metric value in the following ways: (1) Obtain the importance metric value of the reference predicted value i by performing a weighted addition of the first importance metric value and the second importance metric value. (2) Obtain the importance metric value of the reference predicted value i by performing an averaging process of the first importance metric value and the second importance metric value.
[0134] Method 4: To obtain an accurate importance metric value, the decoding device may obtain the importance metric value of the reference predicted value i by adjusting the calculation result of Method 1, Method 2, or Method 3 based on the prediction mode of the reference predicted value i. Here, the prediction mode of the reference predicted value i includes either an inter-prediction mode or an intra-prediction mode. As one implementation, the importance metric value of the reference predicted value i may be obtained by adjusting the calculation result of Method 1, Method 2, or Method 3 according to an adjustment function. The adjustment function may be, for example, D'=g(D)=a*D+b, where D' represents the importance metric value of the reference predicted value i, D is the calculation result of Method 1, Method 2, or Method 3 above, and a and b may be set according to the prediction mode. For example, three specific examples are shown below.
[0135] a) If the prediction mode of the reference prediction value i is interpretation, then a=1 and b=0.
[0136] b) If the prediction mode of the reference prediction value i is intraprediction, then a=2 and b=0.
[0137] c) If the prediction mode of the reference prediction value i is intraprediction, then a=0 and b=160.
[0138] It should be understood that, in practice, the importance metric value of the reference prediction may be determined using any one of the above methods 1 to 4, as needed. This application is not limited thereto. Decoding equipment can determine the importance metric value by various different methods, ensuring the reliability of the importance metric value, which is advantageous for improving the prediction accuracy of current blocks and improving the performance of encoding and decoding.
[0139] In step s32, a group of target weights for weighted prediction is selected from the target weight list.
[0140] Here, the selection of a target weight group by the decoding device from the target weight list can be divided into the following two cases:
[0141] (1) The number of weight groups included in the target weight list is equal to 1. In this case, there is no need to decode the index of the target weight group from the video bitstream, and the weight groups in the target weight list are directly used as the target weight group for weighted prediction.
[0142] (2) The number of weight groups included in the target weight list is greater than 1. That is, the target weight list includes a plurality of weight groups. For example, the target weight list is represented as {{2,14},{4,12},{6,10},{8,8}} / 16, and this target weight list includes 4 weight groups. In this case, the video bitstream can indicate the index of the target weight group at the time of weighted prediction of the current block, and for this index of the target weight group, an encoding method that performs binary encoding with a shortened unary code or a multi-symbol entropy encoding method is used. Here, for the shortened unary code, when the maximum value Max of the syntax element to be encoded is known, assuming that the symbol to be encoded is x, when 0 < x < Max, the unary code is used for the binary conversion of x, and when x = Max, the binary sequence obtained by binary-converting x consists of all 1s and has a length of Max. Next, the decoding device needs to decode the index of the target weight group for weighted prediction from the video bitstream and select the target weight group from the target weight list using the index of the target weight group. Here, the index of the target weight group can indicate the position in the target weight list. For example, the target weight list in the above example includes 4 weight groups, and the index of the target weight group decoded from the video bitstream by the decoding device is 2. Based on this index of the target weight group, the position in the target weight list, that is, the second position in the target weight list (i.e., weight group 2) is determined, and the determined target weight group is {4,12} / 16. The decoding device can determine the target weight group based on the index decoded from the video bitstream, identify the target weight group, improve the processing efficiency of the selection of the target weight group, and improve the decoding efficiency.
[0143] In this embodiment, the decoding device determines a target weight list based on the importance of N reference prediction values, selects a target weight group for weighted prediction from the target weight list, and by selecting an appropriate weight group from the weight list, it can decode and reconstruct the current block, thereby improving the prediction accuracy of the current block and improving the encoding and decoding performance.
[0144] In S303, the predicted value of the current block is obtained by performing a weighted prediction process on N reference predicted values based on the weight values in the target weight group. The predicted value of the current block is used to reconstruct the decoded image corresponding to the current block.
[0145] The number of weight values actually provided in the target weight group should correspond to the number of reference predictions. For example, if the number of reference predictions is N, then the number of weight values actually provided in the target weight group is also N. For example, if N=3, the three reference predictions are reference prediction 1, reference prediction 2, and reference prediction 3, and the target weight group may contain three weight values, weight 1, weight 2, and weight 3, respectively. Here, reference prediction 1 corresponds to weight 1, reference prediction 2 corresponds to weight 2, and reference prediction 3 corresponds to weight 3. In the above example, the target weight group may contain only two weight values, weight 1 and weight 2, respectively. The sum of weight 1 and weight 2 is less than 1. In this case, the implicit weight 3 in the target weight group can also be obtained by calculation: weight 3 = 1 - weight 1 - weight 2.
[0146] In one embodiment, there are two methods, (1) and (2), for obtaining the predicted value of the current block by performing weighted prediction processing on N reference predicted values based on the target weight.
[0147] (1) The decoding device may obtain the predicted value of the current block by performing a weighted addition operation on each of the N reference predicted values using the weight values in the target weight group. Here, the predicted value P(x,y) of the current block is
[0148] P(x,y)=(w1·P0(x,y) + w2·P1(x,y) +····+ wn·P N-1 (x,y) / N is also acceptable.
[0149] Here, P(x,y) is the predicted value of the current block, P0(x,y), P1(x,y), ..., P N-1 Each of (x,y) represents N reference prediction values, w1 represents the weight value corresponding to the first reference prediction value currently corresponding to the block, w2 represents the weight value corresponding to the second reference prediction value currently corresponding to the block, and by analogy, wn represents the weight value corresponding to the Nth reference prediction value currently corresponding to block (x,y).
[0150] In one embodiment, when N=2, i.e., when weighted prediction is performed using two reference prediction values for the current block, the number of weight values included in the target weight group is 1, i.e., an implicit weight value is included, and the prediction value P(x,y) for the current block is, P(x,y) = (w(x,y)·P0(x,y) + (1-w(x,y))·P1(x,y)) / 2 may also be used. Here, P(x,y) is the predicted value of the current block, P0(x,y) and P1(x,y) are two reference predicted values corresponding to the current block (x,y), w(x,y) is the weight value in the target weight group used for the first reference predicted value P0(x,y), and 1-w(x,y) is the implicit weight value used for the second reference predicted value P1(x,y).
[0151] (2) In video coding, considering the complexity of predictive value calculation, integer calculations may be implemented using a right shift operation instead of division, and the predicted value of the current block may be obtained by performing a weighting operation on each of the N reference predicted values using the weight values in the target weight group in the form of integer calculations. The complexity of predictive value calculation can be reduced to some extent in the form of integer calculations.
[0152] For example, if the number of reference predictions is 2 (i.e., N=2) and the number of weight values in the target weight group is 1, the decoding device may obtain the prediction value of the current block by performing a weighting operation on each of the two reference predictions using the weight values in the target weight group in the form of an integer calculation. In this case, the prediction value P(x,y) of the current block is: P(x,y)=(w(x,y)×P0(x,y) + (16-w(x,y))×P1(x,y) + 8)>>4 is also acceptable. Here, ">>4" represents a 4-bit right shift, meaning that the data in the weighting process can be divided by 16 by the 4-bit right shift, and 8 is the offset added for rounding. All of the above P0(x,y), P1(x,y), w(x,y), and P(x,y) are of integer type, P(x,y) is the predicted value of the current block, P0(x,y) and P1(x,y) are the two reference predicted values corresponding to the current block (x,y), and w(x,y) is the weight value used for the first predicted value P0(x,y) (i.e., the weight value in the target weight group). Also, for example, ">>6" represents a 6-bit right shift, meaning that the data in the weighting process can be divided by 64 by the 6-bit right shift, and 32 is the offset added for rounding. In this case, the predicted value P(x,y) of the current block is, P(x,y)=(w·P0(x,y) + (64-w)·P1(x,y) + 32)>>6 is also acceptable.
[0153] In this embodiment, the decoding device can obtain the predicted value of the current block by performing a weighted addition process on each of the N reference predicted values using the weight values in the target weight group, or by performing a weighted addition process in the form of an integer calculation, thereby ensuring the accuracy of the predicted value and being advantageous for improving the decoding performance for the current block.
[0154] In one embodiment, after obtaining the predicted value of the current block, the reconstructed value of the current block may be obtained by performing an overlay process based on the residual video signal of the current block and the predicted value, and the decoded image corresponding to the current block may be reconstructed based on the reconstructed value of the current block. On the other hand, the decoded image corresponding to the current block can be used as a reference image when predicting the weighting of other coded blocks, and on the other hand, the decoded image corresponding to the current block can also be used to reconstruct the current frame of the current block, and ultimately, the video can be reconstructed based on the multiple reconstructed video frames.
[0155] In the embodiment of the present invention, the decoding device obtains N reference prediction values (N being an integer greater than 1) of the current block by performing composite prediction of the current block in the video bitstream. The current block refers to the encoded block in the video bitstream that is being decoded. The decoding device determines a target weight group for weighted prediction of the current block based on the importance of the N reference prediction values, and obtains the prediction value of the current block by performing weighted prediction processing of the N reference prediction values based on the target weight group. The prediction value of the current block is used to reconstruct the decoded image corresponding to the current block. By using composite prediction in video decoding, fully considering the importance of the reference prediction values in the composite prediction, and performing weighted prediction by adaptively selecting appropriate weights for the current block based on the importance of each reference prediction value in the composite prediction, the prediction accuracy of the current block can be improved, and the performance of encoding and decoding can be improved.
[0156] Refer to Figure 4. Figure 4 is a schematic diagram of the flow of another video processing method provided in the embodiment of the present application. This video processing method may be performed by encoding equipment in a video processing system. The video processing method in this embodiment may include the following steps S401 to S405.
[0157] In S401, the current block is obtained by splitting the current frame in the video. The current block refers to the encoded block in the video that is being encoded by the encoding device. Here, the video may contain one or more video frames. The current frame refers to the video frame being encoded. The encoding device may obtain one or more encoded blocks by splitting the current frame in the video. The current block refers to one of the encoded blocks being encoded among the one or more encoded blocks in the current frame.
[0158] In S402, by performing a composite prediction of the current block, N reference prediction values (where N is an integer greater than 1) of the current block are obtained. These N reference prediction values are derived from N reference blocks of the current block, and the N reference blocks are the encoded blocks referenced during the encoding of the current block in the video, with a one-to-one correspondence between the reference prediction values and the reference blocks.
[0159] The above N reference prediction values may be derived from N reference blocks. Each reference prediction value corresponds to one reference block. In the embodiments of this application, the video frame in which a reference block is located may be a reference frame, and the video frame in which a current block is located is the current frame. Here, the positional relationship between the N reference blocks and the current block includes any one of the following (1) to (4): (1) The N reference blocks are each located in N reference frames, and the N reference frames and the current frame may belong to different video frames in the video. (2) The N reference blocks are located in the same reference frame, and the same reference frame and the current frame may belong to different video frames in the video. (3) One or more of the N reference blocks are located in the current frame, and the remaining N reference blocks are located in one or more reference frames, and one or more reference frames and the current frame may belong to different video frames in the video. (4) All of the N reference blocks and the current block are located in the current frame.
[0160] As can be seen from the positional relationship between the N reference blocks and the current block shown in (1) to (4) above, the prediction modes of the composite prediction in the embodiment of the present application include the interprediction mode (i.e., at least two reference frames are permitted to be used for interprediction), the combined prediction mode (i.e., at least one reference frame is permitted to be used for interprediction, and the current frame is permitted to be used for intraprediction), and the intraprediction mode (i.e., the current frame is permitted to be used for intraprediction).
[0161] In response to different modes of composite prediction, the encoding device may obtain N reference prediction values of the current block by performing composite prediction of the current block, which may include one of the following (1) or (2): (1) During composite prediction of the current block, the encoding device obtains N reference prediction values of the current block by performing interpretation with N reference blocks on the current block. In this case, the N reference prediction values of the current block are derived by performing interpretation with N reference blocks on the current block. (2) During composite prediction of the current block, the encoding device obtains N reference block at least one of the references block Interpretation is performed using the existing reference blocks, and intrapretation is performed using the remaining reference blocks out of the N reference blocks, thereby obtaining N reference prediction values. Here, some of the N reference prediction values are derived by performing interpretation using at least one of the N reference blocks out of the current block, and the remaining reference prediction values are derived by performing intrapretation using the remaining reference blocks out of the N reference blocks.
[0162] In S403, a target weight group for weighted prediction is determined for the current block based on the importance of N reference prediction values. The importance of each reference prediction value represents the degree to which it influences the coding performance of the current block.
[0163] The importance of a reference prediction may be determined comprehensively based on factors such as the bitrate consumed in the weighted prediction process and the quality loss in encoding the current block. For example, if performing weighted prediction using a certain reference prediction for the current block significantly increases bitrate consumption, it indicates that the contribution of this reference prediction to reducing bitrate consumption is not significant, and therefore its importance is low. Similarly, if performing weighted prediction using a certain reference prediction for the current block significantly increases quality loss, it indicates that the contribution of this reference prediction to reducing quality loss is small, and therefore its importance is low. A target weight group contains one or more weight values, and these weight values act on each reference prediction in weighted prediction. If a reference prediction has low importance, it corresponds to a small weight value in the target weight group; if a reference prediction has high importance, it corresponds to a large weight value in the target weight group. In other words, the target weight group is a group of weights selected after considering the impact of each reference prediction on factors such as bitrate consumption and quality loss, so that the overall cost of the weighted prediction (i.e., the cost of bitrate consumption, the cost of quality loss, and the cost of both bitrate consumption and quality loss) is small and the encoding / decoding performance is good.
[0164] In one implementation, the decoding device performs weighted prediction processing on N reference prediction values using the weight values in the target weight group, and the bitrate consumed is less than a predetermined bitrate threshold, or the quality loss in encoding the current block is reduced to less than a predetermined loss threshold by performing weighted prediction processing on N reference prediction values based on the weight values in the target weight group. Alternatively, when performing weighted prediction processing on N reference prediction values using the weight values in the target weight group, the bitrate consumed is less than a predetermined bitrate threshold, and the quality loss in encoding the current block is reduced to less than a predetermined loss threshold by performing weighted prediction processing on N reference prediction values based on the weight values in the target weight group. Here, the predetermined bitrate threshold and predetermined loss threshold may be set in advance as needed, for example, in order to reduce the overall cost of weighted prediction, appropriate bitrate thresholds and loss thresholds may be determined by statistical analysis based on past encoding and decoding records. In this embodiment, the encoding device can constrain the selection of target weight groups based on at least one of a predetermined bitrate threshold and a predetermined loss threshold, allowing it to select an appropriate target weight group as needed, which is advantageous for reducing encoding costs and improving encoding and decoding performance.
[0165] In one embodiment, the encoding has one or more weight lists. This may be understood as one or more weight lists being used for encoding. Each weight list contains one or more weight groups, each weight group contains one or more weight values, and the number of weight values in each weight group may be the same or different, and the values of the weight values in each weight group may be the same or different. In this case, the step of determining the target weight group for weighted predictions for the current block based on the importance of N reference prediction values may include steps s41-s42.
[0166] In step s41, a target weight list is determined from one or more weight lists based on the importance of N reference prediction values.
[0167] Here, the specific implementation of determining the target weight list from one or more weight lists based on the importance of N reference prediction values may include several methods, as described below.
[0168] Method 1: If the encoding has a single weight list, this weight list can be used directly as the target weight list.
[0169] Method 2: If there are multiple weight lists for encoding, an importance metric value for the reference predictions may be introduced, and the target weight list may be determined from among the multiple weight lists based on the importance metric values of N reference predictions.
[0170] (1) Determine the target weight list based on the absolute difference between the importance metric values of N reference prediction values.
[0171] If the number of weight lists in the encoding is M+1 (where M is a positive integer greater than or equal to 1), then one weight list corresponds to one threshold interval, i.e., the number of threshold intervals is also M+1. Next, the encoding device may obtain importance metric values for N reference predictions and calculate the importance difference between the N reference predictions. The importance difference between any two reference predictions is measured by the difference between the importance metric values of any two reference predictions. Specifically, any two reference predictions of Importance Metric value Alternatively, the difference between any two reference prediction values may be calculated, and the difference between the importance metric values of any two reference prediction values may be defined as the importance difference between any two reference prediction values. Then, a threshold interval in which the absolute value of the importance difference between N reference prediction values lies may be determined, and a weight list corresponding to the threshold interval in which the absolute value of the importance difference between N reference prediction values lies may be determined as the target weight list.
[0172] (2) Determine the target weight list by comparing the magnitudes of the importance metric values of the reference prediction values.
[0173] The N reference prediction values in the current block may include a first reference prediction value and a second reference prediction value, and the weight list in the encoding may include a first weight list and a second weight list. The encoding device compares the importance metric value of the first reference prediction value with the importance metric value of the second reference prediction value, and if it determines that the importance metric value of the first reference prediction value is greater than the importance metric value of the second reference prediction value, it may determine the first weight list as the target weight list. If it determines that the importance metric value of the first reference prediction value is less than or equal to the importance metric value of the second reference prediction value, it may determine the second weight list as the target weight list.
[0174] The weight values in the first weight list are inversely related to the weight values in the second weight list, by any choice.
[0175] (3) Determine the target weight list using the mathematical sign function and the importance metric value of the reference prediction.
[0176] The N reference predictions in the current block include a first reference prediction and a second reference prediction, and the weight list in encoding includes a first weight list, a second weight list, and a third weight list. The encoding device may obtain the code value by calling a mathematical coding function and processing the difference between the importance metric value of the first reference prediction and the importance metric value of the second reference prediction. If the above code value is a first predetermined value (e.g., -1), the first weight list is determined as the target weight list; if the above code value is a second predetermined value (e.g., 0), the second weight list is determined as the target weight list; and if the above code value is a third predetermined value (e.g., 1), the third weight list is determined as the target weight list.
[0177] (4) The above methods (1), (2), and (3) may be used individually, or methods (1), (2), and (3) may be combined to determine the target weight list. As one implementation, if there are M+1 weight lists, method (1) can determine the weight list corresponding to the threshold interval in which the absolute value of the importance difference is located as a candidate weight list. Next, the N reference prediction values include a first reference prediction value and a second reference The system includes a predicted value, and in method (2), it compares the importance metric value of the first reference predicted value with the importance metric value of the second reference predicted value. If it is determined that the importance metric value of the first reference predicted value is greater than the importance metric value of the second reference predicted value, the candidate weight list is directly determined as the target weight list. If it is determined that the importance metric value of the first reference predicted value is less than or equal to the importance metric value of the second reference predicted value, the weight list corresponding to the weight values inversely to the weight values in the candidate weight list is determined as the target weight list.
[0178] Here, one of the N reference predictions is represented as reference prediction i (where i is an integer less than or equal to N), the reference prediction i is derived from reference block i, the video frame in which reference block i is located is reference frame i, the video frame in which the current block is located is the current frame, and the importance metric value of reference prediction i may be determined by one of the following methods.
[0179] Method 1: Calculation is performed based on the picture order count (POC) of the current frame in the video and the picture order count of the reference frame i in the video. Specifically, the encoding device may calculate the difference between the picture order count of the current frame in the video and the picture order count of the reference frame i in the video, and use the absolute value of this difference as the importance metric value of the reference predicted value i. For example, if the picture order count of the current frame in the video is represented as cur_poc and the picture order count of the reference frame i in the video is ref_poc, then the importance metric value D of the reference predicted value i is D = abs(cur_poc - ref_poc), where abs() indicates calculating the absolute value.
[0180] Method 2: The calculation is performed based on the picture sequence count of the current frame in the video, the picture sequence count of reference frame i in the video, and a quality metric Q. Here, the quality metric Q may be determined by various means, but is not limited to this. Specifically, the quality metric Q of reference frame i may be derived from the quantization information of the current block. For example, the quality metric Q may be set as the base quantization index (base_qindex) of reference frame i. The base_qindex of any two reference frames may be different or the same. In other implementations, the quality metric Q of reference frame i may be derived from other encoding information. For example, the quality metric Q of reference frame i may be derived from the encoding information difference between the encoded CU in reference frame i and the encoded CU in the current frame.
[0181] As one implementation, the encoding device may calculate the difference between the picture sequence count of the current frame in the video and the picture sequence count of the reference frame i in the video, and then, using an objective function, determine the importance metric value of the reference predicted value i based on the above difference, the quality metric Q, and the importance metric value list.
[0182] In one embodiment, the importance metric value of the reference frame i may be calculated based on the orientation relationship between the reference frame i and the current frame, and the quality metric Q. In one implementation, a correspondence relationship between the reference orientation relationship and the reference importance metric value may be established. For example, if the reference frame is located before the current frame in terms of the reference orientation relationship, the reference importance metric value may be associated with a first value, and if the reference frame is located after the current frame in terms of the reference orientation relationship, the reference importance metric value may be associated with a second value. Next, the encoding device can calculate the importance metric value of the reference predicted value i based on the reference importance metric value corresponding to the reference frame i and the quality metric Q.
[0183] Method 3: Based on the calculation results of Method 1 and Method 2, calculate the importance metric score of reference frame i, order the importance metric scores of the reference frames corresponding to the N reference prediction values in ascending order, and determine the index of reference frame i in the ordering as the importance metric value of the reference prediction value i.
[0184] One implementation is to calculate the first importance metric value of the reference prediction value i by method 1 above, and the second importance metric value of the reference prediction value i by method 2 above. Next, the importance metric score (e.g., score) of the reference frame i is calculated based on the first and second importance metric values. Then, the importance metric scores of the reference frames corresponding to the N reference prediction values are ordered in ascending order, and the index of the reference frame i in the ordering is determined as the importance metric value of the reference prediction value i.
[0185] Here, the importance metric score of reference frame i can be calculated based on the first importance metric value and the second importance metric value in the following ways: (1) Obtain the importance metric value of the reference predicted value i by performing a weighted addition of the first importance metric value and the second importance metric value. (2) Obtain the importance metric value of the reference predicted value i by performing an averaging process of the first importance metric value and the second importance metric value.
[0186] Method 4: To obtain an accurate importance metric value, the importance metric value of the reference prediction value i may be obtained by adjusting the calculation results of Method 1, Method 2, or Method 3 based on the prediction mode of the reference prediction value i. Here, the prediction mode of the reference prediction value i includes either an inter-prediction mode or an intra-prediction mode.
[0187] It should be understood that, in practice, one of the above methods 1 to 4 may be used to determine the importance metric value of the reference forecast value, as needed. This application is not limited to this.
[0188] In step s42, a group of target weights for weighted prediction is selected from the target weight list.
[0189] Here, the target weight list contains one or more weight groups.
[0190] (1) If the number of weight groups in the target weight list is equal to 1, the weight groups in the target weight list are directly used as the target weight groups for weighted prediction.
[0191] (2) If the target weight list contains multiple weight groups, select the target weight group for weighted prediction from the target weight list.
[0192] During weighted prediction processing, bitrate may be consumed, and encoding blocks may experience quality loss during encoding. For this reason, the encoding device may first obtain the encoding performance when performing weighted prediction processing for each of the N reference prediction values using each weight group in the target weight list, and then determine the weight group with the best encoding performance in the target weight list as the target weight group. As one implementation, when weighted prediction processing for N reference prediction values is performed using the weight values in the target weight group, the bitrate consumed is the minimum bitrate among all the bitrates consumed for all weight groups in the target weight list, or when weighted prediction processing for N reference prediction values is performed based on the weight values in the target weight group, the quality loss in encoding the corresponding current block is the minimum quality loss among all the weight groups in the target weight list, or when weighted prediction processing for N reference prediction values is performed using the weight values in the target weight group, the bitrate consumed is the minimum bitrate among all the bitrates consumed for all weight groups in the target weight list, AND when weighted prediction processing for N reference prediction values is performed based on the weight values in the target weight group, the quality loss in encoding the corresponding current block is the minimum quality loss among all the weight groups in the target weight list. The encoding device can determine the weight group with the best encoding performance as the target weight group. block Encoding it allows you to obtain the best encoding performance and improves video encoding performance.
[0193] It is important to understand that on the encoding side, when selecting a target weight group for weighted prediction, it is necessary to try each weight group one by one from the target weight list to obtain the target weight group for weighted prediction. On the decoding side, there is no need to try one by one, and the index of the target weight group to be used is shown in the video bitstream. On the decoding side, it is only necessary to decode the index of the target weight group from the video bitstream and search for the target weight group in the target weight list based on the index of the target weight group. The encoding device determines the target weight list based on the importance of the N reference prediction values, selects the target weight group for weighted prediction from the target weight list, and by selecting the appropriate weight group from the weight list, it is possible to reconstruct the current block, improve the prediction accuracy of the current block, and improve encoding performance.
[0194] In S404, the predicted value for the current block is obtained by performing a weighted prediction process on N reference predicted values based on the weight values in the target weight group.
[0195] Here, the specific implementation of step S404 can be found by referring to the specific implementation of step S303 described above.
[0196] In S405, a video bitstream is generated by encoding the video based on the predicted values of the current block. The encoding device may also generate a video bitstream by encoding the video based on the predicted values of the current block and the index of the target weight group. Here, generating a video bitstream by encoding the video based on the predicted values of the current block and the index of the target weight group can be explained by referring to the encoding description above.
[0197] In the embodiment of the present invention, the encoding device obtains the current block, which is an encoded block in the video being encoded, by performing a division process on the current frame in the video, obtains N reference predicted values for the current block by performing a composite prediction on the current block, determines a target weight group for weighted prediction for the current block based on the importance of the N reference predicted values, obtains a predicted value for the current block by performing a weighted prediction process on the N reference predicted values based on the target weight group, and generates a video bitstream by encoding the video based on the predicted value of the current block. Composite prediction is used in the encoding of the video, the importance of the reference predicted values is derived in the composite prediction, and weighted prediction is performed by adaptively selecting appropriate weights for the current block based on the importance of each reference predicted value in the composite prediction, thereby improving the prediction accuracy of the current block and improving the performance of encoding and decoding.
[0198] Refer to Figure 5. Figure 5 is a schematic diagram of the configuration of a video processing device provided in an embodiment of the present application. This video processing device may be provided in a computer device provided in an embodiment of the present application. The computer device may be a decoding device as referred to in the embodiments of the method described above. The video processing device shown in Figure 5 may also be computer-readable instructions (including program code) executed on the computer device. This video processing device may be used to perform some or all of the steps in the embodiment of the method shown in Figure 3. Referring to Figure 5, this video processing device may include the following units:
[0199] The processing unit 501 obtains N reference prediction values (where N is an integer greater than 1) of the current block by performing a composite prediction of the current block in the video bitstream. The current block is the encoded block in the video bitstream that is subject to decoding, and the N reference prediction values are derived from the N reference blocks of the current block. The N reference blocks are the encoded blocks in the video bitstream that are referenced when decoding the current block, and there is a one-to-one correspondence between the reference prediction values and the reference blocks.
[0200] The decision unit 502 determines a target weight group for weighted prediction for the current block based on the importance of N reference prediction values. The target weight group contains one or more weight values, and the importance represents the degree to which each reference prediction value influences the decoding performance of the current block.
[0201] The processing unit 501 further obtains the predicted value of the current block by performing weighted prediction processing on N reference predicted values based on the weight values in the target weight group. The predicted value of the current block is used to reconstruct the decoded image corresponding to the current block.
[0202] In one embodiment, the video frame in which a reference block is located is a reference frame, the video frame in which a current block is located is the current frame, and the positional relationship between the N reference blocks and the current block includes one of the following: the N reference blocks are each located in one of the N reference frames and the N reference frames and the current frame belong to different video frames in the video bitstream; the N reference blocks are located in the same reference frame and the same reference frame and the current frame belong to different video frames in the video bitstream; one or more of the N reference blocks are located in the current frame and the remaining N reference blocks are located in one or more reference frames and the one or more reference frames and the current frame belong to different video frames in the video bitstream; and all of the N reference blocks and the current block are located in the current frame.
[0203] In one embodiment, the processing unit 501 further determines the conditions for adaptive weighting prediction, and if the current block satisfies the conditions for adaptive weighting prediction, it determines a target weight group for weighting prediction for the current block based on the importance of N reference prediction values.
[0204] In one embodiment, if the current block satisfies the conditions for adaptive weighted prediction, the sequence header of the frame sequence to which the current block belongs contains a first instruction field, and the first instruction field indicates that the use of adaptive weighted prediction is permitted for the encoded blocks in the frame sequence, and the frame sequence is a sequence consisting of each video frame in a video bitstream; the slice header of the current slice to which the current block belongs contains a second instruction field, and the second instruction field indicates that the use of adaptive weighted prediction is permitted for the encoded blocks in the current slice, and the current slice is an image slice to which the current block belongs, and the image slice is divided from the current frame to which the current block is located; the frame header of the current frame to which the current block is located contains a third instruction field, and the third instruction field indicates that the use of adaptive weighted prediction is permitted for the encoded blocks in the current frame; and during composite prediction, the current block For the above, the following cases are possible: at least two reference frames are used for interpretation; during composite prediction, at least one reference frame is used for interpretation and the current frame is used for intraprediction for the current block; the motion type of the current block is a specified motion type; a predetermined motion vector prediction mode is used for the current block; a predetermined interpolation filter is used for the current block; no particular encoding tool is used for the current block; and the reference frame used for composite prediction for the current block satisfies certain conditions, the certain conditions including one or more of the following: the orientation relationship in the video bitstream between the reference frame used and the current frame satisfies a predetermined relationship; and the absolute value of the importance difference between the reference prediction values corresponding to the reference frame used is greater than or equal to a predetermined threshold; and at least one of the following, where the orientation relationship satisfies a predetermined relationship means that all of the reference frames used are located before the current frame; and all of the reference frames used are located after the current frame.This includes either one of the following: some of the reference frames used are located before the current frame, and the remaining reference frames are located after the current frame.
[0205] In one embodiment, the video bitstream includes one or more weight lists, each weight list includes one or more weight groups, each weight group includes one or more weight values, the number of weight values in each weight group may be the same or different, the values of the weight values included in each weight group may be the same or different, and the decision unit 502 specifically,
[0206] Based on the importance of N reference prediction values, a target weight list may be determined from one or more weight lists, and a target weight group for weighted prediction may be selected from the target weight list.
[0207] In one embodiment, the number of weight lists in the video bitstream is M+1 (where M is a positive integer greater than or equal to 1), and each weight list corresponds to one threshold interval. Specifically, the decision unit 502 may obtain importance metric values for N reference prediction values, calculate the importance difference between the N reference prediction values, determine the threshold interval in which the absolute value of the importance difference between the N reference prediction values lies, and determine the weight list corresponding to the threshold interval in which the absolute value of the importance difference between the N reference prediction values lies as the target weight list. Here, the importance difference between any two reference prediction values is measured by the difference between the importance metric values of any two reference prediction values.
[0208] In one embodiment, the N reference prediction values of the current block include a first reference prediction value and a second reference prediction value, the video bitstream includes a first weight list and a second weight list, and the decision unit 502 specifically compares the importance metric value of the first reference prediction value and the importance metric value of the second reference prediction value. If the importance metric value of the first reference prediction value is greater than the importance metric value of the second reference prediction value, the first weight list is determined as the target weight list. If the importance metric value of the first reference prediction value is less than or equal to the importance metric value of the second reference prediction value, the second weight list is determined as the target weight list. Here, the sum of the weight values in the same order in the first weight list and the second weight list is 1.
[0209] In one embodiment, the N reference prediction values of the current block include a first reference prediction value and a second reference prediction value, the video bitstream includes a first weight list, a second weight list, and a third weight list, and the decision unit 502 specifically obtains a sign value by calling a mathematical sign function and processing the difference between the importance metric value of the first reference prediction value and the importance metric value of the second reference prediction value, and may determine the first weight list as the target weight list if the sign value is a first predetermined value, determine the second weight list as the target weight list if the sign value is a second predetermined value, and determine the third weight list as the target weight list if the sign value is a third predetermined value. Here, the first weight list, the second weight list, and the third weight list are all different weight lists, or two of the first weight list, the second weight list, and the third weight list are the same weight list.
[0210] In one embodiment, one of the N reference prediction values is represented as reference prediction value i (where i is an integer less than or equal to N), the reference prediction value i is derived from reference block i, the video frame in which reference block i is located is reference frame i, the video frame in which the current block is located is the current frame, and the importance metric value of reference prediction value i is calculated by method 1 based on the picture order count of the current frame in the video bitstream and the picture order count of reference frame i in the video bitstream, and the picture order count of reference frame i in the video bitstream, quality metric Q, and the picture order count of the current frame in the video bitstream Method 1 is determined by one of the following methods: Method 2, which performs calculations based on the sequence count; Method 3, which calculates the importance metric score of the reference frame i based on the calculation results of Method 1 and Method 2, orders the importance metric scores of the reference frames corresponding to the N reference predicted values in ascending order, and determines the index of the reference frame i in the ordering as the importance metric value of the reference predicted value i; and Method 4, which obtains the importance metric value of the reference predicted value i by adjusting the calculation results of Method 1, Method 2, or Method 3 based on the prediction mode of the reference predicted value i, where the prediction mode of the reference predicted value i includes either an inter-prediction mode or an intra-prediction mode.
[0211] In one embodiment, the number of weight groups included in the target weight list is greater than 1, and the decision unit 502 may specifically decode the index of the target weight group for weight prediction from the video bitstream and select a target weight group from the target weight list using the target weight group index. Here, the target weight group index is encoded using a binarization scheme that uses abbreviated unary codes, or a multi-symbol entropy encoding scheme.
[0212] In one embodiment, the processing unit 501 may specifically obtain the predicted value of the current block by performing a weighted addition operation on each of the N reference predicted values using the weight values in the target weight group, or it may obtain the predicted value of the current block by performing a weighting operation on each of the N reference predicted values using the weight values in the target weight group in the form of an integer calculation.
[0213] In the embodiment of the present invention, composite prediction of the current block, which is an encoded block during decoding of a video bitstream, is performed to obtain N reference prediction values of the current block. Based on the importance of the N reference prediction values, a target weight group for weighted prediction is adapted and selected for the current block. Based on the target weight group, a weighted prediction process is performed on the N reference prediction values to obtain a predicted value for the current block. The predicted value for the current block is used to reconstruct the decoded image corresponding to the current block. Composite prediction is used for video decoding, the importance of the reference prediction values is sufficiently considered in the composite prediction, and appropriate weights are determined for the current block based on the importance of each reference prediction value in the composite prediction to perform weighted prediction. This improves the prediction accuracy of the current block and enhances the performance of encoding and decoding.
[0214] Refer to Figure 6. Figure 6 is a schematic diagram of the configuration of a video processing device provided in an embodiment of the present application. This video processing device may be provided in a computer device provided in an embodiment of the present application. The computer device may be an encoding device as referred to in the embodiments of the method described above. The video processing device shown in Figure 6 may also be computer-readable instructions (including program code) executed on the computer device. This video processing device may be used to perform some or all of the steps in the embodiment of the method shown in Figure 4. Referring to Figure 6, this video processing device may include the following units:
[0215] The processing unit 601 obtains the current block by performing a splitting process on the current frame in the video.
[0216] The processing unit 601 further obtains N reference prediction values (where N is an integer greater than 1) for the current block by performing a composite prediction of the current block. These N reference prediction values are derived from the N reference blocks of the current block, and the N reference blocks are the encoded blocks referenced during the encoding of the current block in the video, with a one-to-one correspondence between the reference prediction values and the reference blocks.
[0217] The decision unit 602 determines a target weight group for weighted prediction for the current block based on the importance of N reference prediction values, the target weight group containing one or more weight values, the importance of which represents the degree to which each reference prediction value influences the coding performance of the current block.
[0218] The processing unit 601 further obtains the predicted value of the current block by performing weighted prediction processing on N reference predicted values based on the weight values in the target weight group. The predicted value of the current block is used to reconstruct the decoded image corresponding to the current block.
[0219] The processing unit 601 further generates a video bitstream by encoding the video based on the predicted values of the current block.
[0220] In one embodiment, the decision unit 602 may specifically determine a target weight list from one or more weight lists based on the importance of N reference prediction values, and select a target weight group for weighted prediction from the target weight list. Each weight list may contain one or more weight groups, each weight group may contain one or more weight values, and the number of weight values in each weight group may be the same or different, and the values of the weight values in each weight group may be the same or different.
[0221] In one embodiment, when weighted prediction processing for N reference prediction values is performed using the weight values in the target weight group, the bitrate consumed is less than a predetermined bitrate threshold, or the quality loss in encoding the current block is reduced to less than a predetermined loss threshold by performing weighted prediction processing for N reference prediction values based on the weight values in the target weight group. Alternatively, when weighted prediction processing for N reference prediction values is performed using the weight values in the target weight group, the bitrate consumed is less than a predetermined bitrate threshold, and the quality loss in encoding the current block is reduced to less than a predetermined loss threshold by performing weighted prediction processing for N reference prediction values based on the weight values in the target weight group.
[0222] In one embodiment, the target weight group is the weight group with the best encoding performance in the target weight list, where having the best encoding performance means that when weighted prediction processing for N reference prediction values is performed using the weight values in the target weight group, the bitrate consumed is the minimum of the bitrate consumed for all weight groups in the target weight list, or when weighted prediction processing for N reference prediction values is performed based on the weight values in the target weight group, the quality loss in encoding the corresponding current block is the minimum of the quality loss for all weight groups in the target weight list, or when weighted prediction processing for N reference prediction values is performed using the weight values in the target weight group, the bitrate consumed is the minimum of the bitrate consumed for all weight groups in the target weight list, AND when weighted prediction processing for N reference prediction values is performed based on the weight values in the target weight group, the quality loss in encoding the corresponding current block is the minimum of the quality loss for all weight groups in the target weight list.
[0223] In the embodiments of this invention, the current block, which is an encoded block in the video during encoding, is obtained by performing a division process on the current frame in the video. N reference predicted values for the current block are obtained by performing a composite prediction on the current block. A target weight group for weighted prediction is determined for the current block based on the importance of the N reference predicted values. Predicted values for the current block are obtained by performing a weighted prediction process on the N reference predicted values based on the target weight group. A video bitstream is generated by encoding the video based on the predicted values of the current block. Composite prediction is used in video encoding, the importance of the reference predicted values is sufficiently considered, and in composite prediction, appropriate weights are determined for the current block based on the importance of each reference predicted value to perform weighted prediction. This improves the prediction accuracy of the current block and improves the encoding and decoding performance.
[0224] Furthermore, the embodiments of this application also provide a schematic diagram of the configuration of the computer equipment. Refer to Figure 7 for this schematic diagram of the configuration of the computer equipment. This computer equipment may be the above-described encoding device or decoding device. This computer equipment may include a processor 701, an input device 702, an output device 703, and a memory 704. The processor 701, input device 702, output device 703, and memory 704 are connected via a bus. The memory 704 stores computer-readable instructions, which include program instructions, and the processor 701 executes the program instructions stored in the memory 704.
[0225] If the computer device is the above-described decoding device, in the embodiment of the present invention, the processor 701 executes each step of the video processing method relating to decoding, as executed by the above-described decoding device, by executing the executable program code in the memory 704.
[0226] If the computer device is optionally the above-mentioned encoding device, in the embodiment of the present invention, the processor 701 executes each step of the video processing method related to encoding that is performed by the above-mentioned encoding device by executing the executable program code in the memory 704.
[0227] In addition, the embodiments of the present application also provide a computer-readable storage medium in which computer-readable instructions are stored, and these computer-readable instructions include program instructions. When the processor executes the program instructions, it can perform the method in the embodiments corresponding to Figures 3 and 4. Therefore, no further explanation is provided here. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, refer to the description of the embodiments of the method of the present application. For example, the program instructions may be executed on one computer device, on multiple computer devices in one location, or on multiple computer devices distributed in multiple locations and connected to each other via a communication network.
[0228] According to one aspect of the present application, a computer program product including computer-readable instructions is provided. The computer-readable instructions are stored in a computer-readable storage medium. The processor of a computer device reads the computer-readable instructions from the computer-readable storage medium, and when the processor executes the computer-readable instructions, the computer device can be made to perform the method in the embodiment corresponding to Figures 3 and 4 above. Therefore, no further explanation is given here. As those skilled in the art will understand, all or part of the method flow according to the above embodiment may be implemented by instructing the relevant hardware via computer-readable instructions. The computer-readable instructions may be stored in a computer-readable storage medium. Computer-readable instructionsWhen this is executed, the flow of each embodiment of the method described above is executed. Here, the storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), random access memory (RAM), etc.
[0229] The embodiments presented above are merely preferred examples of the present application and, of course, do not limit the scope of the rights of this application. As those skilled in the art will understand, any equivalent modifications that implement all or part of the above embodiments in accordance with the claims of this application still fall within the scope of the invention.
Claims
1. A video processing method performed by a computer device, A step of obtaining N reference prediction values (where N is an integer greater than 1) of the current block by performing a composite prediction of the current block in the video bitstream, wherein the current block is an encoded block in the video bitstream that is subject to decoding, the N reference prediction values are derived from N reference blocks of the current block, the N reference blocks are encoded blocks in the video bitstream that are referenced when decoding the current block, and there is a one-to-one correspondence between the reference prediction values and the reference blocks. A step of determining a target weight group for weighted prediction for the current block based on the importance of the N reference prediction values, wherein the target weight group includes one or more weight values, and the importance represents the degree to which each reference prediction value influences the decoding performance of the current block. A step of obtaining a predicted value for the current block by performing a weighted prediction process on the N reference predicted values based on the weight values in the target weight group, wherein the predicted value for the current block is for reconstructing the decoded image corresponding to the current block. Includes, The video bitstream includes one or more weight lists, each weight list includes one or more weight groups, each weight group includes one or more weight values, the number of weight values in each weight group may be the same or different, and the number of weight values in each weight group may be the same or different, the number of weight lists in the video bitstream is M+1 (where M is a positive integer of 1 or more), and each weight list corresponds to one threshold interval. The step of determining a target weight group for weighted prediction for the current block based on the importance of the N reference prediction values is: A step of determining a target weight list from one or more weight lists based on the importance of the N reference prediction values, A step of obtaining importance metric values for the N reference prediction values and calculating the importance difference between the N reference prediction values, wherein the importance difference between any two reference prediction values is measured by the difference between the importance metric values of the two reference prediction values. The steps include determining a threshold interval in which the absolute value of the importance difference among the N reference prediction values lies, The steps include determining a target weight list as a weight list corresponding to a threshold interval where the absolute value of the importance difference between the N reference prediction values lies, and It has steps, The steps include selecting a target weight group for weight prediction from the aforementioned target weight list, and Includes, Any one of the N reference prediction values is represented as reference prediction value i (where i is an integer less than or equal to N), the reference prediction value i is derived from reference block i, the video frame in which the reference block i is located is reference frame i, and the video frame in which the current block is located is the current frame. The importance metric value of the aforementioned reference prediction value i is: A method 1 for performing a calculation based on the picture sequence count of the current frame in the video bitstream and the picture sequence count of the reference frame i in the video bitstream, Method 2, which performs calculations based on the picture sequence count of the reference frame i in the video bitstream, a quality metric Q, and the picture sequence count of the current frame in the video bitstream, wherein the quality metric Q is determined based on the quantization information of the current block or the encoding information of the reference frame i, and Method 3 calculates the importance metric score of the reference frame i based on the calculation results of Method 1 and Method 2, orders the importance metric scores of the reference frames corresponding to the N reference predicted values in ascending order, and determines the index of the reference frame i in the ordering as the importance metric value of the reference predicted value i. By adjusting the calculation results, the importance metric value of the reference predicted value i is determined by method 4, based on the prediction mode of the reference predicted value i. The prediction mode of the aforementioned reference prediction value i includes either an interpretation mode or an intraprediction mode. Video processing methods.
2. A video processing device, A processing unit that obtains N reference prediction values (where N is an integer greater than 1) of a current block by performing a composite prediction of the current block in a video bitstream, wherein the current block is an encoded block in the video bitstream that is subject to decoding, the N reference prediction values are derived from N reference blocks of the current block, the N reference blocks are encoded blocks in the video bitstream that are referenced when decoding the current block, and the reference prediction values and the reference blocks correspond one-to-one. A decision unit that determines a target weight group for weighted prediction for the current block based on the importance of the N reference prediction values, wherein the target weight group includes one or more weight values, and the importance is to represent the degree to which each reference prediction value influences the decoding performance of the current block. Includes, The processing unit further obtains the predicted value of the current block by performing weighted prediction processing on the N reference predicted values based on the weight values in the target weight group, and the predicted value of the current block is used to reconstruct the decoded image corresponding to the current block. The video bitstream includes one or more weight lists, each weight list includes one or more weight groups, each weight group includes one or more weight values, the number of weight values in each weight group may be the same or different, and the number of weight values in each weight group may be the same or different, the number of weight lists in the video bitstream is M+1 (where M is a positive integer of 1 or more), and each weight list corresponds to one threshold interval. The aforementioned decision unit further Based on the importance of the N reference prediction values, a target weight list is determined from one or more weight lists. The importance metric values of the N reference prediction values are obtained, the importance difference between the N reference prediction values is calculated, and the importance difference between any two reference prediction values is measured by the difference between the importance metric values of the two reference prediction values. Determine the threshold interval in which the absolute value of the importance difference between the N reference prediction values lies. A weight list corresponding to the threshold interval in which the absolute value of the importance difference between the N reference prediction values lies is determined as the target weight list. Select a group of target weights for weighted prediction from the aforementioned list of target weights. Any one of the N reference prediction values is represented as reference prediction value i (where i is an integer less than or equal to N), the reference prediction value i is derived from reference block i, the video frame in which the reference block i is located is reference frame i, and the video frame in which the current block is located is the current frame. The importance metric value of the aforementioned reference prediction value i is: A method 1 for performing a calculation based on the picture sequence count of the current frame in the video bitstream and the picture sequence count of the reference frame i in the video bitstream, Method 2, which performs calculations based on the picture sequence count of the reference frame i in the video bitstream, a quality metric Q, and the picture sequence count of the current frame in the video bitstream, wherein the quality metric Q is determined based on the quantization information of the current block or the encoding information of the reference frame i, and Method 3 calculates the importance metric score of the reference frame i based on the calculation results of Method 1 and Method 2, orders the importance metric scores of the reference frames corresponding to the N reference predicted values in ascending order, and determines the index of the reference frame i in the ordering as the importance metric value of the reference predicted value i. By adjusting the calculation results, the importance metric value of the reference predicted value i is determined by method 4, based on the prediction mode of the reference predicted value i. The prediction mode of the aforementioned reference prediction value i includes either an interpretation mode or an intraprediction mode. Video processing device.
3. Computer equipment, A processor suitable for executing computer-readable instructions, A computer device comprising a computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, cause the video processing method described in claim 1 to be executed.
4. A computer program that causes a computer to perform the video processing method described in claim 1.