Encoding and decoding method, apparatus and device

By implementing a bidirectional predictive value compensation mode for current blocks in video encoding and decoding, the method addresses the issue of poor coding performance for bidirectional blocks, achieving improved prediction quality and coding efficiency.

JP7659092B2Active Publication Date: 2025-04-08HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024001379
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-11-14
Filing Date
2024-01-09
Publication Date
2025-04-08
Estimated Expiration
2040-10-28

AI Technical Summary

Technical Problem

Current coding frameworks do not effectively utilize the mirror-symmetric relationship between predicted images from two different directions for bidirectional blocks, leading to poor coding performance.

Method used

A method for encoding and decoding that allows the use of a bidirectional predictive value compensation mode for current blocks, which involves determining specific conditions such as the use of a translational motion model, weighting reference blocks from two reference pictures, and satisfying certain spatial and temporal relationships between the reference pictures and the current block.

Benefits of technology

This approach improves prediction quality, reduces prediction errors, enhances hardware implementation, and increases coding performance and efficiency by effectively exploiting the bidirectional predictive value compensation mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007659092000061
    Figure 0007659092000061
  • Figure 0007659092000062
    Figure 0007659092000062
  • Figure 0007659092000063
    Figure 0007659092000063
Patent Text Reader

Abstract

To improve hardware implementation friendliness, increase coding performance and improve coding performance and coding efficiency.SOLUTION: An encoding method includes: obtaining, on condition that a current block enables a bidirectional prediction compensation mode, the current block adopts a parallel movement motion model, a prediction mode of the current block is not a sub-block mode, not an SMVD mode and not a CIIP mode, prediction values of the current block by applying weight to reference blocks of two reference pictures; and determining to start the bidirectional prediction compensation mode for the current block when the following conditions are satisfied: the two reference pictures are displayed respectively earlier than and later than the current picture, and the two reference pictures have the same distance from the current picture. In response to determining to start the bidirectional prediction compensation mode for the current block, motion compensation is performed for the current block.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of encoding and decoding technology, and in particular to an encoding and decoding method, apparatus and device. [Background technology]

[0002] In order to achieve the purpose of saving space, all video images are coded before being transmitted, and a complete video coding method may include processes such as prediction, transformation, quantization, entropy coding, filtering, etc. Predictive coding includes intra coding and inter coding, and inter coding utilizes the correlation in the video time domain to predict pixels of a current image using pixels of nearby coded images to achieve the purpose of effectively removing redundancy in the time domain of video. In inter coding, a motion vector (MV) can be used to represent the relative displacement between a current block of a current picture and a reference block of a reference picture. For example, if the time domain correlation between a video image A of a current picture and a video image B of a reference picture is high and an image block A1 (current block) of a video image A needs to be transmitted, a motion search is performed in the video image B to search for an image block B1 (i.e., a reference block) that is most closely matched with the image block A1, and the relative displacement between the image block A1 and the image block B1 is determined, and the relative displacement is also the motion vector of the image block A1.

[0003] In the conventional method, when the current block is a unidirectional block, the unidirectional motion information of the current block is obtained, and then the unidirectional motion information is used to encode / decode, thereby improving the encoding performance. Meanwhile, when the current block is a bidirectional block, the bidirectional motion information of the current block is obtained, and then the bidirectional motion information is used to obtain predicted images from two different directions, and the predicted images from two different directions often have a mirror symmetric relationship, and the current encoding framework does not utilize this characteristic to further remove redundancy. That is, the application scenario of the bidirectional block currently has problems such as low encoding performance. Summary of the Invention

[0004] The present invention provides an encoding and decoding method, apparatus and device, which can improve the encoding performance. [Means for solving the problem]

[0005] The present invention provides an encoding and decoding method, the method comprising the steps of: determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is allowed to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, and the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that the two reference pictures of the current block are both short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that the sizes of the two reference pictures of the current block are both the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; If it is determined to activate the bidirectional predictor compensation mode for the current block, performing motion compensation based on the bidirectional predictor compensation mode for the current block.

[0006] The present invention provides an encoding and decoding method, the method comprising the steps of: determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: the current block is allowed to use the bidirectional predictor compensation mode; the current block uses a translational motion model; the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; the weights of the two reference pictures of the current block are the same; the two reference pictures of the current block are both short-term reference pictures; the width, height, and area of ​​the current block are all within a limited range; and the sizes of the two reference pictures of the current block are both the same as the size of the current picture; If it is determined to activate the bidirectional predictor compensation mode for the current block, performing motion compensation based on the bidirectional predictor compensation mode for the current block.

[0007] The present invention provides an encoding and decoding device, comprising: a decision module for deciding to activate the bidirectional predictor compensation mode for the current block when the following conditions are satisfied as the control information: the current block is allowed to use the bidirectional predictor compensation mode; the current block uses a translational motion model; the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; the weights of the two reference pictures of the current block are the same; both the two reference pictures of the current block are short-term reference pictures; the width, height, and area of ​​the current block are all within a limited range; and a motion compensation module for performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode for the current block.

[0008] The present invention provides a decoding device, comprising a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, The processor is adapted to execute machine-executable instructions to achieve the following steps: determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is permitted to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that both the two reference pictures of the current block are short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that both the sizes of the two reference pictures of the current block are the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode on the current block;

[0009] The present invention provides a coding device, comprising a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, The processor is adapted to execute machine-executable instructions to achieve the following steps: determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is permitted to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that both the two reference pictures of the current block are short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that both the sizes of the two reference pictures of the current block are the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode on the current block;

[0010] The present invention provides a camera, the camera including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor; The processor is adapted to execute machine-executable instructions to achieve the following steps: determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is permitted to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that both the two reference pictures of the current block are short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that both the sizes of the two reference pictures of the current block are the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode on the current block; Effect of the Invention

[0011] As can be seen from the above technical solutions, in an embodiment of the present invention, when it is determined to activate a bidirectional predictor compensation mode for a current block, motion compensation based on the bidirectional predictor compensation mode can be performed for the current block, thereby solving problems such as low prediction quality and prediction error, improving hardware realization ease, improving coding performance, and improving coding performance and coding efficiency. [Brief description of the drawings]

[0012] In order to more clearly explain the technical aspects of the embodiments of the present application, the drawings required in the description of the embodiments of the present application will be briefly described below. However, the drawings described below are only some of the embodiments described in the present application, and those skilled in the art can also obtain other drawings based on these drawings of the embodiments of the present invention. [Figure 1A] FIG. 2 is a schematic diagram of an interpolation according to one embodiment of the present invention; [Figure 1B] FIG. 1 is a schematic diagram of a video encoding framework in one embodiment of the present invention; [Diagram 2] 2 is a flowchart of an encoding and decoding method in one embodiment of the present invention. [Diagram 3] 4 is a flowchart of an encoding and decoding method according to another embodiment of the present invention. [Figure 4] 4 is a flowchart of an encoding and decoding method according to another embodiment of the present invention. [Diagram 5] 4 is a flowchart of an encoding and decoding method according to another embodiment of the present invention. [Figure 6A] FIG. 13 is a schematic diagram of filling a reference block in one embodiment of the invention; [Figure 6B] FIG. 13 is a schematic diagram of filling a reference block in one embodiment of the invention; [Figure 6C] FIG. 13 is a schematic diagram of filling a reference block in one embodiment of the invention; [Figure 6D] FIG. 13 is a schematic diagram of filling a reference block in one embodiment of the invention; [Figure 6E] FIG. 13 is a schematic diagram of filling a reference block in one embodiment of the invention; [Figure 7] FIG. 2 is a schematic diagram of a target reference block according to one embodiment of the present invention; [Figure 8] 1 is a structural diagram of an encoding and decoding device according to an embodiment of the present invention; [Figure 9A] FIG. 2 is a diagram showing the hardware architecture of a decoding device according to an embodiment of the present invention. [Figure 9B]FIG. 2 is a diagram showing the hardware architecture of an encoding device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] The terms used in the embodiments of the present invention are used only for the purpose of describing the specific embodiments, not for limiting the embodiments of the present invention. The singular forms "a", "described" and "this" used in the embodiments and claims of the present application are also intended to include the plural forms, unless the context clearly indicates otherwise. The term "and / or" used herein should also be understood to mean any or all possible combinations including one or more of the associated listed items. In the embodiments of the present invention, the terms first, second, and third may be applied to describe various information, but it should be understood that such information should not be limited thereto. These terms are used only to distinguish information of the same type from each other. For example, the first information may be referred to as the second information, and similarly, the second information may be referred to as the first information, without departing from the scope of the present application. Depending on the context, the word "if" used may be interpreted as "when ..." or "when ..." or "in response to ...".

[0014] In accordance with an embodiment of the present invention, an encoding and decoding method, apparatus and device are provided, which relate to the following concepts:

[0015] Intra prediction and inter prediction techniques: Intra prediction is to utilize the spatial domain relevance of video to predict the current pixel using the pixel of the coded block of the current image, thereby achieving the purpose of removing the redundancy in the spatial domain of the video. Inter prediction is to utilize the temporal domain relevance of video to predict the pixel of the current image using the pixel of the coded image nearby, since the video sequence usually has a higher temporal domain relevance, thereby achieving the purpose of effectively removing the redundancy in the temporal domain of the video. The inter prediction part of the main video coding standards uses a block-based motion compensation technique, and the main principle is that each pixel block of the current image searches for one best matching block in the previous coded image, and the process is called motion estimation.

[0016] Motion Vector (MV): In inter-coding, a motion vector is used to represent the relative displacement between a current block and its best matching block in a reference picture. The divided blocks have their corresponding motion vectors transmitted to the decoding side, and the motion vectors of each block are coded and transmitted independently, which consumes a large number of bits, especially when the blocks are divided into small-sized blocks. In order to reduce the number of bits for coding the motion vector, the spatial relationship between neighboring image blocks is used to predict the motion vector of the current block based on the motion vector of the neighboring coded block, and then the prediction difference is coded, thereby effectively reducing the number of bits representing the motion vector. When coding the motion vector of the current block, the motion vector of the current block is predicted using the motion vector of the neighboring coded block, and the difference between the predicted value of the motion vector (MVP, Motion Vector Prediction) and the actual value of the motion vector (MVD, Motion Vector Difference) is coded, thereby effectively reducing the number of coding bits.

[0017] Motion Information: A motion vector represents the position offset between a current block and a certain reference block, so in order to accurately obtain the information of the image block facing the motion vector, reference picture index information is required to indicate which reference picture to use. A reference picture list is created for the current picture, and the reference picture index information indicates which reference picture in the reference picture list the current block uses. Many coding techniques also support multiple reference picture lists, and therefore can use one index value called a reference direction to indicate which reference picture list to use. Information related to motion, such as a motion vector, a reference picture index, and a reference direction, is called motion information.

[0018] Interpolation: If the current motion vector has non-integer pixel accuracy, we cannot directly copy the existing pixel values ​​from the reference picture corresponding to the current block, and the required pixel values ​​of the current block can only be obtained by interpolation. As shown in Figure 1A, the pixel value Y 1 / 2 If it is necessary to obtain a pixel value X, it can be obtained by interpolating the surrounding existing pixel values ​​X. For example, if an interpolation filter with N taps is used, it is necessary to obtain the pixel value X by interpolating N integer pixels.

[0019] For example, if the number of taps is 8,

number

[0020] Motion compensation: Motion compensation is the process of obtaining all pixel values ​​of the current block by interpolating or copying.

[0021] Merge mode: includes normal fusion mode (i.e., normal merge mode, also called regular merge mode), subblock mode (fusion mode using subblock motion information, also called subblock fusion mode), MMVD mode (fusion mode that encodes motion differentials, also called merge with MVD mode), CIIP mode (fusion mode that combines inter-intra predictions to generate a new predicted value, also called combine inter intra prediciton mode), TPM mode (fusion mode for triangular prediction, also called triangular prediction mode), and GEO mode (fusion mode based on an arbitrary geometric partition shape, also called Geometrical Partitioning).

[0022] Skip mode: Skip mode is a special fusion mode, and the difference between skip mode and fusion mode is that in skip mode, the residual does not need to be coded. If the current block is in skip mode, CIIP mode is off by default, but normal fusion mode, sub-block mode, MMVD mode, TPM mode, and GEO mode are still applicable.

[0023] Exemplarily, it is determined how to generate the prediction based on the normal fusion mode, sub-block mode, MMVD mode, CIIP mode, TPM mode, GEO mode, etc. After generating the prediction, in the fusion mode, the prediction and the residual may be used to obtain the reconstructed value. In the skip mode, the residual does not exist and the prediction is directly used to obtain the reconstructed value.

[0024] Sequence Parameter Set (SPS): A sequence parameter set contains a flag that determines whether a tool is allowed to be enabled or disabled in the entire sequence. If the flag has a value of 1, the tool corresponding to the flag is allowed to be enabled in the video sequence, and if the flag has a value of 0, the tool corresponding to the flag is not allowed to be enabled in the encoding process in the video sequence.

[0025] Normal fusion mode: Select one motion information from a candidate motion information list, and generate a predicted value of the current block based on the motion information. The candidate motion information list includes motion information of block candidates that are adjacent in the spatial domain, motion information of block candidates that are adjacent in the time domain, motion information of block candidates that are not adjacent in the spatial domain, motion information obtained by combining based on existing motion information, default motion information, etc.

[0026] MMVD mode: According to the candidate motion information list of the normal fusion mode, select one motion information from the candidate motion information list of the normal fusion mode as reference motion information, and obtain the motion information difference by a table lookup method. Obtain the final motion information according to the reference motion information and the motion information difference, and generate a prediction value of the current block according to the final motion information.

[0027] CIIP mode: The intra prediction value and the inter prediction value are combined to obtain a new prediction value for the current block.

[0028] Sub-block modes: The sub-block modes include Affine fusion mode and sub-block TMVP mode.

[0029] The Affine fusion mode is similar to the normal fusion mode, and selects one motion information from the candidate motion information list and generates a prediction value of the current block based on the selected motion information. The difference with the normal fusion mode is that the motion information in the candidate motion information list of the normal fusion mode is a two-parameter translation motion vector, while the motion information in the candidate motion information list of the Affine fusion mode is four-parameter Affine motion information or six-parameter Affine motion information.

[0030] The subblock-based temporal motion vector prediction (TMVP) mode directly reuses the motion information of a reference block in a time-domain reference picture to generate a prediction value for the current block, and the motion information of each subblock within the block may not be the same.

[0031] TPM mode: A block is divided into two triangular sub-blocks (there are two triangular sub-blocks of 45 degrees and 135 degrees), and these two triangular sub-blocks have different unidirectional motion information. TPM mode is only used in the prediction process and does not affect the subsequent transformation and quantization processes, and the unidirectional motion information here is also directly obtained from the candidate motion information list.

[0032] GEO mode: GEO mode is similar to TPM mode, but the division shape is different. In GEO mode, one quadrilateral block is divided into two sub-blocks of any shape (any other shape except the shape of two triangular sub-blocks of TPM, for example, one triangular sub-block and one pentagonal sub-block, or one triangular sub-block and one quadrilateral sub-block, or two trapezoidal sub-blocks, etc.), and the division shape is not limited. The two sub-blocks divided in GEO mode have different unidirectional motion information.

[0033] As can be seen from the above examples, the fusion mode and skip mode in this embodiment are prediction modes that directly select one motion information from a candidate motion information list and generate a predicted value for the current block, and these prediction modes do not require a motion search process to be performed on the encoding side, and modes other than the MMVD mode do not require encoding of the motion information difference.

[0034] SMVD (Symmetric Motion Vector Difference) mode: The two MVDs of bidirectional motion information in SMVD mode are symmetric, i.e., only one MVD needs to be coded, and the other MVD is a negative MVD. SMVD mode means that the motion vector difference in one direction of a bidirectional prediction mode is directly estimated and obtained from the motion vector difference in another direction without coding. For example, a simple estimation method is to directly scale the motion vector difference in one direction, and the scaling coefficient is related to the distance from two reference pictures to the current picture.

[0035] Translational motion model: The motion model can include, but is not limited to, a two-parameter motion model (e.g., a two-parameter motion vector), a four-parameter motion model (e.g., a four-parameter affine model), a six-parameter motion model (e.g., a six-parameter affine model), an eight-parameter motion model (e.g., a projection model), etc. The translational motion model refers to a two-parameter motion model, where translation means moving all points of an image the same distance in a certain linear direction in the same plane, and such image motion is called the translational motion of the image, and is abbreviated as translation.

[0036] Video encoding framework: As shown in FIG. 1B, the encoding side processing process of the embodiment of the present invention can be realized using a video encoding framework, and the schematic diagram of the video decoding framework is the same as FIG. 1B, and is omitted here. The decoding side processing process of the embodiment of the present invention can be realized using a video decoding framework. Specifically, the video encoding framework and the video decoding framework include modules such as intra prediction, motion estimation / motion compensation, reference picture buffer, loop filtering, reconstruction, transform, quantization, inverse transform, inverse quantization, and entropy encoder. On the encoding side, the encoding side processing process can be realized by the cooperation between these modules, and on the decoding side, the decoding side processing process can be realized by the cooperation between these modules.

[0037] In the related art, when the current block is a bidirectional block (i.e., the current block is a block using bidirectional prediction), the predicted images from two different directions often have a mirror symmetric relationship, but the current coding framework does not utilize this characteristic to further remove redundancy, resulting in problems such as low coding performance. Regarding the above discovery, in an embodiment of the present invention, when the current block is a bidirectional block, if it is determined to activate a bidirectional predictor compensation mode (i.e., a bidirectional optical flow mode) for the current block, motion compensation based on the bidirectional predictor compensation mode can be performed for the current block, thereby solving problems such as low prediction quality and prediction error, improving hardware realization ease, improving coding performance, and improving coding performance and coding efficiency. Exemplarily, the current block being a block using bidirectional prediction means that the motion information of the current block is bidirectional motion information, and the bidirectional motion information includes motion information in two different directions, called first unidirectional motion information and second unidirectional motion information. The first unidirectional motion information corresponds to a first reference picture, and the first reference picture may be before the current picture in which the current block is located. The second unidirectional motion information corresponds to a second reference picture, which may be after the current picture in which the current block resides.

[0038] The encoding and decoding methods of the embodiments of the present invention will be described in detail below in conjunction with some specific embodiments.

[0039] Example 1: As shown in FIG. 2, this is a flowchart of the encoding and decoding method provided in an embodiment of the present invention, where the encoding and decoding method can be applied to the decoding side or the encoding side, and the encoding and decoding method can include step 201 and step 202.

[0040] In step 201, As the control information, a condition that allows the current block to use the bidirectional predictor compensation mode; The condition that the current block uses a translational motion model, The prediction mode of the current block is neither sub-block mode, nor SMVD mode, nor CIIP mode. A prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the two reference pictures are respectively before and after the current picture in the display order, and the distances from the two reference pictures to the current picture are the same; The condition that the weighting weights of the two reference pictures of the current block are the same; The condition that both of the reference pictures of the current block are short-term reference pictures; The width, height and area of ​​the current block are all within the specified range. The condition that the sizes of the two reference pictures of the current block are both the same as the size of the current picture; If all the conditions for performing luminance component prediction compensation on the current block are met, it is determined that the bidirectional prediction compensation mode is to be activated on the current block.

[0041] In one possible embodiment, As the control information, a condition that allows the current block to use the bidirectional predictor compensation mode; The condition that the current block uses a translational motion model, The prediction mode of the current block is neither sub-block mode, nor SMVD mode, nor CIIP mode. A prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the two reference pictures are respectively before and after the current picture in the display order, and the distances from the two reference pictures to the current picture are the same; The condition that the weighting weights of the two reference pictures of the current block are the same; The condition that both of the reference pictures of the current block are short-term reference pictures; The width, height and area of ​​the current block are all within the specified range. The condition that the sizes of the two reference pictures of the current block are both the same as the size of the current picture; If any of the conditions for performing luminance component prediction compensation on the current block is not met, it is determined not to activate the bidirectional prediction compensation mode on the current block.

[0042] In the above embodiment, nine conditions are given, and whether to activate the bidirectional predictor compensation mode for the current block is determined according to whether the nine conditions are simultaneously satisfied.

[0043] In practical application, some of the nine conditions may be further selected, and whether to activate the bidirectional predictor compensation mode for the current block may be determined based on the selected some conditions. For example, five of the nine conditions may be selected, and this selection method is not limited, and may be any five conditions. If all five selected conditions are met, it is determined to activate the bidirectional predictor compensation mode for the current block, and if any of the five selected conditions is not met, it is determined not to activate the bidirectional predictor compensation mode for the current block. Of course, other numbers of conditions may be selected from the nine conditions, but this is not limited.

[0044] In the above embodiment, the prediction value of the current block is obtained by weighting the reference blocks from two reference pictures means that the current block uses a bidirectional prediction mode, that is, the prediction value of the current block is obtained by weighting the reference blocks (prediction blocks) from two reference pictures. The current block corresponds to two lists of motion information, which are the first motion information (i.e., the first unidirectional motion information) and the second motion information (i.e., the second unidirectional motion information), and the first motion information includes the first reference picture and the first original motion vector, and the second motion information includes the second reference picture and the second original motion vector. The two reference pictures may be the first reference picture and the second reference picture. The display order of the two reference pictures is respectively before and after the current picture means that the first reference picture is before the current picture in which the current block is located, and the second reference picture is after the current picture. The first reference picture is also called a forward reference picture in the first list (e.g., list0), and the second reference picture is also called a backward reference picture in the second list (e.g., list1).

[0045] In the above embodiment, the width, height and area of ​​the current block are all within the limited range may include, but are not limited to, the width is equal to or greater than the first threshold, the height is equal to or greater than the second threshold, and the area is equal to or greater than the third threshold, or the width is equal to or greater than the first threshold, the height is equal to or greater than the second threshold, and the area is greater than the fourth threshold. Exemplarily, the third threshold may be greater than the fourth threshold. For example, the first threshold may be 8, the second threshold may be 8, the third threshold may be 128, and the fourth threshold may be 64. Of course, the above values ​​are only some examples and are not limited thereto.

[0046] In the above embodiment, the control information allowing the current block to use the bidirectional predictor compensation mode may include, but is not limited to, sequence level control information (e.g., control information for a multi-picture image) allowing the current block to use the bidirectional predictor compensation mode and / or picture level control information (e.g., control information for a single-picture image) allowing the current block to use the bidirectional predictor compensation mode.

[0047] In step 202, if it is determined to activate the bidirectional predictor compensation mode for the current block, motion compensation based on the bidirectional predictor compensation mode is performed for the current block.

[0048] In one possible embodiment, when it is determined to activate the bidirectional predictor compensation mode for the current block, for each sub-block of at least one sub-block included in the current block, a first original predicted value and a second original predicted value of the sub-block are determined, and a horizontal rate and a vertical rate of the sub-block are determined according to the first original predicted value and the second original predicted value. A prediction compensation value of the sub-block is obtained according to the horizontal rate and the vertical rate, and a target prediction value of the sub-block is obtained according to the first original predicted value, the second original predicted value and the prediction compensation value. A prediction value of the current block is determined according to the target prediction value of each sub-block.

[0049] Exemplarily, the step of determining the first original predicted value and the second original predicted value of the sub-block may include, but is not limited to, a step of determining a unit block corresponding to the sub-block, where the current block may include the unit block, and the unit block may include the sub-block; a step of determining a first reference block from a first reference picture based on the first unidirectional motion information of the unit block, extending the first reference block, obtaining a second reference block, selecting a first target reference block corresponding to the sub-block from the second reference block, and determining a first original predicted value of the sub-block based on pixel values ​​of the first target reference block; and a step of determining a third reference block from a second reference picture based on the second unidirectional motion information of the unit block, extending the third reference block, obtaining a fourth reference block, selecting a second target reference block corresponding to the sub-block from the fourth reference block, and determining a second original predicted value of the sub-block based on pixel values ​​of the second target reference block.

[0050] Exemplarily, the step of extending the first reference block to obtain the second reference block may include filling N rows of integer pixel points at the top and bottom edges of the first reference block, respectively, and filling N columns of integer pixel points at the left and right edges of the first reference block, respectively, to obtain the second reference block. N is 0 or a positive integer. The pixel values ​​of the integer pixel points of the N rows filled in the second reference block and the pixel values ​​of the integer pixel points of the N columns filled in are obtained by copying pixel values ​​of neighboring integer pixel positions in the first reference picture, or the pixel values ​​of the integer pixel points of the N rows filled in the second reference block and the pixel values ​​of the integer pixel points of the N columns filled in are obtained by copying pixel values ​​of neighboring pixel points in the first reference block.

[0051] Exemplarily, the step of extending the third reference block to obtain a fourth reference block may include filling N rows of integer pixel points at the top and bottom edges of the third reference block, respectively, and filling N columns of integer pixel points at the left and right edges of the third reference block, respectively, to obtain a fourth reference block. N is 0 or a positive integer. The pixel values ​​of the N rows of integer pixel points and the pixel values ​​of the N columns of integer pixel points filled in the fourth reference block are obtained by copying pixel values ​​of neighboring integer pixel positions in the second reference picture, or the pixel values ​​of the N rows of integer pixel points and the pixel values ​​of the N columns of integer pixel points filled in the fourth reference block are obtained by copying pixel values ​​of neighboring pixel points in the third reference block.

[0052] In one possible embodiment, the step of determining a horizontal rate of a sub-block based on the first original predicted value and the second original predicted value may include a step of determining a coefficient S1 and a coefficient S3 based on the first original predicted value and the second original predicted value, and a step of determining a horizontal rate of the sub-block based on the coefficient S1, the coefficient S3 and a rate threshold.

[0053] The step of determining the vertical rate of the sub-block based on the first original predicted value and the second original predicted value may include the steps of determining a coefficient S2, a coefficient S5 and a coefficient S6 based on the first original predicted value and the second original predicted value, and determining a vertical rate of the sub-block based on the coefficient S2, the coefficient S5, the coefficient S6, a rate threshold and the horizontal rate of the sub-block.

[0054] For example, the determination manner and related definitions of the coefficients S1, S3, S2, S5 and S6 may refer to the later embodiments, and are omitted here.

[0055] Illustratively, the horizontal rate of a sub-block refers to the horizontal (i.e., X-direction) rate of the sub-block's corresponding reference block in a reference picture (i.e., a reference block located in the reference picture and corresponding to the sub-block).

[0056] Illustratively, the vertical rate of a sub-block means the vertical (ie, Y) rate of the sub-block's corresponding reference block in a reference picture (ie, a reference block located in the reference picture and corresponding to the sub-block).

[0057] In one possible embodiment, obtaining a predicted compensation value of a sub-block based on the horizontal rate and the vertical rate may include, but is not limited to, determining a first horizontal gradient and a first vertical gradient based on a first original predicted value, determining a second horizontal gradient and a second vertical gradient based on a second original predicted value, and then obtaining a predicted compensation value of the sub-block based on the horizontal rate, the first horizontal gradient, the second horizontal gradient, the vertical rate, the first vertical gradient, and the second vertical gradient.

[0058] Exemplarily, for each pixel position of the sub-block, the first horizontal gradient is the corresponding horizontal gradient of the pixel position in the first reference picture, the first vertical gradient is the corresponding vertical gradient of the pixel position in the first reference picture, the second horizontal gradient is the corresponding horizontal gradient of the pixel position in the second reference picture, and the second vertical gradient is the corresponding vertical gradient of the pixel position in the second reference picture. The horizontal rate is the horizontal rate of the sub-block (i.e., each pixel position in the sub-block corresponds to the same horizontal rate), and the vertical rate is the vertical rate of the sub-block (i.e., each pixel position in the sub-block corresponds to the same vertical rate).

[0059] As described above, for each pixel position of the subblock, a predicted compensation value of the pixel position is determined according to the first horizontal gradient, the second horizontal gradient, the horizontal rate, the vertical rate, the first vertical gradient and the second vertical gradient corresponding to the pixel position, and then a target predicted value of the pixel position is obtained according to the first original predicted value, the second original predicted value and the predicted compensation value corresponding to the pixel position.

[0060] Exemplarily, for each sub-block, after obtaining the target predicted value of each pixel position of the sub-block, the target predicted values ​​of these pixel positions are configured as the target predicted value of the sub-block. For the current block, after obtaining the target predicted value of each sub-block of the current block, the target predicted values ​​of these sub-blocks are configured as the predicted value of the current block.

[0061] As can be seen from the above technical solutions, in an embodiment of the present invention, when it is determined to activate a bidirectional predictor compensation mode for a current block, motion compensation based on the bidirectional predictor compensation mode can be performed for the current block, thereby solving problems such as low prediction quality and prediction error, improving hardware realization ease, improving coding performance, and improving coding performance and coding efficiency.

[0062] Example 2: Based on the same idea as the above method, as shown in FIG. 3, is a flowchart of another encoding and decoding method provided in an embodiment of the present invention, which can be applied to the decoding side, and the method can include steps 301 to 307.

[0063] In step 301, the encoding side determines whether to activate the bidirectional predictor compensation mode for the current block. If yes, perform step 302; if not, there is no need to use the bidirectional predictor compensation mode provided in the present invention, and the process in this case is not limited.

[0064] For example, if the encoding side decides to activate the bidirectional predictor compensation mode for the current block, it indicates that the prediction value obtained based on the motion information is not sufficiently accurate, so it activates the bidirectional predictor compensation mode for the current block (i.e., the solution of the technology of the present invention) and performs step 302. If the decoding side decides not to activate the bidirectional predictor compensation mode for the current block, it indicates that the prediction value obtained based on the motion information is sufficiently accurate, so it does not activate the bidirectional predictor compensation mode for the current block.

[0065] For example, the decoding side receives a codestream, and determines whether to activate a bidirectional predictor compensation mode for a current block based on the decoded information in the codestream (obtaining whether the relevant condition of Example 1 is satisfied based on the decoded information).

[0066] In step 302, if it is determined to activate the bidirectional prediction compensation mode for the current block, for each sub-block among the at least one sub-block included in the current block, the decoding side determines a first original prediction value and a second original prediction value of the sub-block.

[0067] Exemplarily, the current block may be divided into at least one unit block, for example, the current block may include one unit block (i.e., the unit block is the current block), or the current block may include at least two unit blocks. For example, the width of the unit block is dx, the height is dy, and the width of the current block is W, and the height is H. If W is greater than a, dx is a, and if W is equal to or less than a, dx is W. If H is greater than a, dy is a, and if H is equal to or less than a, dy is H. The value of a can be empirically set, and may be, for example, 4, 8, 16, 32, etc. For convenience of explanation, the following description will be given with a=16 as an example. For example, if the size of the current block is 8*16, the current block includes only one unit block with a size of 8*16. Also, for example, if the size of the current block is 8*32, the current block includes unit block 1 and unit block 2, both of which are 8*16 in size. For example, if the size of the current block is 16*32, the current block includes unit block 1 and unit block 2, both of which are 16*16 in size. Of course, the above are only some examples, and are not limited thereto. For convenience of explanation, the following description will be given taking as an example that the current block is divided into unit block 1 and unit block 2, both of which are 16*16 in size.

[0068] For each unit block, the unit block may be divided into at least one subblock. For example, if the size of the subblock is 4*4, the unit block 1 may be divided into 16 subblocks, and the unit block 2 may be divided into 16 subblocks. For example, if the size of the subblock is 8*8, the unit block 1 may be divided into 4 subblocks, and the unit block 2 may be divided into 4 subblocks. For example, if the size of the subblock is 16*16, the unit block 1 may be divided into one subblock, and the unit block 2 may be divided into one subblock. Of course, the above are only some examples, and are not limited thereto. For convenience of explanation, the following will be described as an example in which the unit block 1 is divided into 16 subblocks and the unit block 2 is divided into 16 subblocks.

[0069] For each unit block (hereinafter, unit block 1 is taken as an example), a first reference block is determined from a first reference picture based on the first unidirectional motion information of unit block 1, the size of unit block 1 is 16*16, and the size of the first reference block is 16*16. Next, the first reference block is expanded to obtain a second reference block, for example, filling N rows of integer pixel points at the upper edge and lower edge of the first reference block, respectively, filling N columns of integer pixel points at the left edge and right edge of the first reference block, respectively, to obtain a second reference block. When N is 1, the size of the second reference block is 18*18, when N is 2, the size of the second reference block is 20*20, and the same applies to others. Hereinafter, the size of the second reference block is 18*18 as an example. A third reference block with a size of 16*16 is determined from a second reference picture based on the second unidirectional motion information of unit block 1. Then, the third reference block is expanded to obtain a fourth reference block, for example, fill N rows of integer pixel points at the top and bottom edges of the third reference block, respectively, and fill N columns of integer pixel points at the left and right edges of the third reference block, respectively, to obtain a fourth reference block. When N is 1, the size of the fourth reference block is 18*18, when N is 2, the size of the fourth reference block is 20*20, and so on. In the following, the size of the fourth reference block is taken as an example to be 18*18.

[0070] Exemplarily, if the current block is a bidirectional block (i.e., the current block is a block using bidirectional prediction), bidirectional motion information corresponding to the current block can be obtained, and the obtaining manner is not limited. The bidirectional motion information includes two different directional motion information called first unidirectional motion information (e.g., a first motion vector and a first reference picture index) and second unidirectional motion information (e.g., a second motion vector and a second reference picture index). Based on the first unidirectional motion information, a first reference picture (e.g., reference picture 0) that is before the current picture in which the current block is located can be determined, and based on the second unidirectional motion information, a second reference picture (e.g., reference picture 1) that is after the current picture in which the current block is located can be determined.

[0071] Illustratively, for each unit block of the current block, the first unidirectional motion information of the unit block is the same as the first unidirectional motion information of the current block, and the second unidirectional motion information of the unit block is the same as the second unidirectional motion information of the current block.

[0072] For each subblock of the unit block 1 (hereinafter, taking the subblock 11 as an example), select a first target reference block corresponding to the subblock 11 from the second reference block having a size of 18*18, the size of the subblock 11 may be 4*4, the size of the first target reference block may be 6*6, and determine a first original predicted value of the subblock 11 according to the pixel value of the first target reference block. Select a second target reference block corresponding to the subblock 11 from the fourth reference block having a size of 18*18, the size of the second target reference block may be 6*6, and determine a second original predicted value of the subblock 11 according to the pixel value of the second target reference block.

[0073] In step 303, the decoding side determines the horizontal rate of the sub-block based on the first original predicted value and the second original predicted value.

[0074] For example, the decoding side determines the coefficients S1 and S3 based on the first original predicted value and the second original predicted value, and determines the horizontal rate of the sub-block based on the coefficients S1 and S3 and a rate threshold value.

[0075] In step 304, the decoding side determines the vertical rate of the sub-block based on the first original predicted value and the second original predicted value.

[0076] For example, the decoding side determines coefficients S2, S5, and S6 based on the first original predicted value and the second original predicted value, and determines the vertical rate of the sub-block based on the coefficients S2, S5, and S6, a rate threshold, and the horizontal rate of the sub-block.

[0077] In step 305, the decoding side obtains a predicted compensation value of the sub-block based on the horizontal rate and the vertical rate.

[0078] In step 306, the decoding side obtains a target predicted value of the sub-block according to the first original predicted value, the second original predicted value and the prediction compensation value.

[0079] Illustratively, in steps 305 and 306, for each pixel position of the sub-block, a corresponding first horizontal gradient and a first vertical gradient for the pixel position in a first reference picture may be determined, and a corresponding second horizontal gradient and a second vertical gradient for the pixel position in a second reference picture may be determined.

[0080] Then, determine a predicted compensation value for the pixel position according to the first horizontal gradient, the second horizontal gradient, the first vertical gradient, the second vertical gradient, the horizontal rate (i.e., the horizontal rate of the subblock, where each pixel position in the subblock corresponds to the same horizontal rate), and the vertical rate (i.e., the vertical rate of the subblock, where each pixel position in the subblock corresponds to the same vertical rate) corresponding to the pixel position. Then, obtain a target predicted value for the pixel position according to the first original predicted value, the second original predicted value, and the predicted compensation value corresponding to the pixel position.

[0081] Illustratively, for each sub-block, after obtaining the target predicted values ​​for each pixel location of the sub-block, the target predicted values ​​of these pixel locations may be configured as the target predicted values ​​of the sub-block.

[0082] In step 307, the decoder determines a prediction value for the current block based on the target prediction value of each subblock.

[0083] Example 3: Based on the same idea as the above method, as shown in FIG. 4, is a flowchart of another encoding and decoding method provided in an embodiment of the present invention, which can be applied to the encoding side, and the method can include steps 401 to 407.

[0084] In step 401, the encoding side determines whether to activate the bidirectional predictor compensation mode for the current block. If yes, perform step 402; if not, there is no need to use the bidirectional predictor compensation mode provided in the present invention, and the process in this case is not limited.

[0085] Exemplarily, if the encoding side decides to activate the bidirectional predictor compensation mode for the current block, it indicates that the prediction value obtained based on the motion information is sufficiently accurate, so it activates the bidirectional predictor compensation mode for the current block (i.e., the solution of the technique of the present invention) and performs step 402. If the encoding side decides not to activate the bidirectional predictor compensation mode for the current block, it indicates that the prediction value obtained based on the motion information is sufficiently accurate, so it does not activate the bidirectional predictor compensation mode for the current block.

[0086] In step 402, if it is determined to activate the bidirectional predictor compensation mode for the current block, the encoding side determines, for each sub-block among the at least one sub-block included in the current block, a first original predicted value and a second original predicted value of the sub-block.

[0087] In step 403, the encoding side determines a horizontal rate of the sub-block based on the first original predicted value and the second original predicted value.

[0088] In step 404, the encoding side determines a vertical rate of the sub-block based on the first original predicted value and the second original predicted value.

[0089] In step 405, the encoding side obtains a predicted compensation value for the sub-block based on the horizontal rate and the vertical rate.

[0090] In step 406, the encoding side obtains a target predicted value of the sub-block according to the first original predicted value, the second original predicted value and the prediction compensation value.

[0091] In step 407, the encoder determines a prediction value for the current block based on the target prediction value of each sub-block.

[0092] Illustratively, steps 401 to 407 can refer to steps 301 to 307, which are omitted here.

[0093] Example 4: Example 1 to Example 3 are related to determining whether to activate bidirectional predictor compensation mode for a current block. Hereinafter, the activation process of bidirectional predictor compensation mode will be described in conjunction with Example 4. In one possible embodiment, the following activation conditions can be given. Of course, the following activation conditions are only one example of the present invention, and in practical application, the following activation conditions can be arbitrarily combined, which is not limited.

[0094] Exemplarily, if all of the following activation conditions are satisfied, it may be determined that the bidirectional predictor compensation mode is activated for the current block. If any or a plurality of the following activation conditions are not satisfied, it may be determined that the bidirectional predictor compensation mode is not activated for the current block.

[0095] 1. The control information allows the current block to use bidirectional predictor compensation mode.

[0096] By way of example, the control information may include, but is not limited to, sequence level control information and / or picture level control information.

[0097] In one possible embodiment, sequence level (e.g., multi-frame image) control information may include, but is not limited to, a control flag (e.g., sps_cur_tool_enabled_flag), and picture level (e.g., one-frame image) control information may include, but is not limited to, a control flag (e.g., pic_cur_tool_disabled_flag). When sps_cur_tool_enabled_flag is a first value and pic_cur_tool_disabled_flag is a second value, it indicates that the current block is allowed to use bidirectional predictor compensation mode.

[0098] sps_cur_tool_enabled_flag indicates whether all pictures in the sequence are allowed to use the bidirectional predictor compensation mode. pic_cur_tool_disabled_flag indicates whether blocks in the current picture are not allowed to use the bidirectional predictor compensation mode.

[0099] For example, when sps_cur_tool_enabled_flag is a first value, it indicates that all images in the sequence are permitted to use the bidirectional predictor compensation mode. When pic_cur_tool_disabled_flag is a second value, it indicates that each block in the current image is permitted to use the bidirectional predictor compensation mode. Also, for example, when sps_cur_tool_enabled_flag is a second value and / or pic_cur_tool_disabled_flag is a first value, it indicates that the current block is not permitted to use the bidirectional predictor compensation mode, i.e., the control information indicates that the current block is not permitted to use the bidirectional predictor compensation mode.

[0100] In another possible embodiment, the sequence level (e.g., multi-frame image) control information may include, but is not limited to, a control flag (e.g., sps_cur_tool_disabled_flag) and the picture level (e.g., one frame image) control information may include, but is not limited to, a control flag (e.g., pic_cur_tool_disabled_flag), where sps_cur_tool_disabled_flag is a second value, and pic_cur_tool_disabled_flag being a second value indicates that the current block is allowed to use bidirectional predictor compensation mode.

[0101] sps_cur_tool_disabled_flag indicates whether all pictures in the sequence are not allowed to use the bidirectional predictor compensation mode. pic_cur_tool_disabled_flag indicates whether each block in the current picture is not allowed to use the bidirectional predictor compensation mode.

[0102] For example, when sps_cur_tool_disabled_flag is a second value, it indicates that all images in the sequence are allowed to use the bidirectional predictor compensation mode. When pic_cur_tool_disabled_flag is a second value, it indicates that each block in the current image is allowed to use the bidirectional predictor compensation mode. Also, for example, when sps_cur_tool_disabled_flag is a first value and / or when pic_cur_tool_disabled_flag is a first value, it indicates that the current block is not allowed to use the bidirectional predictor compensation mode, i.e., the control information indicates that the current block is not allowed to use the bidirectional predictor compensation mode.

[0103] In another possible embodiment, the sequence level (e.g., multi-frame image) control information may include, but is not limited to, a control flag (e.g., sps_cur_tool_enabled_flag), and the picture level (e.g., one-frame image) control information may include, but is not limited to, a control flag (e.g., pic_cur_tool_enabled_flag), where sps_cur_tool_enabled_flag is a first value, and pic_cur_tool_enabled_flag is a first value indicating that the current block is allowed to use bidirectional predictor compensation mode.

[0104] sps_cur_tool_enabled_flag indicates whether all pictures in the sequence are allowed to use the bidirectional predictor compensation mode. pic_cur_tool_enabled_flag indicates whether each block in the current picture is allowed to use the bidirectional predictor compensation mode.

[0105] For example, when sps_cur_tool_enabled_flag is a first value, it indicates that all images in the sequence are allowed to use the bidirectional predictor compensation mode. When pic_cur_tool_enabled_flag is a first value, it indicates that each block in the current image is allowed to use the bidirectional predictor compensation mode. Also, for example, when sps_cur_tool_enabled_flag is a second value and / or when pic_cur_tool_enabled_flag is a second value, it indicates that the current block is not allowed to use the bidirectional predictor compensation mode, i.e., the control information indicates that the current block is not allowed to use the bidirectional predictor compensation mode.

[0106] In another possible embodiment, the sequence level (e.g., multi-frame image) control information may include, but is not limited to, a control flag (e.g., sps_cur_tool_disabled_flag), and the picture level (e.g., one-frame image) control information may include, but is not limited to, a control flag (e.g., pic_cur_tool_enabled_flag). When sps_cur_tool_disabled_flag is a second value and pic_cur_tool_enabled_flag is a first value, it indicates that the current block is allowed to use bidirectional predictor compensation mode.

[0107] sps_cur_tool_disabled_flag indicates whether to disallow all pictures in the sequence to use bidirectional predictor compensation mode. pic_cur_tool_enabled_flag indicates whether to allow each block in the current picture to use bidirectional predictor compensation mode.

[0108] For example, when sps_cur_tool_disabled_flag is a second value, it indicates that all images in the sequence are permitted to use the bidirectional predictor compensation mode. When pic_cur_tool_enabled_flag is a first value, it indicates that each block in the current image is permitted to use the bidirectional predictor compensation mode. Also, for example, when sps_cur_tool_disabled_flag is a first value and / or pic_cur_tool_enabled_flag is a second value, it indicates that the current block is not permitted to use the bidirectional predictor compensation mode, i.e., the control information indicates that the current block is not permitted to use the bidirectional predictor compensation mode.

[0109] In the above embodiment, the first value may be 1 and the second value may be 0, or the first value may be 0 and the second value may be 1, of course, the above are only two examples of the present application and are not limited thereto.

[0110] Illustratively, a frame or a picture herein corresponds to an image, e.g., a current picture represents a current image and a reference picture represents a reference image.

[0111] 2. The current block uses a translational motion model.

[0112] Exemplarily, the current block uses a translational motion model, that is, the motion model index MotionModelIdc of the current block is 0, which means the motion model index of the translational motion model (ie, the two-parameter motion model).

[0113] Illustratively, the current block uses a translational motion model means that the current block does not use a non-translational motion model, which in one possible embodiment may include, but is not limited to, a four-parameter or six-parameter affine motion model.

[0114] Exemplarily, it is indicated that activation condition 2 is not satisfied if the current block does not use a translational motion model, or if the motion model index MotionModelIdc of the current block is not 0, or if the current block uses a non-translational motion model (e.g., a 4-parameter or 6-parameter affine motion model), it is indicated that activation condition 2 is not satisfied.

[0115] 3. The prediction mode of the current block is neither the sub-block mode, nor the SMVD mode, nor the CIIP mode.

[0116] For example, if the prediction mode of the current block does not use subblock mode (e.g., merge_subblock_flag of the current block is 0), if the prediction mode of the current block does not use SMVD mode (e.g., sym_mvd_flag of the current block is 0), and if the prediction mode of the current block does not use CIIP mode (e.g., ciip_flag of the current block is 0), it is indicated that the current block is allowed to use bidirectional predictor compensation mode.

[0117] For example, when the prediction mode of the current block (e.g., inter prediction mode) is fusion mode or skip mode, and the prediction mode of the current block is normal fusion mode, it is indicated that the prediction mode of the current block is not sub-block mode, SMVD mode, or CIIP mode. For example, when the prediction mode of the current block is fusion mode or skip mode, and the prediction mode of the current block is MMVD mode, it is indicated that the prediction mode of the current block is not sub-block mode, SMVD mode, or CIIP mode. For example, when the prediction mode of the current block is fusion mode or skip mode, and the prediction mode of the current block is TPM mode, it is indicated that the prediction mode of the current block is not sub-block mode, SMVD mode, or CIIP mode. For example, when the prediction mode of the current block is fusion mode or skip mode, and the prediction mode of the current block is GEO mode, it is indicated that the prediction mode of the current block is not sub-block mode, SMVD mode, or CIIP mode. Of course, the above are only some examples, and are not limited thereto.

[0118] Exemplarily, if the prediction mode of the current block is a sub-block mode, it is indicated that the current block is not permitted to use the bidirectional predictor compensation mode, i.e., the start-up condition 3 is not satisfied. Or, if the prediction mode of the current block is an SMVD mode, it is indicated that the current block is not permitted to use the bidirectional predictor compensation mode, i.e., the start-up condition 3 is not satisfied. Or, if the prediction mode of the current block is a CIIP mode, it is indicated that the current block is not permitted to use the bidirectional predictor compensation mode, i.e., the start-up condition 3 is not satisfied.

[0119] 4. The predicted value of the current block is obtained by weighting the reference blocks (i.e., predicted blocks) from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same.

[0120] For example, the prediction value of the current block is obtained by weighting reference blocks from two reference pictures means that the current block uses bidirectional prediction, i.e., the prediction value of the current block is obtained by weighting reference blocks from two reference pictures.

[0121] Exemplarily, the current block may correspond to two lists of motion information, which are the first motion information and the second motion information, where the first motion information includes a first reference picture and a first original motion vector, and the second motion information includes a second reference picture and a second original motion vector. The display order of the two reference pictures is respectively before and after the current picture, which means that the first reference picture is before the current picture in which the current block is located, and the second reference picture is located after the current picture.

[0122] In one possible embodiment, it is indicated that if the current block has motion information (e.g., two reference pictures and two motion vectors) from two lists (e.g., list0 and list1), the display order of the two reference pictures is before and after the current picture, respectively, and the distances from the two reference pictures to the current picture are the same, the current block is allowed to use bidirectional predictor compensation mode.

[0123] If the display order of two reference pictures is before and after the current picture, respectively, and the distances from the two reference pictures to the current picture are the same, it can be expressed by the relative relationship between the display order number POC_Cur of the current picture, the display order number POC_0 of the reference picture in list0, and the display order number POC_1 of the reference picture in list1. That is, (POC_1-POC_Cur) is completely equal to (POC_Cur-POC_0).

[0124] Illustratively, the current block uses bidirectional prediction, and the two reference pictures corresponding to the current block are from different directions, i.e., one reference picture corresponding to the current block is before the current picture, and the other reference picture corresponding to the current block is after the current picture.

[0125] Exemplarily, if the current block has only one reference picture, it is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start condition 4 is not satisfied. Or, if the current block has two reference pictures, but the display order of the two reference pictures is both before the current picture, it is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start condition 4 is not satisfied. Or, if the current block has two reference pictures, but the display order of the two reference pictures is both after the current picture, it is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start condition 4 is not satisfied. Or, if the current block has two reference pictures, and the display order of the two reference pictures is respectively before and after the current picture, but the distances from the two reference pictures to the current picture are different, it is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start condition 4 is not satisfied.

[0126] 5. The weighting weights of the two reference pictures of the current block are the same.

[0127] In one possible embodiment, if the weighting weights of the two reference pictures of the current block are the same, it is indicated that the current block is allowed to use the bidirectional predictor compensation mode. Illustratively, if the picture level weighting weights of the two reference pictures are the same, for example, the luma weighting weight (luma_weight_l0_flag[refIdxL0]) of the reference picture refIdxL0 is equal to the luma weighting weight (luma_weight_l1_flag[refIdxL1]) of the reference picture refIdxL1, it is indicated that the weighting weights of the two reference pictures of the current block are the same. Or, if the block level weighting weights of the two reference pictures are the same, for example, the index BcwIdx[xCb][yCb] of the block level weighting value of the current block is 0, it is indicated that the weighting weights of the two reference pictures of the current block are the same. Or, if the picture-level weighting weights of the two reference pictures are the same and the block-level weighting weights of the two reference pictures are the same, it is indicated that the weighting weights of the two reference pictures of the current block are the same.

[0128] Exemplarily, if the weighting weights of the two reference pictures of the current block are different, the current block is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the activation condition 5 is not met. For example, if the picture-level weighting weights of the two reference pictures are different, it indicates that the weighting weights of the two reference pictures of the current block are different. Or, if the block-level weighting weights of the two reference pictures are different, it indicates that the weighting weights of the two reference pictures of the current block are different. Or, if the picture-level weighting weights of the two reference pictures are different and the block-level weighting weights of the two reference pictures are different, it indicates that the weighting weights of the two reference pictures of the current block are different.

[0129] Illustratively, the weighting weight of the two reference pictures of the current block is the weight used during bidirectional weight compensation.For example, for each sub-block of the current block, after obtaining the two predicted values ​​of each sub-block (see the following embodiment for the obtaining process), the two predicted values ​​need to be weighted to obtain the final predicted value of the sub-block.When the two predicted values ​​are weighted, the weights corresponding to the two predicted values ​​are the weighting weights of the two reference pictures of the current block, that is, the weights corresponding to the two predicted values ​​are the same.

[0130] 6. The two reference pictures of the current block are both short-term reference pictures, or the two reference pictures of the current block are not both long-term reference pictures.

[0131] In one possible embodiment, it is shown that if the two reference pictures of the current block are both short-term reference pictures, the current block is allowed to use the bidirectional predictor compensation mode. A short-term reference picture means a reference picture close to the current picture, which is generally an actual image frame.

[0132] Illustratively, if the two reference pictures of the current block are not both short-term reference pictures, the current block is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start-up condition 6 is not met. Or, if one reference picture of the current block is not a short-term reference picture, the current block is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start-up condition 6 is not met. Or, if the two reference pictures of the current block are not both short-term reference pictures, the current block is not allowed to use the bidirectional predictor compensation mode, that is, it indicates that the start-up condition 6 is not met.

[0133] In another possible embodiment, it is shown that if the two reference pictures of the current block are not both long-term reference pictures, the current block is allowed to use bidirectional predictor compensation mode. The indication number POC of the long-term reference picture has no real meaning (condition 4 becomes invalid), and the long-term reference picture means a reference picture that is far from the current picture, or an image frame that is synthesized from several frames of actual images.

[0134] For example, if one reference picture of the current block is a long-term reference picture, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode, that is, the start-up condition 6 is not met. Or, if two reference pictures of the current block are both long-term reference pictures, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode, that is, the start-up condition 6 is not met.

[0135] 7. The width, height and area of ​​the current block are all within the limited range.

[0136] In one possible embodiment, if the width cbWidth of the current block is greater than or equal to a first threshold (e.g., 8), the height cbHeight of the current block is greater than or equal to a second threshold (e.g., 8), and the area of ​​the current block (cbHeight*cbWidth) is greater than or equal to a third threshold (e.g., 128), it is indicated that the current block is allowed to use bidirectional predictor compensation mode.

[0137] Exemplarily, if the width cbWidth of the current block is less than a first threshold, the current block is not permitted to use the bidirectional predictor compensation mode, i.e., it is indicated that the start-up condition 7 is not satisfied. Or, if the height cbHeight of the current block is less than a second threshold, the current block is not permitted to use the bidirectional predictor compensation mode, i.e., it is indicated that the start-up condition 7 is not satisfied. Or, if the area of ​​the current block is less than a third threshold, the current block is not permitted to use the bidirectional predictor compensation mode, i.e., it is indicated that the start-up condition 7 is not satisfied.

[0138] In another possible embodiment, if the width cbWidth of the current block is greater than or equal to a first threshold (e.g., 8), the height cbHeight of the current block is greater than or equal to a second threshold (e.g., 8), and the area of ​​the current block (cbHeight*cbWidth) is greater than a fourth threshold (e.g., 64), it is indicated that the current block is allowed to use bidirectional predictor compensation mode.

[0139] Exemplarily, if the width cbWidth of the current block is less than a first threshold, the current block is not permitted to use the bidirectional predictor compensation mode, i.e., it is indicated that the start-up condition 7 is not satisfied. Or, if the height cbHeight of the current block is less than a second threshold, the current block is not permitted to use the bidirectional predictor compensation mode, i.e., it is indicated that the start-up condition 7 is not satisfied. Or, if the area of ​​the current block is equal to or less than a fourth threshold, the current block is not permitted to use the bidirectional predictor compensation mode, i.e., it is indicated that the start-up condition 7 is not satisfied.

[0140] 8. The size of the two reference pictures of the current block is the same as the size of the current picture (both the length and the width are the same).

[0141] In one possible embodiment, if the size of the reference picture in list0 is the same as the size of the current picture, e.g., the width of the reference picture in list0 is the same as the width of the current picture, the height of the reference picture in list0 is the same as the height of the current picture, and the size of the reference picture in list1 is the same as the size of the current picture, e.g., the width of the reference picture in list1 is the same as the width of the current picture, and the height of the reference picture in list1 is the same as the height of the current picture, it is indicated that the current block is allowed to use bidirectional predictive compensation mode.

[0142] Exemplarily, when the size of at least one of the two reference pictures of the current block is different from the size of the current picture, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode, that is, the start condition 8 is not satisfied. For example, when the width of the reference picture of list0 is different from the width of the current picture, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode. Or, when the height of the reference picture of list0 is different from the height of the current picture, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode. Or, when the width of the reference picture of list1 is different from the width of the current picture, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode. Or, when the height of the reference picture of list1 is different from the height of the current picture, it is indicated that the current block is not allowed to use the bidirectional predictor compensation mode.

[0143] 9. Perform luminance component prediction compensation for the current block, that is, the luminance component needs prediction compensation.

[0144] For example, the pixel value of each pixel position of the current block may include a luminance component and two chrominance components, and when motion compensation based on the bidirectional predictor compensation mode is performed on the pixel value of each pixel position of the current block, if motion compensation is performed on the luminance component of the pixel value, i.e., if the current component is a luminance component, it is indicated that the current block is allowed to use the bidirectional predictor compensation mode.

[0145] For example, when motion compensation is performed on pixel values ​​at each pixel position of the current block, if motion compensation is performed on a chroma component of the pixel value, i.e., if the current component is a chroma component, it is indicated that the current block is not allowed to use bidirectional predictive compensation mode, i.e., activation condition 9 is not satisfied.

[0146] Example 5: As shown in FIG. 5, this is a flowchart of the encoding and decoding method provided in an embodiment of the present invention, where the encoding and decoding method can be applied to the decoding side or the encoding side, and the encoding and decoding method can include step 501 and step 502.

[0147] In step 501, As the control information, a condition that allows the current block to use the bidirectional predictor compensation mode; The condition that the current block uses a translational motion model, The prediction mode of the current block is neither sub-block mode, nor SMVD mode, nor CIIP mode. A prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the two reference pictures are respectively before and after the current picture in the display order, and the distances from the two reference pictures to the current picture are the same; The condition that the weighting weights of the two reference pictures of the current block are the same; The condition that both of the reference pictures of the current block are short-term reference pictures; The width, height and area of ​​the current block are all within the specified range. If all the conditions that the sizes of the two reference pictures of the current block are the same as the size of the current picture are met, it is determined to activate the bidirectional prediction compensation mode for the current block.

[0148] In one possible embodiment, As the control information, a condition that allows the current block to use the bidirectional predictor compensation mode; The condition that the current block uses a translational motion model, The prediction mode of the current block is neither sub-block mode, nor SMVD mode, nor CIIP mode. a prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the two reference pictures are respectively before and after the current picture in the display order, and the distances from the two reference pictures to the current picture are the same; The condition that the weighting weights of the two reference pictures of the current block are the same; The condition that both of the reference pictures of the current block are short-term reference pictures; The width, height and area of ​​the current block are all within the specified range. If any of the conditions that the sizes of the two reference pictures of the current block are both the same as the size of the current picture is not met, it is determined not to activate the bidirectional predictor compensation mode for the current block.

[0149] In the above embodiment, eight conditions are given, and whether to activate the bidirectional predictor compensation mode for the current block is determined according to whether the eight conditions are simultaneously met.

[0150] In practical application, some of the eight conditions may be further selected, and whether to activate the bidirectional predictor compensation mode for the current block may be determined based on the selected some conditions. For example, five of the eight conditions may be selected, and this selection method is not limited, and may be any five conditions. If all five selected conditions are met, it is determined to activate the bidirectional predictor compensation mode for the current block, and if any of the five selected conditions is not met, it is determined not to activate the bidirectional predictor compensation mode for the current block. Of course, other numbers of conditions may be further selected from the eight conditions, but this is not limited.

[0151] In step 502, if it is determined that the bidirectional predictor compensation mode is activated for the current block, motion compensation is performed for the current block based on the bidirectional predictor compensation mode. For a specific implementation process, refer to step 202 and will not be described in detail here.

[0152] The implementation process of Example 5 can be referred to in Examples 1 to 4, with the difference being that the activation condition of the bidirectional predicted value compensation mode does not include the condition of “performing luminance component predicted value compensation for the current block”, and therefore will not be described in detail here.

[0153] For example, if the effect of performing prediction value compensation on the chroma component of the current block using the bidirectional prediction value compensation mode is high, chroma component prediction value compensation may be performed on the current block, i.e., there is no need to use the trigger condition of "performing luma component prediction value compensation on the current block," and prediction value compensation of the luma component and chrominance component is allowed for the current block.

[0154] Example 6: Hereinafter, the encoding and decoding method will be described together with a specific application scenario, and the encoding and decoding method may include steps a1 to a8.

[0155] In step a1, it is determined whether to activate the bidirectional predictor compensation mode for the current block, and if so, perform step a2.

[0156] For example, the method of embodiment 1 may be used to determine whether to activate a bidirectional predictor compensation mode for a current block, or the method of embodiment 5 may be used to determine whether to activate a bidirectional predictor compensation mode for a current block, or the method of embodiment 4 may be used to determine whether to activate a bidirectional predictor compensation mode for a current block. This determination method will not be described in detail.

[0157] In step a2, the current block is divided into at least one unit block, a first reference block is determined from a first reference picture according to the first unidirectional motion information of the unit block, the first reference block is extended to obtain a second reference block, a third reference block is determined from the second reference picture according to the second unidirectional motion information of the unit block, the third reference block is extended to obtain a fourth reference block.

[0158] Exemplarily, the current block may include one unit block (i.e., the unit block is the current block) or at least two unit blocks. For example, if the width of the unit block is dx and the height is dy, and the width of the current block is W and the height is H, then dx=W>a?a:W, dy=H>a?a:H. For example, if W is greater than a, then dx is a. If W is equal to or less than a, then dx is W. If H is greater than a, then dy is a. If H is equal to or less than a, then dy is H. The value of a can be empirically set, for example, 4, 8, 16, 32, etc., and for convenience of explanation, a=16 will be taken as an example below. For example, if the size of the current block is 8*16, then the current block includes only one unit block with a size of 8*16. Also, for example, if the size of the current block is 8*32, then the current block includes unit block 1 and unit block 2, both of which are 8*16 in size. For example, if the size of the current block is 16*32, the current block includes unit block 1 and unit block 2, both of which are 16*16 in size. Of course, the above are only some examples, and are not limited thereto. For convenience of explanation, the following description will be given taking as an example that the current block is divided into unit block 1 and unit block 2, both of which are 16*16 in size.

[0159] Exemplarily, if the current block is a bidirectional block (i.e., the current block is a block using bidirectional prediction), bidirectional motion information corresponding to the current block can be obtained, and the obtaining manner is not limited. The bidirectional motion information includes two different directional motion information called first unidirectional motion information (e.g., a first motion vector and a first reference picture index) and second unidirectional motion information (e.g., a second motion vector and a second reference picture index). For each unit block of the current block, the first unidirectional motion information of the unit block is the same as the first unidirectional motion information of the current block, and the second unidirectional motion information of the unit block is the same as the second unidirectional motion information of the current block. Based on the first unidirectional motion information, a first reference picture (e.g., reference picture 0) located before the current picture in which the current block is located can be determined, and based on the second unidirectional motion information, a second reference picture (e.g., reference picture 1) located after the current picture in which the current block is located can be determined.

[0160] For each unit block (hereinafter, take unit block 1 as an example), determine a first reference block from the first reference picture according to the first unidirectional motion information of unit block 1, the size of unit block 1 is dx*dy (for example, 16*16), and the size of the first reference block is 16*16. Then, extend the first reference block to obtain a second reference block, for example, fill N on the top, bottom, left and right of the first reference block (N can be 0, 1, 2, 3, 4, etc., and if N is 0, no filling is performed), for example, fill N rows of integer pixel points on the top and bottom edges of the first reference block, and fill N columns of integer pixel points on the left and right edges of the first reference block, to obtain a second reference block with a size of (16+2N)*(16+2N).

[0161] In one possible embodiment, the filling method of the integer pixel point of row N / column N may be to copy from the neighboring integer pixel area in the first reference picture, for example, the pixel value of the integer pixel point of row N and the pixel value of the integer pixel point of column N in the second reference block are obtained by copying the pixel values ​​of the neighboring integer pixel positions in the first reference picture.

[0162] For example, if N is 1, fill one row of integer pixel points on the top edge of the first reference block, fill one row of integer pixel points on the bottom edge of the first reference block, fill one column of integer pixel points on the left edge of the first reference block, and fill one column of integer pixel points on the right edge of the first reference block to obtain a second reference block of size 18*18.

[0163] For example, considering that when determining the horizontal component of the gradient value of a pixel position, it is necessary to use the pixel value of the pixel position on the left side of the pixel position and the pixel value of the pixel position on the right side of the pixel position, and when determining the vertical component of the gradient value of a pixel position, it is necessary to use the pixel value of the pixel position above the pixel position and the pixel value of the pixel position below the pixel position, the pixel position of the edge of the first reference block does not have a pixel position on at least one side. For example, the pixel position of the top edge of the first reference block does not have a pixel position above it in the first reference block. The pixel position of the left edge of the first reference block does not have a pixel position on its left side in the first reference block. Therefore, in order to determine the gradient value of each pixel position, it is necessary to fill N rows / N columns of integer pixel positions (pixels are integers) on the top, bottom, left and right edges of the first reference block, respectively.

[0164] Exemplarily, in order to reduce the increase in bandwidth, pixel values ​​of integer pixel positions of the rows / columns to be filled may be directly copied from pixel values ​​of neighboring integer pixel positions in the first reference picture. For example, the integer pixel block (a block of integer pixel positions) of the same size as the first reference block in the first reference picture is determined, and then pixel values ​​of integer pixel positions of the nearest N rows / columns around the integer pixel block are set as the filling values ​​of the top, bottom, left, right edges of the first reference block.

[0165] For example, filling N row / N column integer pixel positions at the top, bottom, left and right edges of the first reference block may include filling N row / N column integer pixel positions directly above, directly below, directly to the left and directly to the right of the integer pixel block.

[0166] For example, after filling the top, bottom, left and right edges of the first reference block with N row / N column integer pixel positions, a block whose width and height are increased by 2N from the original is obtained. When calculating the gradient value of each pixel position in the original first reference block based on the pixel value of each pixel position in the block, consideration is given to not using the corner points of the pixel positions of each layer among the pixel positions of the N layers outside the block. In order to reduce the amount of filling work and improve filling efficiency, when filling the top, bottom, left and right edges of the first reference block with N row / N column integer pixel positions, the integer pixel positions are filled in the N row / N column integer pixel positions directly above, directly below, directly to the left and directly to the right of the equally sized integer pixel block closest to the first reference block in the first reference picture.

[0167] When N=1, filling N row / N column integer pixel positions on the top, bottom, left and right edges of the first reference block respectively may include:

[0168] As shown in FIG. 6A, if the horizontal and vertical components of the fractional pixel predicted value of a pixel position in the first reference block are both half a pixel or more, the top edge of the first reference block is filled with the upper-nearest integer pixel position, the bottom edge of the first reference block is filled with the next-nearest integer pixel position below, the left edge of the first reference block is filled with the left-nearest integer pixel position, and the right edge of the first reference block is filled with the next-nearest integer pixel position on the right.

[0169] As shown in FIG. 6B, if the horizontal component of the fractional pixel of the predicted value of a pixel position in the first reference block is half a pixel or more and the vertical component is less than half a pixel, the top edge of the first reference block is filled with the next-nearest integer pixel position from above, the bottom edge of the first reference block is filled with the next-nearest integer pixel position from below, the left edge of the first reference block is filled with the next-nearest integer pixel position from the left, and the right edge of the first reference block is filled with the next-nearest integer pixel position from the right.

[0170] As shown in FIG. 6C, if the horizontal component of the fractional pixel of the predicted value of a pixel position in the first reference block is less than half a pixel and the vertical component is half a pixel or more, the top edge of the first reference block is filled with the upper-nearest integer pixel position, the bottom edge of the first reference block is filled with the next-nearest integer pixel position below, the left edge of the first reference block is filled with the next-nearest integer pixel position on the left, and the right edge of the first reference block is filled with the right-nearest integer pixel position.

[0171] As shown in FIG. 6D, if both the horizontal and vertical components of the fractional pixel prediction value of a pixel position in the first reference block are less than half a pixel, the top edge of the first reference block is filled with the next-nearest integer pixel position from above, the bottom edge of the first reference block is filled with the next-nearest integer pixel position from below, the left edge of the first reference block is filled with the next-nearest integer pixel position from the left, and the right edge of the first reference block is filled with the nearest integer pixel position on the right.

[0172] Illustratively, in Figures 6A to 6D, the triangles are predicted values ​​for each pixel position in the first reference block, the circles are reconstructed values ​​for integer pixel positions in the reference picture, and the shaded circles are reconstructed values ​​for integer pixel positions in the reference picture selected for filling.

[0173] In Figures 6A to 6D, take the size of the first reference block as an example, 4*4, and after filling the first reference block, a 6*6 second reference block is obtained. If the size of the first reference block is 16*16, and after filling the first reference block, a 18*18 second reference block is obtained. The specific filling method is shown in Figures 6A to 6D, and will not be described in detail here.

[0174] In another possible embodiment, the filling method of the integer pixel point of row N / column N may be to directly copy the nearest pixel value in the first reference block, i.e., the pixel value of the integer pixel point of row N and the pixel value of the integer pixel point of column N in the second reference block are obtained by copying the pixel values ​​of the nearest pixel points in the first reference block.

[0175] As shown in FIG. 6E, the pixel values ​​of the neighboring pixel points in the first reference block are copied to obtain the second reference block. For example, when filling integer pixel positions of N rows / N columns on the top, bottom, left, and right edges of the first reference block, the pixel values ​​of the neighboring pixel points in the first reference block are directly copied. As shown in FIG. 6E, the pixel values ​​of the pixel positions in the first reference block are copied to the edge region of the first reference block to obtain the second reference block.

[0176] In Fig. 6E, the size of the first reference block is 4*4 as an example, after filling the first reference block, a second reference block of 6*6 is obtained. If the size of the first reference block is 16*16, after filling the first reference block, a second reference block of 18*18 is obtained. The specific filling method is shown in Fig. 6E and will not be described in detail here.

[0177] Referring to the above embodiment, the filling method of the integer pixel point of N rows / N columns may be as follows: copy from the neighboring integer pixel area in the first reference picture (FIGS. 6A-6D), or copy the nearest pixel value in the first reference block (FIG. 6E), that is, instead of interpolating multiple pixel values ​​and filling the integer pixel point of N rows / N columns with the interpolated pixel values, directly fill the integer pixel point of N rows / N columns with the existing pixel values, thus avoiding further interpolation process and indirectly avoiding accessing further reference pixels (using the interpolation method requires accessing further reference pixels).

[0178] For each unit block (hereinafter, take unit block 1 as an example), determine a third reference block of size 16*16 from the second reference picture according to the second unidirectional motion information of unit block 1 of size dx*dy (for example, 16*16). Then, extend the third reference block to obtain a fourth reference block, for example, fill N on the top, bottom, left and right of the third reference block (N can be 0, 1, 2, 3, 4, etc., and if N is 0, no filling is performed), for example, fill N rows of integer pixel points on the top edge and bottom edge of the third reference block, and fill N columns of integer pixel points on the left edge and right edge of the third reference block, to obtain a fourth reference block of size (16+2N)*(16+2N).

[0179] For example, the filling method of the integer pixel point of N rows / N columns is to copy from the neighboring integer pixel area in the second reference picture, or to directly copy the nearest pixel value in the third reference block. For example, the pixel value of the integer pixel point of N rows and the pixel value of the integer pixel point of N columns in the fourth reference block are obtained by copying the pixel values ​​of the neighboring integer pixel positions in the second reference picture, or the pixel values ​​of the neighboring pixel points in the third reference block.

[0180] For the specific filling method, reference can be made to the filling method of the first reference block, and no detailed description will be given here.

[0181] In step a3, for each sub-block among at least one sub-block included in the unit block, a first target reference block corresponding to the sub-block is selected from a second reference block corresponding to the unit block, a first original predicted value of the sub-block is determined based on pixel values ​​of the first target reference block, a second target reference block corresponding to the sub-block is selected from a fourth reference block corresponding to the unit block, and a second original predicted value of the sub-block is determined based on pixel values ​​of the second target reference block.

[0182] For example, for each unit block of the current block, the unit block may be divided into at least one sub-block, for example, when the size of the sub-block is 4*4 and the size of the unit block is 16*16, the unit block may be divided into 16 sub-blocks. For example, when the size of the sub-block is 8*8, the unit block may be divided into 4 sub-blocks. For example, when the size of the sub-block is 16*16, the unit block may be divided into one sub-block. Of course, the above are only some examples, and are not limited thereto. For convenience of explanation, the following description will be given taking the unit block divided into 16 sub-blocks as an example.

[0183] For each subblock (hereinafter, subblock 11 is taken as an example) of each dx*dy (for example, 16*16) unit block (hereinafter, unit block 1 is taken as an example), a first target reference block of size 6*6 corresponding to subblock 11 of size 4*4 is selected from the second reference block (size 18*18) corresponding to unit block 1, and a first original predicted value of subblock 11 is determined based on the pixel value of the first target reference block. A second target reference block of size 6*6 corresponding to subblock 11 is selected from the fourth reference block (size 18*18) corresponding to unit block 1, and a second original predicted value of subblock 11 is determined based on the pixel value of the second target reference block.

[0184] For example, as shown in FIG. 7, for each dx*dy (for example, 16*16) unit block, a first reference block with a size of 16*16 is determined from a first reference picture (for example, reference picture 0) according to the first unidirectional motion information of the unit block, and the first reference block is extended to obtain a second reference block with a size of 18*18. A third reference block with a size of 16*16 is determined from a second reference picture (for example, reference picture 1) according to the second unidirectional motion information of the unit block, and the third reference block is extended to obtain a fourth reference block with a size of 18*18. Then, for each sub-block (for example, b*b, b can be 4, 8, 16, etc., hereinafter, b=4 is taken as an example, that is, the size of the sub-block can be 4*4) of the unit block, in the subsequent process, the gradient of the target reference block corresponding to the sub-block needs to be determined, and thus a target reference block with a size of 6*6 needs to be determined. For example, a first target reference block corresponding to the sub-block is selected from a second reference block corresponding to the unit block, a first original predicted value of the sub-block is determined based on pixel values ​​of the first target reference block, a second target reference block corresponding to the sub-block is selected from a fourth reference block corresponding to the unit block, and a second original predicted value of the sub-block is determined based on pixel values ​​of the second target reference block.

[0185] As shown in Fig. 7, the pixel position of the subblock is x = xSb, xSb + 1, xSb + 2 or xSb + 3, y = ySb, ySb + 1, ySb + 2 or ySb + 3, and the pixel position of the target reference block (e.g., the first target reference block and the second target reference block, etc.) corresponding to the subblock is x = xSb, xSb + 1, xSb + 2, xSb + 3, xSb + 4 or xSb + 5, y = ySb, ySb + 1, ySb + 2, ySb + 3, ySb + 4 or ySb + 5. As can be seen from the above, the pixel position (x, y) of the subblock corresponds to the pixel position (x + 1, y + 1) of the target reference block. Exemplarily, xSb and ySb are the starting pixel positions of the sub-blocks, for example, xSb=0, 4, 8...dx / 4*4-4, ySb=0, 4, 8...dy / 4*4-4, etc. If dx=16, the starting pixel position of the sub-block may be 0, 4, 8, or 12. Exemplarily, the horizontal pixel position range of the target reference block may be [0, dx+1], and the vertical pixel position range may be [0, dy+1].

[0186] Illustratively, the first original predicted value of the sub-block is I (0) The second original predicted value of the (x,y) subblock is I (1) Let (x, y), and the first original predicted value and the second original predicted value are both original predicted values ​​of size 6*6.

[0187] In step a4, a horizontal rate of the sub-block is determined based on the first original predicted value and the second original predicted value of the sub-block, i.e., a horizontal (x-direction) rate v of the pixels in the first reference picture of the sub-block is determined based on the first original predicted value and the second original predicted value. xIllustratively, the horizontal rate of the pixels in the second reference picture of the sub-block is opposite to the horizontal rate of the pixels in the first reference picture of the sub-block. For pixel values ​​(e.g., luminance values) of each pixel position of the sub-block, the horizontal rates of the pixel values ​​(e.g., luminance values) of these pixel positions are the same, and are all the horizontal rates determined in step a4.

[0188] In step a5, a vertical rate of the sub-block is determined based on the first original predicted value and the second original predicted value of the sub-block, i.e., a vertical (y) rate v of the pixels in the first reference picture of the sub-block is determined based on the first original predicted value and the second original predicted value. y Illustratively, the vertical rate of the pixel in the second reference picture of the sub-block is opposite to the vertical rate of the pixel in the first reference picture of the sub-block. For pixel values ​​(e.g., luminance values) of each pixel position of the sub-block, the vertical rates of the pixel values ​​(e.g., luminance values) of these pixel positions are the same, and both are the vertical rates determined in step a5.

[0189] Regarding step a4 and step a5, after obtaining the first original predicted value of the sub-block and the second original predicted value of the sub-block, determine the horizontal gradient sum, the vertical gradient sum, and the luminance difference of two reference blocks (i.e., the luminance difference of two target reference blocks, also called the difference of time domain prediction values) according to the first original predicted value and the second original predicted value of the sub-block. For example, determine the horizontal gradient sum according to formula (1), determine the vertical gradient sum according to formula (2), and determine the luminance difference of two reference blocks according to formula (3).

number

[0190] horizontal gradient sum

number

number

number

number

number

number

number

number

number

number

number

number

number

number

[0191] In formula (4) to formula (8), Ω is a 6*6 target reference block corresponding to the subblock, that is, the first target reference block and the second target reference block in the above example, the pixel value of the first target reference block is the first original predicted value of the subblock, and the pixel value of the second target reference block is the second original predicted value of the subblock. i=xSb...xSb+5, j=ySb...ySb+5. Sign[x] represents obtaining the sign bit of x, that is, if x is less than 0, it is -1, if x is greater than 0, it is 1, and if x is equal to 0, it is 0. abs[x] represents obtaining the absolute value of x.

number

number

[0192] In formulas (1) to (3), shift2 may be a fixed value such as 4, or an integer value related to BD. shift3 may be a fixed value such as 1, or an integer value related to BD. Of course, this is merely an example, and the values ​​of shift2 and shift3 are not limited.

number

number

[0193] P (0) (i,j) is the pixel value (e.g., luminance value) of pixel position (i,j) in the first target reference block, P (1) (i,j) represents a pixel value (e.g., a luminance value) of a pixel position (i,j) in the second target reference block. Exemplarily, the horizontal gradient may be determined according to Equation 9, and the vertical gradient may be determined according to Equation 10.

number

[0194] In formulas (9) and (10), shift1 may be a fixed integer value such as 6, or an integer value related to BD. Of course, this is merely an example, and the value of shift1 is not limited. (k) (x, y) is the pixel value of the pixel position (x, y) in the target reference block, e.g., P (0)(x, y) is the pixel value (e.g., luminance value) of the pixel position (x, y) in the first target reference block, P (1) (x, y) represents the pixel value (eg, luminance value) of the pixel location (x, y) in the second target reference block.

[0195] In the above formulas, ≫ means to move to the right. Moving to the right by k gives 2 k It is equivalent to dividing by . BD (bit depth) represents the bit depth, i.e. the bit width required for the luminance value, and is generally 8, 10, or 12. Of course, 8, 10, and 12 are merely examples, and this bit depth is not limited.

[0196] For pixel values ​​at pixel locations (x,y) in the target reference block, if the reference pixel is located just at the edge of the subblock, there are not enough pixels around the pixel location to form a gradient, so the gradients of these pixel locations are obtained by copying the gradients of the neighboring pixel locations. For example, when x=0, or x=dx+1, or y=0, or y=dy+1,

number

[0197] In one possible embodiment, after obtaining the coefficients S1 and S3, the horizontal rate of the sub-block may be determined based on the coefficients S1, S3 and a rate threshold. For example, the horizontal rate v may be calculated by the following formula: x may be determined.

number

[0198] Of course, Equation 11 is merely an example and is not limiting.

number

number

number

number

number

number

number

number

number

number

[0199] After obtaining the coefficients S2, S5, and S6, the vertical rate of the sub-block may be determined based on the coefficients S2, S5, S6, the rate threshold, and the horizontal rate. For example, the vertical rate v y may be determined.

number

[0200] Of course, Equation 12 is merely an example and is not limiting.

number

number

number

number

number

number

number

number

number

[0201] In another possible embodiment, the vertical rate v is calculated by the following formula: y may be determined.

number

[0202] In Equation 13, S 2,m = S2≫12, S 2,m = S2&(2 12 -1), and ≪ means to move to the left. Moving k to the left is 2 k This is equivalent to multiplying

[0203] In step a6, obtain a predicted compensation value of the sub-block according to a horizontal rate and a vertical rate, for example, for each pixel position of the sub-block, obtain a predicted compensation value of the pixel position according to a horizontal rate and a vertical rate of the sub-block.

[0204] In one possible embodiment, a first horizontal gradient and a first vertical gradient are determined based on a first original predicted value, and a second horizontal gradient and a second vertical gradient are determined based on a second original predicted value, and then a predicted compensation value for each pixel position of the sub-block is obtained based on a horizontal rate, the first horizontal gradient, the second horizontal gradient, a vertical rate, the first vertical gradient, and the second vertical gradient.

[0205] For example, the predicted compensation value b(x,y) for each pixel position of the subblock may be obtained using the following formula:

number

[0206] Of course, Equation 14 is merely an example and is not limiting.

number

number

[0207] In step a7, obtain a target predicted value of a subblock according to the first original predicted value, the second original predicted value and the prediction compensation value. For example, for each pixel position of the subblock, obtain a target predicted value of the pixel position according to the first original predicted value, the second original predicted value and the prediction compensation value of the pixel position, that is, each pixel position corresponds to one target predicted value.

[0208] For example, the target prediction value pred for each pixel position of the subblock is calculated using the following formula: BDOF (x, y), the target prediction value pred BDOF (x,y) is the final predicted value of the luminance value at each pixel position of the 4*4 subblock.

number

[0209] In the above formula, P (0) (x, y) is the pixel value (e.g., luminance value) of the pixel position (x, y) in the first target reference block, P (1) (x, y) represents the pixel value (e.g., luminance value) of the pixel position (x, y) in the second target reference block. shift4 may be a fixed integer value such as 5, or may be an integer value related to BD, such as Max(3, 15 - BD), and the value of this shift4 is not limited. offset4 = 2 shift4-1 Of course, this is just an example of offset4, and the value of offset4 is not limited.

[0210] In step a8, a prediction value of the current block is determined based on the target prediction value of each sub-block.

[0211] Example 7: Hereinafter, an encoding and decoding method will be described together with a specific application scenario, and the encoding and decoding method may include steps b1 to b5.

[0212] In step b1, it is determined whether the bidirectional predictor compensation mode is activated for the current block, and if so, step b2 is performed.

[0213] For example, the method of Example 1 may be used to determine whether to activate the bidirectional predictor compensation mode for the current block, or the method of Example 5 may be used to determine whether to activate the bidirectional predictor compensation mode for the current block, or the method of Example 4 may be used to determine whether to activate the bidirectional predictor compensation mode for the current block, but these determination methods will not be described in detail.

[0214] In step b2, based on the original motion information (the two motion vectors and the reference picture index, i.e., the first unidirectional motion information and the second unit motion information), the original prediction value I (0) (x, y) and I (1) Get (x,y) respectively.

[0215] In step b3, for each sub-block of the current block, the original predicted value I (0) (x, y) and I (1) Based on (x,y), the horizontal (x-direction) rate v of pixels in the first reference picture x and the vertical (y-direction) rate v y may be obtained.

[0216] For example, the autocorrelation and correlation coefficients of the slopes S 1、 S 2、 S 3、 S5 and S6 may be obtained.

number

[0217] Illustratively, in the above formula,

number

number

number

[0218] In the above formula, Ω is a 6*6 target reference block around a 4*4 subblock, n a and n b are min(5,BD-7) and min(8,BD-4), respectively.

[0219] Next, S 1、 S 2、 S 3、 Based on S5 and S6, the motion vector difference (v x ,v y ) may be determined.

number

[0220] In the above formula,

number

number

[0221] In step b4, for each pixel position of the sub-block, a predicted compensation value of the pixel position is obtained according to the horizontal rate and vertical rate of the sub-block, for example, (v x ,v y ) based on the compensation value b(v x ,v y ) to get the

number

[0222] rnd is the rounding operation,

number

number

[0223] For example, ≫ represents moving to the right, and I(k) (i,j) represents the pixel value at pixel position (i,j) of the reference picture in list k, shift1=max(2,14-BD), and BD represents the bit depth, i.e. the bit width required for the luminance value, which is typically 10 or 8.

[0224] In step b5, a final predicted value pred is calculated based on the compensated value b(x,y) and the original predicted value. BDOF Get (x,y).

number

[0225] For example,

number

[0226] Example 8: Based on the first to seventh embodiments, each unit block of the current block may be subjected to motion compensation based on the motion vector adjustment mode. For example, based on the first original motion vector of the unit block (for example, the first unidirectional motion information of the above embodiment including the first original motion vector and the first reference picture), a reference block 1 corresponding to the unit block is determined, and based on the second original motion vector of the unit block (for example, the second unidirectional motion information of the above embodiment including the second original motion vector and the second reference picture), a reference block 2 corresponding to the unit block is determined. Based on the pixel values ​​of the reference block 1 and the pixel values ​​of the reference block 2, the first original motion vector and the second original motion vector are adjusted, and a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector are obtained.

[0227] Then, determine the reference block 3 corresponding to the unit block from the first reference picture according to the first target motion vector, and determine the reference block 4 corresponding to the unit block from the second reference picture according to the second target motion vector. Illustratively, the process of obtaining the reference block 3 and the reference block 4 corresponding to the unit block can refer to the motion vector adjustment mode, and will not be described in detail here.

[0228] Refer to above embodiment, this reference block 3 is the first reference block corresponding to this unit block, and this reference block 4 is the third reference block corresponding to this unit block.After obtaining the first reference block and the third reference block corresponding to the unit block, the bidirectional prediction compensation mode of the embodiment of the present invention can be used, and the specific implementation process can be referred to embodiment 1 to embodiment 7.

[0229] For example, after obtaining the first and third reference blocks through the motion compensation process of the motion vector adjustment mode, the motion compensation can be performed based on the first and third reference blocks according to the bidirectional predictor compensation mode. For example, the first reference block is extended to obtain the second reference block corresponding to the unit block, and the specific extension form is referred to the above embodiment. The third reference block is extended to obtain the fourth reference block corresponding to the unit block, and the specific extension form is referred to the above embodiment.

[0230] Then, for each subblock of at least one subblock included in the unit block, a first target reference block corresponding to the subblock is selected from a second reference block corresponding to the unit block, and a first original predicted value of the subblock is determined based on pixel values ​​of the first target reference block. A second target reference block corresponding to the subblock is selected from a fourth reference block corresponding to the unit block, and a second original predicted value of the subblock is determined based on pixel values ​​of the second target reference block. A horizontal rate and a vertical rate of the subblock are determined based on the first original predicted value and the second original predicted value, a predicted compensation value of the subblock is obtained based on the horizontal rate and the vertical rate, and a target predicted value of the subblock is obtained based on the first original predicted value, the second original predicted value, and the predicted compensation value.

[0231] In one possible embodiment, when the motion vector adjustment mode is activated for the current block but the bidirectional predictor compensation mode is not activated for the current block, for each unit block of the current block, a reference block 1 corresponding to the unit block is determined according to the first original motion vector of the unit block, and a reference block 2 corresponding to the unit block is determined according to the second original motion vector of the unit block. According to the pixel values ​​of the reference block 1 and the pixel values ​​of the reference block 2, the first original motion vector and the second original motion vector are adjusted to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector. Then, according to the first target motion vector, a reference block 3 corresponding to the unit block is determined from the first reference picture, and according to the second target motion vector, a reference block 4 corresponding to the unit block is determined from the second reference picture. The pixel values ​​of the reference block 3 and the pixel values ​​of the reference block 4 are weighted to obtain a prediction value of the unit block.

[0232] In another possible embodiment, if the bidirectional predictor compensation mode is activated for the current block, but the motion vector adjustment mode is not activated for the current block, the realization process can be referred to in Examples 1 to 7, and will not be described in detail here.

[0233] In another possible embodiment, when the bidirectional predictor compensation mode is activated for the current block and the motion vector adjustment mode is activated for the current block, i.e., when the bidirectional predictor compensation mode and the motion vector adjustment mode are activated, the following method is used.

[0234] For a unit block with a size of dx*dy, if the minimum SAD value dmvrSad[xSbIdx][ySbIdxy] of the motion vector adjustment mode is less than a preset threshold (which may be set empirically, but is not limited thereto. For example, the preset threshold may be 2*dx*dy), the bidirectional predictor compensation process is not performed on the unit block, and the reference block 3 corresponding to the unit block is directly determined from the first reference picture according to the first target motion vector of the unit block, and the reference block 4 corresponding to the unit block is determined from the second reference picture according to the second target motion vector. The pixel values ​​of the reference block 3 and the pixel values ​​of the reference block 4 are weighted to obtain a predicted value for each pixel position. For example, the final predicted value for each pixel position is calculated as pbSamples[x][y]=Clip3(0,2 BD -1,(P[x+1][y+1]+P 1 [x+1][y+1]+offset4)>>shift4).

[0235] For a unit block with a size of dx*dy, if the minimum SAD (sum of abstract distortion) value dmvrSad[xSbIdx][ySbIdxy] of the motion vector adjustment mode is equal to or greater than a preset threshold (which may be empirically set, but is not limited thereto. For example, the preset threshold may be 2*dx*dy), a bidirectional predictor compensation process is performed on the unit block, that is, a motion vector adjustment process and a bidirectional predictor compensation process are performed on the unit block. For example, a reference block 3 corresponding to the unit block is determined from a first reference picture according to a first target motion vector of the unit block, and a reference block 4 corresponding to the unit block is determined from a second reference picture according to a second target motion vector. The reference block 3 (i.e., the first reference block in the above embodiment) is expanded to obtain a second reference block corresponding to the unit block, and the reference block 4 (i.e., the third reference block in the above embodiment) is expanded to obtain a fourth reference block corresponding to the unit block. Then, for each subblock among at least one subblock included in the unit block, a first target reference block corresponding to the subblock is selected from a second reference block corresponding to the unit block, and a first original predicted value of the subblock is determined based on pixel values ​​of the first target reference block. A second target reference block corresponding to the subblock is selected from a fourth reference block corresponding to the unit block, and a second original predicted value of the subblock is determined based on pixel values ​​of the second target reference block. Next, a horizontal rate and a vertical rate are determined based on the first original predicted value and the second original predicted value, a prediction compensation value is determined based on the horizontal rate and the vertical rate, and a predicted value of each pixel position is obtained based on the prediction compensation value. For example, the final predicted value of each pixel position is expressed as pbSamples[x][y]=Clip3(0,2 BD -1,(P 0 [x+1][y+1]+P 1[x+1][y+1]+b(x, y)+offset4) >> shift4).

[0236] In the above embodiment, the minimum SAD value of the motion vector adjustment mode may be the SAD of reference block 3 and reference block 4. For example, when determining the downsampling SAD between the pixel values ​​of reference block 3 and reference block 4, the downsampling parameter N is empirically set and is an integer equal to or greater than 0, and N=0 indicates that no downsampling is performed.

[0237] In one possible embodiment, the above examples may be implemented alone or in any combination, and this is not limited. For example, Example 4 may be implemented in combination with Example 1, Example 4 may be implemented in combination with Example 2, Example 4 may be implemented in combination with Example 3, Example 4 may be implemented in combination with Example 5, Example 4 may be implemented in combination with Example 6, and Example 4 may be implemented in combination with Example 7. Example 2 may be implemented in combination with Example 1, and Example 2 may be implemented in combination with Example 5. Example 3 may be implemented in combination with Example 1, and Example 3 may be implemented in combination with Example 5. Example 1 may be implemented alone, Example 2 may be implemented alone, Example 3 may be implemented alone, Example 5 may be implemented alone, Example 6 may be implemented alone, and Example 7 may be implemented alone. Example 8 may be implemented in combination with any of Examples 1 to 7. Of course, the above are only some examples of the present invention, and are not limited thereto. All the embodiments of the present invention may be implemented alone or in combination, which will not be described in detail.

[0238] Based on the same inventive concept as the above method, an embodiment of the present invention further provides an encoding and decoding device applied to the encoding side or the decoding side, as shown in FIG. 8, which is a structural diagram of the device, and the device comprises: a decision module 81 for deciding to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: the current block is allowed to use the bidirectional predictor compensation mode; the current block uses a translational motion model; the prediction mode of the current block is not a sub-block mode, not a SMVD mode, and not a CIIP mode; the prediction value of the current block is obtained by weighting the reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; the weights of the two reference pictures of the current block are the same; the two reference pictures of the current block are both short-term reference pictures; the width, height, and area of ​​the current block are all within a limited range; the sizes of the two reference pictures of the current block are both the same as the size of the current picture; and luminance component predictor compensation is performed for the current block; and a motion compensation module 82 for performing motion compensation based on the bidirectional predictor compensation mode on the current block when determining to activate the bidirectional predictor compensation mode for the current block.

[0239] The determination module 81 is further used for determining not to activate the bidirectional predictor compensation mode for the current block if any of the following conditions is not satisfied as the control information: the current block is allowed to use the bidirectional predictor compensation mode; the current block uses a translational motion model; the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, and the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; the weighting weights of the two reference pictures of the current block are the same; the two reference pictures of the current block are both short-term reference pictures; the width, height, and area of ​​the current block are all within a limited range; the sizes of the two reference pictures of the current block are both the same as the size of the current picture; and luminance component predictor compensation is performed for the current block.

[0240] The control information allowing the current block to use the bidirectional predictor compensation mode includes, as sequence level control information, allowing the current block to use the bidirectional predictor compensation mode, and / or, as picture level control information, allowing the current block to use the bidirectional predictor compensation mode.

[0241] The width, height, and area of ​​the current block all being within the limited ranges include the width being greater than or equal to a first threshold, the height being greater than or equal to a second threshold, and the area being greater than or equal to a third threshold, or the width being greater than or equal to the first threshold, the height being greater than or equal to the second threshold, and the area being greater than a fourth threshold, wherein the third threshold is greater than the fourth threshold.

[0242] The first threshold is 8, the second threshold is 8, the third threshold is 128, and the fourth threshold is 64.

[0243] The motion compensation module 82 specifically performs, for each sub-block of the at least one sub-block included in the current block: determining a first original predicted value and a second original predicted value of the sub-block, and determining a horizontal rate and a vertical rate of the sub-block based on the first original predicted value and the second original predicted value; obtaining a prediction compensation value for the sub-block based on the horizontal rate and the vertical rate; obtaining a target prediction value for the sub-block based on the first original prediction value, the second original prediction value, and the prediction compensation value; A prediction value for the current block is determined based on the target prediction value of each sub-block.

[0244] When the motion compensation module 82 determines the first original predicted value and the second original predicted value of the sub-block, specifically, determining a unit block corresponding to the sub-block, the current block including the unit block, the unit block including the sub-block, determining a first reference block from a first reference picture based on first unidirectional motion information of the unit block, extending the first reference block to obtain a second reference block, selecting a first target reference block corresponding to the sub-block from the second reference block, and determining a first original predicted value of the sub-block based on pixel values ​​of the first target reference block; It is used for determining a third reference block from a second reference picture based on the second unidirectional motion information of the unit block, extending the third reference block to obtain a fourth reference block, selecting a second target reference block corresponding to the sub-block from the fourth reference block, and determining a second original predicted value of the sub-block based on pixel values ​​of the second target reference block.

[0245] When the motion compensation module 82 expands the first reference block to obtain a second reference block, the motion compensation module 82 fills N rows of integer pixel points on the upper edge and the lower edge of the first reference block, and fills N columns of integer pixel points on the left edge and the right edge of the first reference block, to obtain a second reference block; When the motion compensation module 82 expands the third reference block to obtain a fourth reference block, the motion compensation module 82 fills N rows of integer pixel points on the upper and lower edges of the third reference block, and fills N columns of integer pixel points on the left and right edges of the third reference block, to obtain a fourth reference block; Illustratively, N is 0 or a positive integer.

[0246] the pixel values ​​of the integer pixel points in the N rows and the pixel values ​​of the integer pixel points in the N columns filled in the second reference block are obtained by copying pixel values ​​of neighboring integer pixel positions in the first reference picture, or by copying pixel values ​​of neighboring pixel points in the first reference block; The pixel values ​​of the integer pixel points in the N rows and the pixel values ​​of the integer pixel points in the N columns filled in the fourth reference block are obtained by copying pixel values ​​of neighboring integer pixel positions in the second reference picture, or are obtained by copying pixel values ​​of neighboring pixel points in the third reference block.

[0247] When obtaining the prediction compensation value of the sub-block based on the horizontal rate and the vertical rate, the motion compensation module 82 is specifically used to determine a first horizontal gradient and a first vertical gradient based on the first original prediction value, determine a second horizontal gradient and a second vertical gradient based on the second original prediction value, and obtain the prediction compensation value of the sub-block based on the horizontal rate, the first horizontal gradient, the second horizontal gradient, the vertical rate, the first vertical gradient, and the second vertical gradient.

[0248] Based on the same inventive concept as the above method, an embodiment of the present invention further provides an encoding and decoding device applied to an encoding side or a decoding side, and the device includes the following control information: a condition that the current block is allowed to use a bidirectional predictor compensation mode; a condition that the current block uses a translational motion model; a prediction mode of the current block is not a sub-block mode, not a SMVD mode, and not a CIIP mode; a prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same. a determination module for determining to activate a bidirectional predictor compensation mode for the current block if all of the following conditions are satisfied: the weighting weights of the two reference pictures of the current block are the same; the two reference pictures of the current block are both short-term reference pictures; the width, height and area of ​​the current block are all within a limited range; and the sizes of the two reference pictures of the current block are both the same as a size of the current picture; and a motion compensation module for performing motion compensation based on the bidirectional predictor compensation mode for the current block when it is determined to activate the bidirectional predictor compensation mode for the current block.

[0249] From a hardware perspective, a schematic diagram of the hardware architecture of the decoding device according to the embodiment of the present invention can be specifically referred to in Figure 9A. The decoding device includes a processor 911 and a machine-readable storage medium 912, in which machine-executable instructions executable by the processor 911 are stored, and the processor 911 is used to implement the method disclosed in the above embodiment of the present invention by executing the machine-executable instructions. For example, the processor is used to realize the following steps by executing the machine-executable instructions:

[0250] determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is permitted to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that both the two reference pictures of the current block are short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that both the sizes of the two reference pictures of the current block are the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode on the current block;

[0251] From a hardware perspective, a schematic diagram of the hardware architecture of an encoding device according to an embodiment of the present invention can be specifically referred to in Fig. 9B. The encoding device includes a processor 921 and a machine-readable storage medium 922, which stores machine-executable instructions executable by the processor 921, and the processor 921 is used to implement the method disclosed in the above embodiment of the present invention by executing the machine-executable instructions. For example, the processor is used to realize the following steps by executing the machine-executable instructions:

[0252] determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is permitted to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that both the two reference pictures of the current block are short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that both the sizes of the two reference pictures of the current block are the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode on the current block;

[0253] Based on the same inventive concept as the above method, an embodiment of the present invention further provides a camera, the camera including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to implement the method disclosed in the above embodiment of the present invention. For example, the processor is used to realize the following steps by executing the machine-executable instructions:

[0254] determining to activate the bidirectional predictor compensation mode for the current block if the following conditions are satisfied as the control information: that the current block is permitted to use the bidirectional predictor compensation mode; that the current block uses a translational motion model; that the prediction mode of the current block is not a sub-block mode, a SMVD mode, or a CIIP mode; that the prediction value of the current block is obtained by weighting reference blocks from two reference pictures, the display orders of the two reference pictures are respectively before and after the current picture, and the distances from the two reference pictures to the current picture are the same; that the weights of the two reference pictures of the current block are the same; that both the two reference pictures of the current block are short-term reference pictures; that the width, height, and area of ​​the current block are all within a limited range; that both the sizes of the two reference pictures of the current block are the same as the size of the current picture; and that luminance component predictor compensation is performed on the current block; performing motion compensation based on the bidirectional predictor compensation mode on the current block when it is determined to activate the bidirectional predictor compensation mode on the current block;

[0255] Based on the same inventive concept as the above method, an embodiment of the present invention further provides a machine-readable storage medium on which a plurality of computer instructions are stored, which, when executed by a processor, can implement the encoding and decoding method disclosed in the above example of the present invention. The machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device, which can contain or store information such as executable commands, data, etc. For example, the machine-readable storage medium may be a RAM (Radom Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (e.g., a hard disk drive), a solid-state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or a similar storage medium, or a combination thereof.

[0256] Based on the same inventive concept as the above method, an embodiment of the present invention further provides a computer program product including computer instructions, which, when executed by a processor, can implement the encoding and decoding methods disclosed in the above examples of the present invention.

[0257] Based on the same inventive concept as the above method, an embodiment of the present invention further provides an encoding and decoding system, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, which, when executed by the processor, can implement the encoding and decoding method disclosed in the above embodiment of the present invention.

[0258] The system, device, module or unit described in the above embodiments may be realized by a computer chip or entity, or may be realized by a product having a certain function. A conventional implementation is a computer, and the form of the computer may be a personal computer, a laptop computer, a mobile phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an e-mail sending and receiving device, a tablet computer, a wearable device, or a combination of any two or more of these devices.

[0259] For ease of explanation, the above apparatus will be described by dividing it into various units according to their functions. It will be understood that the functions of each unit can be realized by the same or multiple pieces of software and / or hardware when implementing the present invention.

[0260] As will be appreciated by those skilled in the art, embodiments of the present invention may be provided as a method, a system, or a computer program product. The present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Embodiments of the present invention may take the form of a computer program product embodied in one or more computer usable storage mediums (including, but not limited to, disk memories, CD-ROMs, optical memories, etc.) containing computer usable program code.

[0261] The present application will be described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor, or other programmable data processing device to generate a machine, and the instructions executed by the processor of the computer or other programmable data processing device generate an apparatus for implementing the functions specified in a flow or flows of the flowcharts and / or a block or blocks of the block diagrams. These computer program instructions may be stored in a computer-readable memory that can guide a computer or other programmable data processing device to operate in a specific manner, whereby the instructions stored in the computer-readable memory generate a product including an instruction apparatus, and the instruction apparatus implements the functions specified in a flow or flows of the flowcharts and / or a block or blocks of the block diagrams.

[0262] These computer program instructions may be loaded into a computer or other programmable data processing apparatus, which causes the computer or other programmable device to execute a series of operational steps to generate a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows of the flowchart and / or one or more blocks of the block diagram. The above are merely examples of the present application and are not intended to limit the present application. For those skilled in the art, the present invention can be modified and changed in various ways. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention. [Explanation of symbols]

[0263] 81 Decision Module 82 Compensation Module 911 Processor 912 Storage medium 921 Processor 922 Storage medium

Claims

1. 1. A method of decoding, comprising: When determining to use a bidirectional optical flow prediction mode for the current block, the method includes performing motion compensation on the current block to obtain a prediction value of the current block, the step including: For a unit block in the current block having a size of dx*dy, when the current block uses a motion vector adjustment mode, if a minimum SAD value of the unit block is equal to or greater than a preset threshold value 2*dx*dy and a bidirectional optical flow prediction mode is determined to be used for the current block, performing motion compensation on the unit block to obtain a prediction value of the unit block; determining a predicted value of the current block based on the predicted values ​​of each unit block of the current block; Including, The step of performing motion compensation on the unit block to obtain a predicted value of the unit block includes: determining a fifth reference block corresponding to the unit block based on a first original motion vector of the unit block, and determining a sixth reference block corresponding to the unit block based on a second original motion vector of the unit block; adjusting the first original motion vector and the second original motion vector according to pixel values ​​of the fifth reference block and pixel values ​​of the sixth reference block to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; determining a first reference block corresponding to the unit block from a first reference picture of the current block based on the first target motion vector, and determining a third reference block corresponding to the unit block from a second reference picture of the current block based on the second target motion vector; For each sub-block among at least one sub-block included in the unit block, determining a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block, and determining a horizontal motion offset and a vertical motion offset of the sub-block based on the first original predicted value and the second original predicted value; obtaining a prediction compensation value for the sub-block based on the horizontal motion offset and the vertical motion offset, and obtaining a target prediction value for the sub-block based on the first original prediction value, the second original prediction value, and the prediction compensation value; determining a predicted value of the unit block based on a target predicted value of each sub-block included in the unit block; Including, Wherein, the prediction value of the current block is obtained by weighting the reference blocks of two reference pictures used in bidirectional prediction, the weighting weights of the two reference pictures of the current block are the same, the directions of the two reference pictures are different, one reference picture is before the current picture and the other reference picture is after the current picture, and the distances from the two reference pictures to the current picture are the same; A decoding method, characterized in that the two reference pictures are both short-term reference pictures, and the sizes of the two reference pictures are both the same as the size of the current picture.

2. Determining a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block includes: expanding the first reference block to obtain a second reference block; selecting a first target reference block from the second reference block corresponding to the sub-block, and determining a first original predicted value of the sub-block based on pixel values ​​of the first target reference block; expanding the third reference block to obtain a fourth reference block; selecting a second target reference block from the fourth reference block corresponding to the sub-block, and determining a second original predicted value of the sub-block based on pixel values ​​of the second target reference block; 2. The method of claim 1, comprising:

3. the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component.

2. The method of claim 1, further comprising using a bidirectional optical flow prediction mode for the current block if a condition including:

4. The weighting weights being the same include picture-level weighting weights being the same and block-level weighting weights being the same; 4. The method of claim 3, wherein the picture-level weighting weights are the same include picture-level luminance weighting weights are the same.

5. the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component.

2. The method of claim 1, further comprising not using the bidirectional optical flow prediction mode for the current block if any of the conditions including:

6. 1. A method of encoding, comprising: When determining to use a bidirectional optical flow prediction mode for the current block, the method includes performing motion compensation on the current block to obtain a prediction value of the current block, the step including: For a unit block in the current block having a size of dx*dy, when the current block uses a motion vector adjustment mode, if a minimum SAD value of the unit block is equal to or greater than a preset threshold value 2*dx*dy and a bidirectional optical flow prediction mode is determined to be used for the current block, performing motion compensation on the unit block to obtain a prediction value of the unit block; determining a predicted value of the current block based on the predicted values ​​of each unit block of the current block; Including, The step of performing motion compensation on the unit block to obtain a predicted value of the unit block includes: determining a fifth reference block corresponding to the unit block based on a first original motion vector of the unit block, and determining a sixth reference block corresponding to the unit block based on a second original motion vector of the unit block; adjusting the first original motion vector and the second original motion vector according to pixel values ​​of the fifth reference block and pixel values ​​of the sixth reference block to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; determining a first reference block corresponding to the unit block from a first reference picture of the current block based on the first target motion vector, and determining a third reference block corresponding to the unit block from a second reference picture of the current block based on the second target motion vector; For each sub-block among at least one sub-block included in the unit block, determining a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block, and determining a horizontal motion offset and a vertical motion offset of the sub-block based on the first original predicted value and the second original predicted value; obtaining a prediction compensation value for the sub-block based on the horizontal motion offset and the vertical motion offset, and obtaining a target prediction value for the sub-block based on the first original prediction value, the second original prediction value, and the prediction compensation value; determining a predicted value of the unit block based on a target predicted value of each sub-block included in the unit block; Including, Wherein, the prediction value of the current block is obtained by weighting the reference blocks of two reference pictures used in bidirectional prediction, the weighting weights of the two reference pictures of the current block are the same, the directions of the two reference pictures are different, one reference picture is before the current picture and the other reference picture is after the current picture, and the distances from the two reference pictures to the current picture are the same; the two reference pictures are both short-term reference pictures, and the sizes of the two reference pictures are the same as the size of the current picture; 13. An encoding method comprising:

7. Determining a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block includes: expanding the first reference block to obtain a second reference block; selecting a first target reference block from the second reference block corresponding to the sub-block, and determining a first original predicted value of the sub-block based on pixel values ​​of the first target reference block; expanding the third reference block to obtain a fourth reference block; selecting a second target reference block from the fourth reference block corresponding to the sub-block, and determining a second original predicted value of the sub-block based on pixel values ​​of the second target reference block; 7. The method of claim 6, comprising:

8. the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component.

7. The method of claim 6, further comprising using a bidirectional optical flow prediction mode for the current block if a condition including:

9. The weighting weights being the same include picture-level weighting weights being the same and block-level weighting weights being the same; 9. The method of claim 8, wherein the picture-level weighting weights are the same include picture-level luminance weighting weights are the same.

10. the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component.

7. The method of claim 6, further comprising not using the bidirectional optical flow prediction mode for the current block if any of the conditions including:

11. A decoding device, comprising: a decision module for deciding to use a bidirectional optical flow prediction mode for a current block; a motion compensation module for performing motion compensation on the current block to obtain a predicted value of the current block when determining to use a bidirectional optical flow prediction mode for the current block; The motion compensation module includes: For a unit block having a size of dx*dy in the current block, if it is determined that a minimum SAD value of the unit block is equal to or greater than a preset threshold value 2*dx*dy when the current block uses a motion vector adjustment mode and a bidirectional optical flow prediction mode is used for the current block, performing motion compensation on the unit block to obtain a prediction value of the unit block; used to determine a predicted value of the current block based on a predicted value of each unit block of the current block; The motion compensation module performs motion compensation on the unit block to obtain a predicted value of the unit block, determining a fifth reference block corresponding to the unit block based on a first original motion vector of the unit block; determining a sixth reference block corresponding to the unit block based on a second original motion vector of the unit block; adjusting the first original motion vector and the second original motion vector according to pixel values ​​of the fifth reference block and pixel values ​​of the sixth reference block to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; determining a first reference block corresponding to the unit block from a first reference picture of the current block based on the first target motion vector; determining a third reference block corresponding to the unit block from a second reference picture of the current block based on the second target motion vector; For each sub-block among at least one sub-block included in the unit block, determining a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block, and determining a horizontal motion offset and a vertical motion offset of the sub-block based on the first original predicted value and the second original predicted value; obtaining a prediction compensation value for the sub-block based on the horizontal motion offset and the vertical motion offset; obtaining a target prediction value for the sub-block based on the first original prediction value, the second original prediction value, and the prediction compensation value; is used to determine a predicted value of the unit block based on a target predicted value of each sub-block included in the unit block; Wherein, the prediction value of the current block is obtained by weighting the reference blocks of two reference pictures used in bidirectional prediction, the weighting weights of the two reference pictures of the current block are the same, the directions of the two reference pictures are different, one reference picture is before the current picture and the other reference picture is after the current picture, and the distances from the two reference pictures to the current picture are the same; the two reference pictures are both short-term reference pictures, and the sizes of the two reference pictures are the same as the size of the current picture; A decoding device comprising:

12. When the motion compensation module determines a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block, expanding the first reference block to obtain a second reference block; Selecting a first target reference block from the second reference block corresponding to the sub-block, and determining a first original predicted value of the sub-block based on pixel values ​​of the first target reference block; expanding the third reference block to obtain a fourth reference block; The apparatus of claim 11, further comprising: a second target reference block corresponding to the sub-block selected from the fourth reference block; and a second original predicted value of the sub-block based on pixel values ​​of the second target reference block.

13. The motion compensation module further comprises: the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component. The apparatus of claim 11 , further comprising: a bidirectional optical flow prediction mode for the current block if a condition including:

14. The weighting weights being the same include picture-level weighting weights being the same and block-level weighting weights being the same; 14. The apparatus of claim 13, wherein the picture-level weighting weights are the same include picture-level luminance weighting weights are the same.

15. The motion compensation module further comprises: the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component. The apparatus of claim 11 , further comprising: a bidirectional optical flow prediction mode for the current block being used if any of the conditions including:

16. 1. An encoding device, comprising: a decision module for deciding to use a bidirectional optical flow prediction mode for a current block; a motion compensation module for performing motion compensation on the current block to obtain a predicted value of the current block when determining to use a bidirectional optical flow prediction mode for the current block; Equipped with The motion compensation module includes: For a unit block having a size of dx*dy in the current block, if it is determined that a minimum SAD value of the unit block is equal to or greater than a preset threshold value 2*dx*dy when the current block uses a motion vector adjustment mode and a bidirectional optical flow prediction mode is used for the current block, performing motion compensation on the unit block to obtain a prediction value of the unit block; used to determine a predicted value of the current block based on a predicted value of each unit block of the current block; The motion compensation module performs motion compensation on the unit block to obtain a predicted value of the unit block, determining a fifth reference block corresponding to the unit block based on a first original motion vector of the unit block; determining a sixth reference block corresponding to the unit block based on a second original motion vector of the unit block; adjusting the first original motion vector and the second original motion vector according to pixel values ​​of the fifth reference block and pixel values ​​of the sixth reference block to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; determining a first reference block corresponding to the unit block from a first reference picture of the current block based on the first target motion vector; determining a third reference block corresponding to the unit block from a second reference picture of the current block based on the second target motion vector; For each sub-block among at least one sub-block included in the unit block, determining a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block, and determining a horizontal motion offset and a vertical motion offset of the sub-block based on the first original predicted value and the second original predicted value; obtaining a prediction compensation value for the sub-block based on the horizontal motion offset and the vertical motion offset; obtaining a target prediction value for the sub-block based on the first original prediction value, the second original prediction value, and the prediction compensation value; is used to determine a predicted value of the unit block based on a target predicted value of each sub-block included in the unit block; Wherein, the prediction value of the current block is obtained by weighting the reference blocks of two reference pictures used in bidirectional prediction, the weighting weights of the two reference pictures of the current block are the same, the directions of the two reference pictures are different, one reference picture is before the current picture and the other reference picture is after the current picture, and the distances from the two reference pictures to the current picture are the same; the two reference pictures are both short-term reference pictures, and the sizes of the two reference pictures are the same as the size of the current picture; 13. An encoding device comprising:

17. When the motion compensation module determines a first original predicted value and a second original predicted value of the sub-block based on the first reference block and the third reference block, expanding the first reference block to obtain a second reference block; Selecting a first target reference block from the second reference block corresponding to the sub-block, and determining a first original predicted value of the sub-block based on pixel values ​​of the first target reference block; expanding the third reference block to obtain a fourth reference block; The apparatus of claim 16, further comprising: a fourth reference block for selecting a second target reference block corresponding to the sub-block; and determining a second original predicted value of the sub-block based on pixel values ​​of the second target reference block.

18. The motion compensation module further comprises: the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component. The apparatus of claim 16, further comprising: a bidirectional optical flow prediction mode for the current block if a condition including:

19. The weighting weights being the same include picture-level weighting weights being the same and block-level weighting weights being the same; 20. The apparatus of claim 18, wherein the picture level weighting weights are the same include picture level luminance weighting weights are the same.

20. The motion compensation module further comprises: the picture level control information being configured to indicate that the current block enables a bidirectional optical flow prediction mode; The current block does not use a combined inter-intra prediction (CIIP) mode, does not use a symmetric motion vector differential (SMVD) mode, and does not use a subblock fusion mode; the current block uses a translational motion model, The current block uses bidirectional prediction, Here, the size of the current block is width 8 or more, height 8 or more, and area 128 or more. The current block only predicts the luminance component. is used to not use the bidirectional optical flow prediction mode for the current block if any of the conditions, including 17. The apparatus of claim 16.

21. A decoding device comprising a processor and a machine-readable storage medium; The machine-readable storage medium stores machine-executable instructions executable by the processor; A decoding device, characterized in that the processor is adapted to implement the decoding method according to any one of claims 1 to 5 by executing machine-executable instructions.

22. A coding device, comprising a processor and a machine-readable storage medium; The machine-readable storage medium stores machine-executable instructions executable by the processor; An encoding device, characterized in that the processor is adapted to implement the encoding method according to any one of claims 6 to 10 by executing machine executable instructions.

23. A non-transitory storage medium having computer instructions stored thereon, A non-transitory storage medium, characterized in that, when the computer instructions are executed by a processor, the decoding method according to any one of claims 1 to 5 is performed.

24. A non-transitory storage medium having computer instructions stored thereon, A non-transitory storage medium, characterized in that, when the computer instructions are executed by a processor, the encoding method according to any one of claims 6 to 10 is performed.

Citation Information

Patent Citations

  • Interaction Between Reference Picture Resampling and Video Coding Tools

    JP2022551937A