Video encoding method and decoding method, apparatus, electronic device, and storage medium

By introducing more motion vector offset adjustment schemes and precision adjustments in video encoding, the problem that bidirectional MMVD failed to effectively consider motion in video compression was solved, thereby improving encoding performance and decoding quality and reducing bitrate.

CN116567259BActive Publication Date: 2026-07-14BEIJING DAJIA INTERNET INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2023-05-10
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing bidirectional MMVD fails to effectively consider various motion scenarios in the video during the video compression process, resulting in poor encoding performance.

Method used

By introducing more motion vector offset adjustment schemes, offset processing is performed for different motion conditions, including the offset strategy and accuracy adjustment of the offset step size for candidate motion vectors. The appropriate offset step size is selected according to the size of the block to improve the matching accuracy of motion vectors.

Benefits of technology

It improves video encoding performance, enhances video encoding and decoding quality, reduces bitrate, and increases encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116567259B_ABST
    Figure CN116567259B_ABST
Patent Text Reader

Abstract

The present disclosure provides a video encoding method and decoding method, device, electronic equipment and storage medium. The video encoding method comprises: obtaining a motion information candidate list of a current block; performing offset processing on each candidate motion vector in the motion information candidate list to obtain a set of extended motion vectors; selecting a target extended motion vector from the set of extended motion vectors as a prediction motion vector of the current block; obtaining encoding information of the current block based on the prediction motion vector of the current block; wherein in the case that a bi-directional motion vector is included in the plurality of candidate motion vectors, a plurality of candidate offset strategies of the bi-directional motion vector are obtained, the plurality of candidate offset strategies comprising a plurality of offset strategies of offsetting the forward motion vector and the backward motion vector in the bi-directional motion vector in the same direction, offsetting in opposite directions and zero offset; based on the plurality of candidate offset strategies, performing offset processing on the forward motion vector and the backward motion vector to obtain a plurality of extended motion vectors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video encoding and decoding technology, and more specifically, to a video encoding method and decoding method, apparatus, electronic device and storage medium. Background Technology

[0002] In video coding, MMVD (Merge with Motion Vector Difference) is an inter-frame prediction technique within the VVC (Versatile Video Coding) standard. MMVD constructs merge candidates using the first two candidate motion information from a merge list, offsetting in both horizontal and vertical directions. Finally, rate-distortion optimization selects the optimal candidate motion information index, offset direction, and offset step size. Based on whether the selected candidate motion information corresponds to a unidirectional or bidirectional prediction direction, MMVD can be divided into unidirectional MMVD and bidirectional MMVD. In the MMVD algorithm, bidirectional MMVD adjusts the offset step size according to the relative POC (Picture Order Count) relationship between the current frame, the forward reference frame, and the backward reference frame. However, this adjustment method does not effectively consider the various motion scenarios contained in the video, resulting in bidirectional MMVD not achieving optimal performance during video compression. Summary of the Invention

[0003] This disclosure provides a video encoding method and decoding method, apparatus, electronic device and storage medium to at least solve the problems in the aforementioned related technologies.

[0004] According to a first aspect of the present disclosure, a video coding method is provided, comprising: obtaining a motion information candidate list for a current block, wherein the motion information candidate list includes a plurality of candidate motion vectors; performing offset processing on each candidate motion vector in the motion information candidate list to obtain an extended motion vector set; selecting a target extended motion vector from the extended motion vector set as a predicted motion vector for the current block; and obtaining coding information for the current block based on the predicted motion vector of the current block; wherein performing offset processing on each candidate motion vector in the motion information candidate list to obtain the extended motion vector set includes: when the plurality of candidate motion vectors includes bidirectional motion vectors, obtaining a plurality of candidate offset strategies for the bidirectional motion vectors, wherein the plurality of candidate offset strategies include a plurality of offset strategies for the forward motion vector and the backward motion vector in the bidirectional motion vectors to offset in the same direction, offset in opposite directions, and zero offset; and performing offset processing on the forward motion vector and the backward motion vector according to a plurality of candidate offset step sizes and a plurality of candidate offset directions based on the plurality of candidate offset strategies to obtain a plurality of extended motion vectors.

[0005] Optionally, the multiple candidate offset strategies may include: both the forward and backward motion vectors are offset in the positive direction; both the forward and backward motion vectors are offset in the negative direction; the forward motion vector is offset in the positive direction and the backward motion vector is offset in the negative direction; the forward motion vector is offset in the negative direction and the backward motion vector is offset in the positive direction; the forward motion vector is offset in the positive direction and the backward motion vector has zero offset; the forward motion vector is offset in the negative direction and the backward motion vector has zero offset; the forward motion vector has zero offset and the backward motion vector is offset in the positive direction; and the forward motion vector has zero offset and the backward motion vector is offset in the negative direction.

[0006] Optionally, the video encoding method may further include: when the target extended motion vector is a bidirectional motion vector, sending first flag information, wherein the first flag information indicates which of the plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is.

[0007] Optionally, the video encoding method may further include: sending second flag information, wherein, when the target extended motion vector is a bidirectional motion vector, the second flag information indicates which of the plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, the plurality of candidate offset directions including the x-axis direction and the y-axis direction.

[0008] Optionally, the video encoding method may further include: determining the motion vector magnitude of a first motion vector, wherein the first motion vector may include the forward motion vector and / or the backward motion vector in the bidirectional motion vectors; scaling the plurality of candidate offset steps used for offsetting the first motion vector based on the motion vector magnitude of the first motion vector, wherein the scaled candidate offset steps are used to perform offsetting on the first motion vector; wherein the larger the motion vector magnitude of the first motion vector, the larger the plurality of candidate offset steps used for offsetting the first motion vector are scaled.

[0009] Optionally, scaling the plurality of candidate offset step sizes used for offsetting the first motion vector based on the motion vector size of the first motion vector may include: multiplying the plurality of candidate offset step sizes by a first scaling factor greater than 1 when both the horizontal and vertical components of the first motion vector are divisible by a first component threshold; and multiplying the plurality of candidate offset step sizes by a second scaling factor greater than 1 when the horizontal and vertical components of the first motion vector are not divisible by the first component threshold but are divisible by a second component threshold; wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0010] Optionally, the video encoding method may further include: determining the size of the current block; selecting a plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block; wherein, the smaller the size of the current block, the smaller the plurality of preset offset steps are selected as the plurality of candidate offset steps.

[0011] Optionally, selecting the plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block may include: selecting a smaller predetermined number of preset offset steps from the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block does not exceed a first size threshold; and determining the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block exceeds the first size threshold.

[0012] Optionally, the video encoding method may further include: sending third flag information, wherein, if the size of the current block does not exceed a first size threshold, the third flag information indicates which of the predetermined number of preset offset steps the offset step corresponding to the target extended motion vector is.

[0013] According to a second aspect of the present disclosure, a video decoding method is provided, comprising: obtaining encoding information and a motion information candidate list of a current block, wherein the motion information candidate list includes a plurality of candidate motion vectors; performing offset processing on each candidate motion vector in the motion information candidate list to obtain an extended motion vector set; selecting a target extended motion vector from the extended motion vector set as a predicted motion vector of the current block; and obtaining reconstructed pixel values ​​of the current block based on the predicted motion vector and the encoding information of the current block; wherein performing offset processing on each candidate motion vector in the motion information candidate list to obtain a plurality of extended motion vectors includes: when the plurality of candidate motion vectors include bidirectional motion vectors, obtaining a plurality of candidate offset strategies for the bidirectional motion vectors, wherein the plurality of candidate offset strategies include offsetting the forward motion vector and the backward motion vector in the bidirectional motion vector in the same direction, offsetting in opposite directions, and zero offsetting; and performing offset processing on the forward motion vector and the backward motion vector according to a plurality of candidate offset step sizes and a plurality of candidate offset directions based on the plurality of candidate offset strategies to obtain a plurality of extended motion vectors.

[0014] Optionally, the multiple candidate offset strategies may include: both the forward and backward motion vectors are offset in the positive direction; both the forward and backward motion vectors are offset in the negative direction; the forward motion vector is offset in the positive direction and the backward motion vector is offset in the negative direction; the forward motion vector is offset in the negative direction and the backward motion vector is offset in the positive direction; the forward motion vector is offset in the positive direction and the backward motion vector has zero offset; the forward motion vector is offset in the negative direction and the backward motion vector has zero offset; the forward motion vector has zero offset and the backward motion vector is offset in the positive direction; and the forward motion vector has zero offset and the backward motion vector is offset in the negative direction.

[0015] Optionally, the video decoding method may further include: when the target extended motion vector is a bidirectional motion vector, receiving first flag information, wherein the first flag information indicates which of the plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is; wherein selecting the target extended motion vector from the set of extended motion vectors includes: selecting the target extended motion vector from the plurality of extended motion vectors based on the first flag information.

[0016] Optionally, the video decoding method may further include: receiving second flag information, wherein, when the target extended motion vector is a bidirectional motion vector, the second flag information indicates which of the plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, the plurality of first candidate offset directions including the x-axis direction and the y-axis direction; wherein, selecting the target extended motion vector from the set of extended motion vectors includes: selecting the target extended motion vector from the plurality of extended motion vectors based on the second flag information.

[0017] Optionally, the video decoding method may further include: determining the motion vector magnitude of a first motion vector, wherein the first motion vector may include the forward motion vector and / or the backward motion vector in the bidirectional motion vectors; scaling the plurality of candidate offset steps used for offsetting the first motion vector based on the motion vector magnitude of the first motion vector, wherein the scaled candidate offset steps are used to perform offsetting on the first motion vector; wherein the larger the motion vector magnitude of the first motion vector, the larger the plurality of candidate offset steps used for offsetting the first motion vector are scaled.

[0018] Optionally, scaling the plurality of candidate offset step sizes used for offsetting the first motion vector based on the motion vector size of the first motion vector may include: multiplying the plurality of candidate offset step sizes by a first scaling factor greater than 1 when both the horizontal and vertical components of the first motion vector are divisible by a first component threshold; and multiplying the plurality of candidate offset step sizes by a second scaling factor greater than 1 when the horizontal and vertical components of the motion vector are not divisible by the first component threshold but are divisible by a second component threshold; wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0019] Optionally, the video decoding method may further include: determining the size of the current block; selecting a plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block; wherein, the smaller the size of the current block, the smaller the plurality of preset offset steps are selected as the plurality of candidate offset steps.

[0020] Optionally, selecting the plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block may include: selecting a smaller predetermined number of preset offset steps from the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block does not exceed a first size threshold; and determining the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block exceeds the first size threshold.

[0021] Optionally, the video decoding method may further include: receiving third flag information, wherein, if the size of the current block does not exceed a first size threshold, the third flag information indicates which of the predetermined number of preset offset steps the offset step size corresponding to the target extended motion vector is; wherein, selecting the target extended motion vector from the set of extended motion vectors includes: selecting the target extended motion vector from the plurality of extended motion vectors based on the third flag information.

[0022] According to a third aspect of the present disclosure, a video encoding apparatus is provided, comprising: an acquisition unit configured to acquire a motion information candidate list for a current block, wherein the motion information candidate list includes a plurality of candidate motion vectors; an offset unit configured to perform offset processing on each candidate motion vector in the motion information candidate list to obtain a plurality of extended motion vectors; a selection unit configured to select a target extended motion vector from the plurality of extended motion vectors as a predicted motion vector for the current block; and an encoding unit configured to obtain encoding information for the current block based on the predicted motion vector of the current block; wherein the offset unit is configured to: acquire a plurality of candidate offset strategies for the bidirectional motion vectors when the plurality of candidate motion vectors include bidirectional motion vectors, wherein the plurality of candidate offset strategies include a plurality of offset strategies for offsetting forward motion vectors and backward motion vectors in the bidirectional motion vectors in the same direction, offsetting in opposite directions, and zero offset; and, based on the plurality of candidate offset strategies, perform offset processing on the forward motion vectors and the backward motion vectors according to a plurality of candidate offset step sizes and a plurality of candidate offset directions to obtain a plurality of extended motion vectors.

[0023] Optionally, the multiple candidate offset strategies may include: both the forward and backward motion vectors are offset in the positive direction; both the forward and backward motion vectors are offset in the negative direction; the forward motion vector is offset in the positive direction and the backward motion vector is offset in the negative direction; the forward motion vector is offset in the negative direction and the backward motion vector is offset in the positive direction; the forward motion vector is offset in the positive direction and the backward motion vector has zero offset; the forward motion vector is offset in the negative direction and the backward motion vector has zero offset; the forward motion vector has zero offset and the backward motion vector is offset in the positive direction; and the forward motion vector has zero offset and the backward motion vector is offset in the negative direction.

[0024] Optionally, the video encoding apparatus may further include: a transmitting unit configured to transmit first flag information when the target extended motion vector is a bidirectional motion vector, wherein the first flag information indicates which of the plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is.

[0025] Optionally, the video encoding apparatus may further include: a transmitting unit configured to transmit second flag information, wherein, when the target extended motion vector is a bidirectional motion vector, the second flag information indicates which of the plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, the plurality of candidate offset directions including the x-axis direction and the y-axis direction.

[0026] Optionally, the video encoding apparatus may further include: a scaling unit configured to determine the motion vector magnitude of a first motion vector, wherein the first motion vector may include the forward motion vector and / or the backward motion vector in the bidirectional motion vectors; and to scale a plurality of candidate offset steps for offsetting the first motion vector based on the motion vector magnitude of the first motion vector, wherein the scaled candidate offset steps are used to perform offsetting on the first motion vector; wherein the larger the motion vector magnitude of the first motion vector, the larger the plurality of candidate offset steps for offsetting the first motion vector are scaled.

[0027] Optionally, the scaling unit can be configured to: multiply the plurality of candidate offset step sizes by a first scaling factor greater than 1 when both the horizontal and vertical components of the first motion vector are divisible by a first component threshold; and multiply the plurality of candidate offset step sizes by a second scaling factor greater than 1 when neither the horizontal nor vertical components of the first motion vector are divisible by the first component threshold but are divisible by a second component threshold; wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0028] Optionally, the video encoding apparatus may further include: a range selection unit configured to determine the size of the current block; and select a plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block; wherein, the smaller the size of the current block, the smaller the plurality of preset offset steps are selected as the plurality of candidate offset steps.

[0029] Optionally, the range selection unit can be configured to: select a predetermined number of smaller preset offset steps from the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block does not exceed the first size threshold; and determine the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block exceeds the first size threshold.

[0030] Optionally, the video encoding apparatus may further include: a transmitting unit configured to transmit third flag information, wherein, if the size of the current block does not exceed a first size threshold, the third flag information indicates which of the predetermined number of preset offset steps the offset step corresponding to the target extended motion vector is.

[0031] According to a fourth aspect of the present disclosure, a video decoding apparatus is provided, comprising: an acquisition unit configured to acquire encoding information and a motion information candidate list of a current block, wherein the motion information candidate list includes a plurality of candidate motion vectors; an offset unit configured to perform offset processing on each candidate motion vector in the motion information candidate list to obtain a plurality of extended motion vectors; a selection unit configured to select a target extended motion vector from the plurality of extended motion vectors as a predicted motion vector of the current block; and a decoding unit configured to obtain reconstructed pixel values ​​of the current block based on the predicted motion vector and the encoding information of the current block; wherein the offset unit is configured to: acquire a plurality of candidate offset strategies for the bidirectional motion vectors when the plurality of candidate motion vectors include bidirectional motion vectors, wherein the plurality of candidate offset strategies include offset strategies for forward and backward motion vectors in the bidirectional motion vectors in the same direction, offset in opposite directions, and zero offset; and, based on the plurality of candidate offset strategies, perform offset processing on the forward and backward motion vectors according to a plurality of candidate offset step sizes and a plurality of candidate offset directions to obtain a plurality of extended motion vectors.

[0032] Optionally, the multiple candidate offset strategies may include: both the forward and backward motion vectors are offset in the positive direction; both the forward and backward motion vectors are offset in the negative direction; the forward motion vector is offset in the positive direction and the backward motion vector is offset in the negative direction; the forward motion vector is offset in the negative direction and the backward motion vector is offset in the positive direction; the forward motion vector is offset in the positive direction and the backward motion vector has zero offset; the forward motion vector is offset in the negative direction and the backward motion vector has zero offset; the forward motion vector has zero offset and the backward motion vector is offset in the positive direction; and the forward motion vector has zero offset and the backward motion vector is offset in the negative direction.

[0033] Optionally, the video decoding apparatus may further include: a receiving unit configured to receive first flag information when the target extended motion vector is a bidirectional motion vector, wherein the first flag information indicates which of the plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is; wherein the selection unit is configured to select the target extended motion vector from the plurality of extended motion vectors based on the first flag information.

[0034] Optionally, the video decoding device may further include: a receiving unit configured to receive second flag information, wherein, when the target extended motion vector is a bidirectional motion vector, the second flag information indicates which of the plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, the plurality of first candidate offset directions including the x-axis direction and the y-axis direction; wherein, the selection unit is configured to select the target extended motion vector from the plurality of extended motion vectors based on the second flag information.

[0035] Optionally, the video decoding apparatus may further include: a scaling unit configured to determine the motion vector magnitude of a first motion vector, wherein the first motion vector may include the forward motion vector and / or the backward motion vector in the bidirectional motion vectors; and to scale a plurality of candidate offset step sizes used for offsetting the first motion vector based on the motion vector magnitude of the first motion vector, wherein the scaled candidate offset step sizes are used to perform offsetting on the first motion vector; wherein the larger the motion vector magnitude of the first motion vector, the larger the plurality of candidate offset step sizes used for offsetting the first motion vector are scaled.

[0036] Optionally, the scaling unit can be configured to: multiply the plurality of candidate offset step sizes by a first scaling factor greater than 1 when both the horizontal and vertical components of the first motion vector are divisible by a first component threshold; and multiply the plurality of candidate offset step sizes by a second scaling factor greater than 1 when the horizontal and vertical components of the motion vector are not divisible by the first component threshold but are divisible by a second component threshold; wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0037] Optionally, the video decoding device may further include: a range selection unit configured to determine the size of the current block; and select a plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block; wherein, the smaller the size of the current block, the smaller the plurality of preset offset steps are selected as the plurality of candidate offset steps.

[0038] Optionally, the range selection unit can be configured to: select a predetermined number of smaller preset offset steps from the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block does not exceed the first size threshold; and determine the plurality of preset offset steps as the plurality of candidate offset steps when the size of the current block exceeds the first size threshold.

[0039] Optionally, the video decoding device may further include: a receiving unit configured to receive third flag information, wherein, when the size of the current block does not exceed a first size threshold, the third flag information indicates which of the predetermined number of preset offset steps the offset step size corresponding to the target extended motion vector is; wherein, the selection unit is configured to select the target extended motion vector from the plurality of extended motion vectors based on the third flag information.

[0040] According to a fifth aspect of the present disclosure, an electronic device includes: at least one processor; and at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform a video encoding method or a video decoding method according to the present disclosure.

[0041] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by at least one processor, causes the at least one processor to perform a video encoding method or a video decoding method according to the present disclosure.

[0042] According to a fifth aspect of the present disclosure, a computer program product is provided, including computer instructions that, when executed by at least one processor, implement a video encoding method or a video decoding method according to the present disclosure.

[0043] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:

[0044] According to the video encoding or decoding method disclosed herein, considering the various motion scenarios that may exist in the video, more motion vector offset adjustment schemes are introduced (e.g., for symmetrical motion scenarios, asymmetrical motion scenarios, no relative motion scenarios, etc.), so as to more effectively represent the various motion scenarios included in the video, thereby improving the encoding performance of MMVD and achieving the effect of improving the video encoding and decoding quality.

[0045] Furthermore, according to the video encoding or decoding method disclosed herein, the precision of the offset step is adjusted based on the precision of the candidate motion vector, so that the precision of the offset step is more closely matched with the precision of the candidate motion vector, thereby improving the encoding performance of MMVD and achieving the effect of improving video encoding and decoding quality.

[0046] Furthermore, according to the video encoding or decoding method disclosed herein, different offset step ranges are selected from the original offset step range based on blocks of different sizes, thereby reducing the bit rate and improving encoding efficiency.

[0047] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0049] Figure 1 This is an exemplary block diagram illustrating a block-based video coding system;

[0050] Figure 2 This is an exemplary block diagram illustrating a block-based video decoding system;

[0051] Figure 3 This is a schematic diagram showing the MMVD offset direction;

[0052] Figure 4 This is a schematic diagram illustrating continuous motion in a video;

[0053] Figure 5 This is a schematic diagram illustrating discontinuous motion in a video;

[0054] Figure 6 This is a flowchart illustrating a video encoding method according to an exemplary embodiment of the present disclosure.

[0055] Figure 7 This is a flowchart illustrating a video decoding method according to an exemplary embodiment of the present disclosure;

[0056] Figure 8 This is a block diagram illustrating a video encoding apparatus according to an exemplary embodiment of the present disclosure;

[0057] Figure 9 This is a block diagram illustrating a video decoding apparatus according to an exemplary embodiment of the present disclosure;

[0058] Figure 10 This is a block diagram of an electronic device 1000 according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0059] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0060] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following examples do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0061] It should be noted that the phrase "at least one of several items" in this disclosure refers to three parallel cases: "any one of the several items", "a combination of any number of the several items", and "all of the several items". For example, "including at least one of A and B" includes the following three parallel cases: (1) including A; (2) including B; (3) including A and B. As another example, "performing at least one of step one and step two" indicates the following three parallel cases: (1) performing step one; (2) performing step two; (3) performing both step one and step two.

[0062] Figure 1This is an exemplary block diagram illustrating a block-based video coding system. The input video signal comprises signals of multiple image frames, each of which can be processed block by block. Here, a block can be, for example, but not limited to, a Coding Tree Unit (CTU), a Largest Coding Unit (LCU), a Coding Unit (CU), a Prediction Unit (PU), and a Transform Unit (TU).

[0063] The principle of video coding is to use the similarity between consecutive image frames and the similarity between adjacent blocks within the same image frame / strip to encode a portion of representative image frames or blocks according to their original pixel values. For other image frames or blocks besides the representative ones, the pixel values ​​are predicted by using the similarity between consecutive image frames or adjacent blocks, thereby compressing the video signal to remove redundancy in the spatial and temporal dimensions.

[0064] When performing video encoding, spatial and / or temporal predictions can be performed on blocks of the current image frame, depending on whether the similarity between adjacent blocks or between consecutive image frames is utilized.

[0065] Spatial prediction (or "intra-frame prediction") uses the pixel values ​​of pixels from reconstructed neighboring blocks in the same image frame / strip stored in memory (called reference pixels) to predict the current block, resulting in a predicted block. Spatial prediction reduces the spatial redundancy inherent in the video signal.

[0066] Temporal prediction (also known as "inter-frame prediction" or "motion-compensated prediction") corresponds to Figure 1 The "motion estimation" and "motion compensation" sections use reconstructed pixels from already encoded image frames (called "reference image frames") stored in the image frame buffer to predict the current block, resulting in a predicted block. Temporal prediction reduces the inherent temporal redundancy in the video signal. The temporal prediction signal for the current block is typically determined based on one or more predicted motion vectors, which indicate the motion offset and direction between the current block and its temporal reference (called a "reference block," a block in the reference image frame). The process of determining the predicted motion vectors is called motion estimation; the process of determining the reference block based on the predicted motion vectors, the current block, and the reference image frame is called motion compensation, and the determined reference block becomes the predicted block. Furthermore, if the encoder and decoder support multiple reference image frames, the encoder sends an additional reference image frame index when sending encoded information to the decoder. This index identifies which reference image frame in the image frame buffer the temporal prediction signal originates from, i.e., which reference image frame is used for motion compensation.

[0067] Following spatial and / or temporal prediction, the encoder determines the spatial / temporal mode, for example, by selecting the optimal prediction mode based on rate-distortion optimization methods. Then, the difference between the current block and the predicted block is determined, specifically by subtracting the corresponding pixel values ​​of the predicted block from the pixel values ​​of each pixel in the current block to obtain the prediction residual. The prediction-related information, such as the encoding mode (temporal or spatial), motion information, and the prediction residual, are then encoded to obtain the encoded information of the current block. This encoded information can be sent to the decoder via a bitstream. Furthermore, based on the prediction residual and the predicted block, the reconstructed signal of the current block can be determined, which is the encoded and compressed pixel values ​​of each pixel in the current block, and stored in memory. Before placing the reconstructed signal of the current block (which may be referred to as the "reconstructed block" signal) into the image frame buffer as a reference block for encoding future blocks, further loop filtering can be applied to the reconstructed block, such as, but not limited to, at least one of a deblocking filter, pixel adaptive offset, and adaptive loop filter.

[0068] Figure 2 This is an exemplary block diagram illustrating a block-based video decoding system. (Example:) Figure 2 As shown, after receiving the video bitstream, the decoding end first performs decoding processing to obtain prediction-related information and prediction residuals. The prediction-related information is sent to a spatial prediction unit (if intra-frame coded) or a temporal prediction unit (if inter-frame coded) to form prediction blocks. Combining the prediction residuals and prediction blocks, reconstructed blocks are determined and stored in memory. The reconstructed blocks may undergo further loop filtering before being stored in the image frame buffer, for example, but not limited to, at least one of deblocking filters, pixel adaptive offsets, and adaptive loop filters. The reconstructed video in the image frame buffer is then output for display, along with blocks for predicting future blocks. In temporal prediction mode, motion compensation can be performed on the current block using the corresponding prediction block in a reference image frame.

[0069] Merge mode is a motion vector prediction mode used in video encoding and decoding. It uses motion vectors from temporally or spatially adjacent blocks to predict the motion vector of the current block. In merge mode, a candidate list of motion information (also called a merge candidate list) is constructed for the current block. This list includes five candidate motion information items, each containing information such as motion vector, prediction direction, reference frame index, and motion vector precision. By traversing these five candidate motion information items, the one with the lowest rate-distortion cost is selected as the candidate motion information for the current block. No motion information (such as reference frame index, motion vector precision index, and prediction direction) needs to be transmitted in the bitstream; only the index of the selected candidate motion information in the list needs to be transmitted. These five candidate motion information items can be, in order: motion information of adjacent blocks (spatial merge candidate), motion information of co-located blocks (temporal merge candidate), motion information of adjacent blocks determined based on historical references (spatial merge candidate based on historical references), average motion information of multiple adjacent blocks (spatial average candidate), and zero motion vector information. The prediction direction can include one-way prediction (L0 prediction or L1 prediction) or two-way prediction (L0 prediction and L1 prediction). L0 prediction refers to forward prediction, which means using the image frame before the current image frame as the reference image frame. L1 prediction refers to backward prediction, which means using the image frame after the current image frame as the reference image frame.

[0070] The MMVD mode is similar to the above-mentioned merge mode (also known as the normal merge mode), and it constructs the motion information candidate list in the same way as the merge mode. However, the differences are as follows: (1) The MMVD mode uses the first two motion information in the merge candidate list to construct the MMVD motion information candidate list. That is, the motion information candidate list in the MMVD mode only has two candidate motion information. It only needs to traverse the two candidate motion information and select the candidate motion information with the lowest rate distortion cost; (2) The MMVD mode does not directly use the motion information in the motion information candidate list to perform motion compensation on the current block. Instead, it makes a certain offset adjustment to the motion information and uses the offset-adjusted motion information to perform motion compensation on the current block. Therefore, when transmitting motion information, the MMVD mode, in addition to transmitting the list index of the selected candidate motion information as in the merge mode, also needs to transmit the information for offset adjustment of the motion vector, such as the offset step size and offset direction. The following will specifically introduce how the MMVD mode performs offset adjustment on the candidate motion vectors in the motion information candidate list.

[0071] In MMVD mode, the candidate motion vectors in the motion information candidate list can be used as the starting point in the reference frame, and offset in 4 offset directions (positive and negative x-axis and positive and negative y-axis) and 8 offset steps (1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32) to form different motion vectors. Figure 3 This is a schematic diagram illustrating the MMVD offset direction. (Refer to...) Figure 3 The dashed dot represents the starting point of the modified motion vector in the reference frame. It can perform eight offset step sizes in the four offset directions (up, down, left, right) of the L0 or L1 reference frame to obtain a new motion vector (also known as an extended motion vector).

[0072] When the prediction direction of candidate motion information in the motion information candidate list of the MMVD mode is unidirectional, the MMVD mode is a unidirectional MMVD mode. That is, the current block (also called the current coding block) is predicted unidirectionally, referring only to either the forward reference frame (L0 reference frame) or the backward reference frame (L1 reference frame). When the prediction direction of candidate motion information in the motion information candidate list of the MMVD mode is bidirectional, the MMVD mode is a bidirectional MMVD mode. That is, the current block is predicted bidirectionally, requiring simultaneous reference to either the forward reference frame (L0 reference frame) or the backward reference frame (L1 reference frame).

[0073] The following example illustrates the process of adjusting the candidate motion vector offset in unidirectional MMVD mode.

[0074] Assuming the candidate motion vector MV in the motion information candidate list of the MMVD mode is {a,b}, and the offset step size is c, then the offsets MVoffset in the four offset directions are {c,0} (positive x-axis), {-c,0} (negative x-axis), {0,c} (positive y-axis), and {0,-c} (negative y-axis). Therefore, the new motion vector MVfinal after offset adjustment = MV + MVoffset. In other words, based on the offset step size c, offsetting in the four offset directions yields four new motion vectors MVfinal.

[0075] Positive x-axis direction: MVfinal = {a,b} + {c,0} = {a + c,b};

[0076] Negative x-axis direction: MVfinal = {a,b} + {-c,0} = {ac,b};

[0077] Positive y-axis direction: MVfinal = {a, b} + {0, c} = {a, b + c}

[0078] Positive y-axis direction: MVfinal = {a, b} + {0, -c} = {a, bc}.

[0079] For bidirectional MMVD mode, since there are two motion vectors MV (i.e., forward motion vector MV0 and backward motion vector MV1) in the candidate motion vectors, it is necessary to derive two offsets simultaneously: MV0offset (forward motion vector offset) and MV1offset (backward motion vector offset). The process of deriving MV0offset is the same as that of unidirectional MMVD. MV1offset is determined by the values ​​of the current frame's POC, the forward reference frame's POC0, and the backward reference frame's POC1, as follows:

[0080] If (POC0-POC)×(POC1-POC)>=0, then MV1offset=MV0offset; otherwise, if (POC0-POC)×(POC1-POC)<0, then MV1offset=MV0offset×(-1). The following example illustrates the process of adjusting the candidate motion vector offset in the bidirectional MMVD mode.

[0081] Assuming the forward motion vector MV0 of the candidate motion vectors is {a0, b0}, the backward motion vector MV1 is {a1, b1}, POC = 2, POC 0 = 1, POC 1 = 3, and the offset compensation is c, then the offset step size in the four directions is:

[0082] Positive x-axis direction: MV0offset = {c, 0}, MV1offset = {-c, 0};

[0083] Negative x-axis direction: MV0offset = {-c, 0}, MV1offset = {c, 0};

[0084] Positive y-axis direction: MV0offset = {0, c}, MV1offset = {0, -c};

[0085] Negative y-axis direction: MV0offset = {0, -c}, MV1offset = {0, c};

[0086] Based on the offset step size c, offset processing is performed in four offset directions, and four new motion vectors can be obtained from the forward motion vector MV0 and the backward motion vector MV1:

[0087] Positive x-axis direction: MV0final={a0,b0}+{c,0}={a0+c,b0},MV1final={a1,b1}+{-c,0}={a1-c,b1};

[0088] Negative x-axis direction: MV0final={a0,b0}+{-c,0}={a0-c,b0},MV1final={a1,b1}+{c,0}={a1+c,b1};

[0089] Positive y-axis direction: MV0final={a0,b0}+{0,c}={a0,b0+c},MV1final={a1,b1}+{0,-c}={a1,b1-c};

[0090] Negative y-axis direction: MV0final={a0,b0}+{0,-c}={a0,b0-c},MV1final={a1,b1}+{0,c}={a1,b1+c}。

[0091] It is evident that, regardless of whether it is a unidirectional or bidirectional MMVD mode, it is necessary to select the optimal extended motion information from the 64 extended motion information (2×4×8) resulting from the combination of 2 candidate motion information, 4 offset directions, and 8 offset step sizes through rate-distortion optimization. The offset direction and offset step size of the optimal extended motion information will be encoded into the bitstream and sent to the decoding end.

[0092] Therefore, each block that selects the MMVD mode needs to encode three flag information into the bitstream, namely the candidate list index (mmvd_cand_flag), the offset step index (mmvd_distance_idx), and the direction index (mmvd_direction_idx).

[0093] The `mmvd_cand_flag` flag indicates which of the two candidate motion information options in MMVD mode is selected; therefore, only one bit is needed to represent this information. See Table 1 below for details:

[0094] Table 1. Meaning of mmvd_cand_flag flag information

[0095] value meaning 0 Select the zeroth candidate motion information 1 Select the first candidate motion information

[0096] `mmvd_distance_idx` indicates which of the eight offset steps to select. It is encoded using truncated unary codes, and its information requires 1 to 7 bits depending on the selected offset step. See Table 2 for details.

[0097] Table 2: Meaning of mmvd_distance_flag flag information

[0098] value meaning 0 Select the 0th offset step. 10 Select the first offset step. 110 Select the second offset step. 1110 Choose the third offset step. 11110 Choose the 4th offset step. 111110 Select the 5th offset step. 1111110 Select the 6th offset step. 1111111 Select the 7th offset step.

[0099] `mmvd_direction_idx` indicates which of the four offset directions to select; therefore, it requires 2 bits to represent its information. See Table 3 below for details:

[0100] Table 3. Meaning of mmvd direction idx flag information

[0101] value meaning 00 Choose the positive x-axis direction 01 Choose the negative x-axis direction 10 Select the positive direction of the y-axis 11 Choose the negative y-axis direction.

[0102] As can be seen from the above adjustment method for candidate motion vectors of bidirectional MMVD (i.e. the setting method of forward MV0 offset and backward MV1 offset), it is assumed that the motion in the video follows a continuous motion in a fixed direction in time sequence. Figure 4 This is a schematic diagram illustrating continuous motion in a video. For example... Figure 4 As shown, since the current frame is located between the forward reference frame and the backward reference frame in terms of timing, assuming that the video motion is continuous in the forward reference frame, the current frame, and the backward reference frame, the motion of the current block has strong symmetry between the forward and backward reference frames. For example, if the displacement of the current block in the current frame relative to the corresponding reference block in the forward reference frame is +s, then its displacement relative to the corresponding reference block in the backward reference frame is -s. If the displacement of the current block in the current frame relative to the corresponding reference block in the forward reference frame is +2s, then its displacement relative to the corresponding reference block in the backward reference frame is -2s. If the displacement of the current block in the current frame relative to the corresponding reference block in the forward reference frame is +3s, then its displacement relative to the corresponding reference block in the backward reference frame is -3s. Therefore, bidirectional MMVD uses a method to adjust the MV1 offset based on the relative relationship of the POCs of the forward reference frame, the current frame, and the backward reference frame.

[0103] However, the motion in actual videos is quite complex, and often the motion in the video is not continuous in the forward reference frame, the current frame, and the backward reference frame. Figure 5 This is a schematic diagram illustrating discontinuous motion in a video. For example... Figure 5 As shown in (a) and (b), the POC of the forward reference frame is 1, the POC of the current frame is 4, and the POC of the backward reference frame is 5. This means that the current frame is 3 frames away from the forward reference frame, which is relatively far, while the current frame is adjacent to the backward reference frame, which is relatively close. Therefore, the motion of the reference block in the forward reference frame, the current block in the current frame, and the reference block in the backward reference frame is not continuous. Specifically, as... Figure 5 As shown in (a), the relative position of the current block in the current frame to the reference block (i.e., the best-matching block) in the backward reference frame is basically not offset; as Figure 5As shown in (b), the current block in the current frame is positioned directly above the reference block in both the forward and backward reference frames. Therefore, for... Figure 5 In terms of the motion scenarios (a) and (b), the current method of adjusting MV1 offset based on the relative relationship of POCs of the forward reference frame, the current frame, and the backward reference frame obviously cannot find the reference block that best matches the current block in the forward reference frame and the backward reference frame.

[0104] To address the aforementioned issues, this disclosure proposes a video encoding and decoding method that optimizes the motion vector offset adjustment scheme in bidirectional MMVD mode. Instead of adjusting the MV1 offset based on the relative relationship of the Proof-of-Concept (POC) of the forward reference frame, current frame, and backward reference frame, it considers various motion scenarios in the video and introduces more motion vector offset adjustment schemes (e.g., for symmetrical motion, asymmetrical motion, and no relative motion). This allows for a more effective representation of various motion scenarios in the video, thereby improving MMVD encoding performance and enhancing video encoding / decoding quality. Furthermore, the proposed video encoding and decoding method adjusts the offset step size precision based on the precision of the candidate motion vectors, ensuring a better match between the offset step size precision and the candidate motion vector precision, further improving MMVD encoding performance and enhancing video encoding / decoding quality. Additionally, the proposed video encoding and decoding method selects different offset step size ranges from the original offset step size range based on different block sizes, thereby reducing the bitrate and improving encoding efficiency.

[0105] The following will refer to Figures 6 to 10 This will specifically describe the video encoding and video decoding methods according to this disclosure.

[0106] Figure 6 This is a flowchart illustrating a video encoding method according to an exemplary embodiment of the present disclosure.

[0107] Reference Figure 6 In step 601, a motion information candidate list for the current block can be obtained, wherein the motion information candidate list includes multiple candidate motion vectors. Here, the motion information candidate list in MMVD mode may include, for example, but not limited to, two candidate motion vectors. As described above, in an exemplary embodiment, when constructing the motion information candidate list in MMVD mode, the same method as constructing the merge candidate list in normal merge mode can be used to obtain the first two candidate motion vectors to construct the motion information candidate list in MMVD mode.

[0108] In step 602, offset processing can be performed on each candidate motion vector in the motion information candidate list to obtain an extended motion vector set. As described above, in related technologies, assuming there are 2 candidate motion vectors, 4 offset directions, and 8 offset steps, after traversing and performing offset processing, (2×4×8)64 extended motion vectors can be obtained to form an extended motion vector set.

[0109] According to an exemplary embodiment of this disclosure, when the candidate motion vectors in the motion information candidate list include bidirectional motion vectors, multiple candidate offset strategies for the bidirectional motion vectors are obtained. These multiple candidate offset strategies include offset strategies for the forward and backward motion vectors in the bidirectional motion vectors, such as offsetting in the same direction, offsetting in opposite directions, and zero offset. Based on these multiple candidate offset strategies, offset processing is performed on the forward and backward motion vectors according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors. Here, the multiple offset strategies for the forward and backward motion vectors in the bidirectional motion vectors, such as offsetting in the same direction, offsetting in opposite directions, and zero offset, can effectively cover more motion cases (e.g., symmetrical motion cases, asymmetrical motion cases, no relative motion cases, etc.) in the coded blocks of the video frame. This allows for a more effective representation of various motion cases included in the video, thereby improving the coding performance of MMVD and achieving the effect of improving video encoding and decoding quality.

[0110] According to exemplary embodiments of this disclosure, the following scenarios can be considered: forward and backward motion vectors offset in the same direction, offset in opposite directions, and zero offset. Eight offset strategies are designed for the forward and backward motion vectors: both forward and backward motion vectors offset in the positive direction; both forward and backward motion vectors offset in the negative direction; the forward motion vector offset in the positive direction and the backward motion vector offset in the negative direction; the forward motion vector offset in the negative direction and the backward motion vector offset in the positive direction; the forward motion vector offset in the positive direction and the backward motion vector offsets to zero; the forward motion vector offset in the negative direction and the backward motion vector offsets to zero; the forward motion vector offsets to zero and the backward motion vector offsets to the positive direction; and the forward motion vector offsets to zero and the backward motion vector offsets to the negative direction. These eight candidate offset strategies can be applied to either the x-axis or y-axis direction. Of course, this disclosure is not limited to these eight candidate offset strategies; other candidate offset strategies can be designed based on various complex motion situations.

[0111] For example, assuming the offset step size is offset, and the base MV offset baseMVoffset is determined based on offset, for example, for the x-axis direction, baseMVoffset = {offset, 0}, and for the y-axis direction, baseMVoffset = {0, offset}. Additionally, zero offset can be represented as zeroMVoffset. Therefore, the eight candidate offset strategies can be determined as follows:

[0112] Candidate 0: MV0offset=baseMVoffset MV1offset=baseMVoffset

[0113] Candidate 1: MV0offset=baseMVoffset MV1offset=baseMVoffset×(-1)

[0114] Candidate 2: MV0offset=baseMVoffset×(-1)MV1offset=baseMVoffset

[0115] Candidate 3: MV0offset = baseMVoffset × (-1) MV1offset = baseMVoffset × (-1)

[0116] Candidate 4: MV0offset=baseMVoffset MV1offset=zeroMVoffset

[0117] Candidate 5: MV0offset=zeroMVoffset MV1offset=baseMVoffset

[0118] Candidate 6: MV0offset = baseMVoffset × (-1)MV1offset = zeroMVoffset

[0119] Candidate 7: MV0offset = zeroMVoffset MV1offset = baseMVoffset × (-1)

[0120] The eight candidates mentioned above include cases where the forward motion vector MV0 and the backward motion vector MV1 are offset in the same and opposite directions. They also introduce zero offset (i.e., zero offset of the motion vector, where both the vertical and horizontal components are zero), thus including cases where only the forward motion vector MV0 or only the backward motion vector MV1 is considered. These eight candidates effectively encompass representations of more motion scenarios within the coded block. For example, candidates 4 and 0 can respectively represent... Figure 5 To better represent the two motion scenarios (a) and (b).

[0121] As can be seen, in the above exemplary embodiments of this disclosure, assuming that both candidate motion vectors are bidirectional motion vectors, after traversing and performing offset processing based on the above 8 candidate offset schemes, 2 offset directions (x-axis and y-axis), and 8 offset step sizes, 256 extended motion vectors (2×8×2×8) can be obtained to form an extended motion vector set. However, as mentioned above, under the existing offset adjustment scheme based on the POC relative relationship in the bidirectional MMVD mode, only 64 extended motion vectors can be obtained. Therefore, the candidate motion vector offset optimization scheme of the bidirectional MMVD mode of this disclosure can cover more video motion situations compared with the existing offset adjustment scheme, and can better represent various motion situations in the video, thereby selecting the reference block that best matches the motion situation of the current block and improving the coding quality.

[0122] According to exemplary embodiments of this disclosure, the precision of the candidate offset step can be adjusted based on the precision of the candidate motion vectors. Specifically, the precision of MV0offset and MV1offset can be scaled according to the precision of the forward motion vector MV0 and the backward motion vector MV1, respectively, so that the precision of the offset step matches the precision of the motion vectors, thereby achieving better coding quality. For example, if the size of the motion vector MV0 or MV1 is larger (indicating lower motion vector precision), MV0offset or MV1offset can be adjusted to be larger (indicating lower offset step precision). Conversely, if the size of the motion vector MV0 or MV1 is smaller (indicating higher motion vector precision), MV0offset or MV1offset can be adjusted to be smaller (indicating higher offset step precision).

[0123] Therefore, in an exemplary embodiment, the motion vector magnitude (including the horizontal component magnitude and the vertical component magnitude) of the first motion vector can be determined. Here, the first motion vector may include a forward motion vector and / or a backward motion vector in a bidirectional motion vector. Subsequently, based on the motion vector magnitude of the first motion vector, a plurality of candidate offset step sizes used for offsetting the first motion vector can be scaled, wherein the scaled candidate offset step sizes are used to perform offsetting on the first motion vector. That is, the first motion vector is offset using the scaled candidate offset step sizes to obtain an extended motion vector of the first motion vector, which is then placed into an extended motion vector set. Here, the larger the motion vector magnitude of the first motion vector, the larger the scaled candidate offset step sizes are.

[0124] For example, if both the horizontal and vertical components of the first motion vector divide the first component threshold (e.g., but not limited to, 32), the multiple candidate offset step sizes are multiplied by a first scaling factor greater than 1 (e.g., but not limited to, 4). If the horizontal and vertical components of the first motion vector do not divide the first component threshold but both divide the second component threshold (e.g., but not limited to, 16), the multiple candidate offset step sizes are multiplied by a second scaling factor greater than 1 (e.g., but not limited to, 2). If neither the horizontal nor vertical components of the first motion vector divide the first nor the second component threshold, the multiple candidate offset step sizes are multiplied by a third scaling factor equal to 1 (i.e., no scaling), where the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor. Taking MV0 and MV0offset as examples (the scaling judgment for MV1offset is similar), assuming the horizontal component of MV0 is m and the vertical component is n, then:

[0125] a) If both m and n are divisible by 32, then multiply the horizontal and vertical components of MV0offset by 4, i.e., MV0offset = MV0offset × 4;

[0126] b) If a) is not satisfied, if both m and n are divisible by 16, then multiply the horizontal and vertical components of MV0offset by 2, i.e., MV0offset = MV0offset × 2;

[0127] c) If neither a) nor b) is satisfied, then the precision of MV0offset is not scaled.

[0128] Furthermore, statistics or experience show that the range of offset step sizes selected varies for blocks of different sizes. For example, smaller blocks tend to choose smaller offset step sizes, while larger blocks have a more even probability of choosing both smaller and larger offset step sizes. Therefore, this disclosure proposes to limit the selection range of offset step sizes based on the different sizes of the blocks. For example, for smaller blocks, determining a smaller range of offset step sizes can reduce the bitrate and improve coding efficiency. According to an exemplary embodiment of this disclosure, the size of the current block is determined; based on the size of the current block, multiple candidate offset step sizes are selected from multiple preset offset step sizes (e.g., 8 preset offset step sizes {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}); wherein, the smaller the size of the current block, the smaller the multiple preset offset step sizes are selected as multiple candidate offset step sizes.

[0129] For example, if the size (width × height) of the current block does not exceed a first size threshold (e.g., but not limited to, 256), a smaller predetermined number of preset offset steps (e.g., but not limited to, {1 / 4, 1 / 2, 1, 2}) are selected from multiple preset offset steps as multiple candidate offset steps; if the size of the current block exceeds the first size threshold, all of the multiple preset offset steps (e.g., {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}) are determined as multiple candidate offset steps, that is, consistent with the original MMVD design. Of course, the method disclosed herein for determining different offset step sizes based on different block sizes is not limited to this. Other suitable methods may also be used. For example, multiple size steps may be set. For example, but not limited to, when the size does not exceed 128, candidate offset step sizes {1 / 4, 1 / 2} are selected; when the size exceeds 128 but does not exceed 256, candidate offset step sizes {1 / 4, 1 / 2, 1, 2} are selected; and when the size exceeds 256, candidate offset step sizes {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32} are selected.

[0130] In step 603, a target extended motion vector can be selected from the set of extended motion vectors as the predicted motion vector for the current block. The optimal extended motion vector can be selected from the set of extended motion vectors using a rate-distortion optimization algorithm. That is, the rate-distortion cost of each extended motion vector in the set can be calculated, and the extended motion vector with the minimum rate-distortion cost can be selected as the target extended motion vector.

[0131] In step 604, the encoding information of the current block can be obtained based on the predicted motion vector of the current block. The execution of this step can be referenced in the preceding introduction to block-based video coding and decoding systems.

[0132] Flag information signaling in bidirectional MMVD mode

[0133] According to an exemplary embodiment of this disclosure, in the offset optimization scheme for candidate motion vectors in bidirectional MMVD mode according to this disclosure, in addition to sending the three flag information in MMVD mode, namely, the encoding candidate list index (mmvd_cand_flag), the offset step size index (mmvd_distance_idx), and the offset direction index (mmvd_direction_idx), an additional flag information, the offset strategy index (mmvd_mv_offset_idx), is needed to indicate which candidate offset strategy among multiple candidate offset strategies has been selected. Therefore, in an exemplary embodiment, when the target extended motion vector is a bidirectional motion vector, a first flag information can be sent, which indicates which of the multiple candidate offset strategies (e.g., the aforementioned eight candidate offset strategies) the offset strategy corresponding to the target extended motion vector is.

[0134] For example, the first flag information mmvd_mv_offset_idx can be shown in Table 4 below:

[0135] Table 4. Meaning of mmvd_mv_offset_idx flag information

[0136]

[0137]

[0138] In this case, the first flag information mmvd_mv_offset_idx needs to use 3 bits to indicate which candidate offset strategy the current block has selected.

[0139] According to an exemplary embodiment of this disclosure, when multiple candidate offset strategies are designed for the x-axis and y-axis, it is not necessary to strictly determine the offset direction for the x-axis and y-axis; it is only necessary to indicate whether the offset is on the x-axis or y-axis. Therefore, the flag information mmvd_direction_idx for the offset direction index is redesigned, as shown in Table 5 below:

[0140] Table 5. Meaning of the optimized mmvd_direction_idx flag information

[0141] value meaning 0 Select x-axis 1 Select the y-axis

[0142] As can be seen, the mmvd_direction_idx flag information only requires 1 bit to represent, saving 1 bit compared to the original mmvd_direction_idx flag information. Therefore, in an exemplary embodiment, a second flag information can be sent. When the target extended motion vector is a bidirectional motion vector, the second flag information indicates which of a plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, where the plurality of candidate offset directions includes the x-axis direction and the y-axis direction; when the target extended motion vector is a unidirectional motion vector, the second flag information indicates which of a plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, where the plurality of candidate offset directions includes the positive x-axis direction, the negative x-axis direction, the positive y-axis direction, and the negative y-axis direction.

[0143] According to an exemplary embodiment of this disclosure, when the block size does not exceed a first size threshold, the selection range of its offset step size is limited. Therefore, for blocks in this case, the flag information mmvd_distance_flag for the offset step size index is also redesigned. Assuming that when the block size does not exceed the first size threshold, the four smaller offset steps are selected from the original offset step size range as the offset step size selection range, as shown in Table 6 below:

[0144] Table 6 defines the meaning of the mmvd_distance_flag flag information for blocks whose size does not exceed the first size threshold.

[0145] value Meaning 0 Select the 0th offset step. 10 Select the first offset step. 110 Select the second offset step. 111 Choose the third offset step.

[0146] As can be seen, under the above assumptions, for blocks whose size does not exceed the first size threshold, only 1 to 3 bits are needed to represent their offset step size information, which is reduced compared to the bit range of the original mmvd_distance_flag flag information, thereby reducing the bit rate and improving coding efficiency. In an exemplary embodiment, third flag information can be sent. When the size of the current block does not exceed the first size threshold, the third flag information indicates which of a predetermined number of preset offset steps (e.g., the first 4 preset offset steps) the offset step size corresponding to the target extended motion vector is; when the size of the current block exceeds the first size threshold, the third flag information indicates which of all the multiple preset offset steps (e.g., 8 preset offset steps) the offset step size corresponding to the target extended motion vector is.

[0147] Figure 7 This is a flowchart illustrating a video decoding method according to an exemplary embodiment of the present disclosure.

[0148] Reference Figure 7In step 701, the encoding information and motion information candidate list of the current block can be obtained, wherein the motion information candidate list includes multiple candidate motion vectors. Here, the encoding information is the information obtained by the encoder after encoding the current block and sent to the decoder. On the decoder side, the construction method of the motion information candidate list is the same as that of the motion information candidate list on the encoding side, so it will not be described again here.

[0149] In step 702, offset processing can be performed on each candidate motion vector in the motion information candidate list to obtain an extended motion vector set. On the decoding side, the extended motion vector set is constructed in the same way as the extended motion vector set constructed on the encoding side.

[0150] According to an exemplary embodiment of the present disclosure, when the candidate motion vectors in the motion information candidate list include bidirectional motion vectors, multiple candidate offset strategies for the bidirectional motion vectors are obtained. The multiple candidate offset strategies include multiple offset strategies for offsetting the forward motion vector and the backward motion vector in the bidirectional motion vector in the same direction, offsetting in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors.

[0151] According to exemplary embodiments of this disclosure, the following scenarios can be considered: forward and backward motion vectors offset in the same direction, offset in opposite directions, and zero offset. Eight offset strategies are designed for the forward and backward motion vectors: both forward and backward motion vectors offset in the positive direction; both forward and backward motion vectors offset in the negative direction; the forward motion vector offset in the positive direction and the backward motion vector offset in the negative direction; the forward motion vector offset in the negative direction and the backward motion vector offset in the positive direction; the forward motion vector offset in the positive direction and the backward motion vector offsets to zero; the forward motion vector offset in the negative direction and the backward motion vector offsets to zero; the forward motion vector offsets to zero and the backward motion vector offsets to the positive direction; and the forward motion vector offsets to zero and the backward motion vector offsets to the negative direction. These eight candidate offset strategies can be applied to either the x-axis or y-axis direction. Of course, this disclosure is not limited to these eight candidate offset strategies; other candidate offset strategies can be designed based on various complex motion situations.

[0152] According to exemplary embodiments of this disclosure, the precision of the candidate offset step size can be adjusted based on the precision of the candidate motion vector, such that the precision of the offset step size matches the precision of the motion vector. In one exemplary embodiment, the motion vector magnitude (including the horizontal component magnitude and the vertical component magnitude) of the first motion vector can be determined. Here, the first motion vector may include a forward motion vector and / or a backward motion vector in a bidirectional motion vector. Subsequently, based on the motion vector magnitude of the first motion vector, a plurality of candidate offset step sizes used for offsetting the first motion vector can be scaled, wherein the scaled candidate offset step sizes are used to perform offsetting on the first motion vector. That is, the first motion vector is offset using the scaled candidate offset step sizes to obtain an extended motion vector of the first motion vector, which is then placed into an extended motion vector set. Here, the larger the motion vector magnitude of the first motion vector, the larger the scaled candidate offset step sizes are.

[0153] For example, if both the horizontal and vertical components of the first motion vector divide the first component threshold (e.g., but not limited to, 32), the multiple candidate offset step sizes are multiplied by a first scaling factor greater than 1 (e.g., but not limited to, 4). If the horizontal and vertical components of the first motion vector do not divide the first component threshold but both divide the second component threshold (e.g., but not limited to, 16), the multiple candidate offset step sizes are multiplied by a second scaling factor greater than 1 (e.g., but not limited to, 2). If neither the horizontal nor vertical components of the first motion vector divide the first component threshold nor the second component threshold, the multiple candidate offset step sizes are multiplied by a third scaling factor equal to 1 (i.e., no scaling is performed), wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0154] According to an exemplary embodiment of this disclosure, the selection range of the offset step size can be limited according to different block sizes. For example, for smaller blocks, a smaller selection range of offset step sizes can be determined, thereby reducing the bitrate and improving coding efficiency. According to an exemplary embodiment of this disclosure, the size of the current block is determined; based on the size of the current block, multiple candidate offset step sizes are selected from multiple preset offset step sizes (e.g., 8 preset offset step sizes {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}); wherein, the smaller the size of the current block, the smaller the multiple preset offset step sizes are selected as multiple candidate offset step sizes.

[0155] For example, if the size (width × height) of the current block does not exceed a first size threshold (e.g., but not limited to, 256), a smaller predetermined number of preset offset steps (e.g., but not limited to, {1 / 4, 1 / 2, 1, 2}) are selected from multiple preset offset steps as multiple candidate offset steps; if the size of the current block exceeds the first size threshold, all of the multiple preset offset steps (e.g., {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}) are determined as multiple candidate offset steps, that is, consistent with the original MMVD design.

[0156] In step 703, a target extended motion vector can be selected from the extended motion vector set as the predicted motion vector for the current block. The decoder receives the encoding information about the current block sent by the encoder and parses the encoding information to obtain three flags related to the MMVD mode sent by the encoder: the encoding candidate list index (mmvd_cand_flag), the offset step index (mmvd_distance_idx), and the offset direction index (mmvd_direction_idx). Additionally, if the target extended motion vector selected by the encoder is a bidirectional motion vector, the decoder can also parse the offset strategy index (mmvd_mv_offset_idx). Based on the parsed three or four flags, the decoder can select the target extended motion vector from the extended motion vector set.

[0157] According to an exemplary embodiment of this disclosure, a first flag information (e.g., an offset strategy index (mmvd_mv_offset_idx)) can be received. The first flag information indicates which of a plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is. Based on the first flag information, the target extended motion vector can be selected from the plurality of extended motion vectors. Here, when the target extended motion vector selected by the encoder is a bidirectional motion vector, the decoder receives the first flag information and, based on the first flag information, can determine which offset strategy the target extended motion vector has selected. This allows the decoder to combine other information (encoding candidate list index, offset step size index, and direction index) to determine the target extended motion vector.

[0158] According to an exemplary embodiment of this disclosure, second flag information (e.g., offset direction index (mmvd_direction_idx)) can be received, wherein the second flag information indicates which of a plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, and the target extended motion vector can be selected from the plurality of extended motion vectors based on the second flag information. Here, when the target extended motion vector selected by the encoder is a unidirectional motion vector, the second flag information received by the decoder can indicate one of four candidate offset directions (positive x-axis direction, positive y-axis direction, negative x-axis direction, negative y-axis direction); when the target extended motion vector selected by the encoder is a bidirectional motion vector, the second flag information received by the decoder can indicate one of two candidate offset directions (x-axis direction, y-axis direction). The decoder can determine the offset direction corresponding to the target extended motion vector selected by the encoder based on the second flag information, and determine the target extended motion vector by combining other information (encoding candidate list index, offset step size index, and offset strategy index).

[0159] According to an exemplary embodiment of this disclosure, third flag information (e.g., offset step index (mmvd_distance_idx)) can be received. The third flag information indicates the offset step corresponding to the target extended motion vector, and the target extended motion vector can be selected from multiple extended motion vectors based on the third flag information. Here, when the size of the current block does not exceed a first size threshold, the third flag information received by the decoder indicates one of multiple preset offset steps (i.e., the 8 offset steps specified by MMVD); when the size of the current block does not exceed the first size threshold, the third flag information received by the decoder indicates one of a smaller predetermined number of preset offset steps selected from the multiple preset offset steps (e.g., the first 4 smaller offset steps specified by MMVD). The decoder can determine the offset step corresponding to the target extended motion vector selected by the encoder based on the size of the current block and the third flag information, and determine the target extended motion vector by combining other information (encoding candidate list index, offset strategy index, and offset strategy index).

[0160] In step 704, the reconstructed pixel values ​​of the current block are obtained based on the predicted motion vectors and coding information of the current block. The execution of this step can be referenced in the preceding introduction to block-based video coding and decoding systems.

[0161] Figure 8 This is a block diagram illustrating a video encoding apparatus according to an exemplary embodiment of the present disclosure.

[0162] Reference Figure 8 The video encoding apparatus 800 according to an exemplary embodiment of the present disclosure may include an acquisition unit 801, an offset unit 802, a selection unit 803, and an encoding unit 804.

[0163] The acquisition unit 801 can acquire a candidate list of motion information for the current block, wherein the candidate list of motion information includes multiple candidate motion vectors.

[0164] The offset unit 802 can perform offset processing on each candidate motion vector in the motion information candidate list to obtain an extended set of motion vectors.

[0165] According to an exemplary embodiment of the present disclosure, when the candidate motion vectors in the motion information candidate list include bidirectional motion vectors, the offset unit 802 obtains multiple candidate offset strategies for the bidirectional motion vectors. The multiple candidate offset strategies include multiple offset strategies for offsetting the forward motion vector and the backward motion vector in the bidirectional motion vector in the same direction, offsetting in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors.

[0166] According to exemplary embodiments of this disclosure, the following scenarios can be considered: forward and backward motion vectors offset in the same direction, offset in opposite directions, and zero offset. Eight offset strategies are designed for the forward and backward motion vectors: both forward and backward motion vectors offset in the positive direction; both forward and backward motion vectors offset in the negative direction; the forward motion vector offset in the positive direction and the backward motion vector offset in the negative direction; the forward motion vector offset in the negative direction and the backward motion vector offset in the positive direction; the forward motion vector offset in the positive direction and the backward motion vector offsets to zero; the forward motion vector offset in the negative direction and the backward motion vector offsets to zero; the forward motion vector offsets to zero and the backward motion vector offsets to the positive direction; and the forward motion vector offsets to zero and the backward motion vector offsets to the negative direction. These eight candidate offset strategies can be applied to either the x-axis or y-axis direction. Of course, this disclosure is not limited to these eight candidate offset strategies; other candidate offset strategies can be designed based on various complex motion situations.

[0167] According to an exemplary embodiment of this disclosure, the video encoding apparatus 800 may further include a scaling unit (not shown). The scaling unit (not shown) determines the motion vector magnitude (including the horizontal component magnitude and the vertical component magnitude) of a first motion vector. Here, the first motion vector may include a forward motion vector and / or a backward motion vector in a bidirectional motion vector. Subsequently, the scaling unit (not shown) scales a plurality of candidate offset steps for offsetting the first motion vector based on the motion vector magnitude of the first motion vector, wherein the scaled candidate offset steps are used to perform offsetting on the first motion vector. That is, an extended motion vector of the first motion vector is obtained by performing offsetting on the first motion vector using the scaled candidate offset steps, and placed into an extended motion vector set. Here, the larger the motion vector magnitude of the first motion vector, the larger the scaled candidate offset steps are.

[0168] For example, if both the horizontal and vertical components of the first motion vector divide a first component threshold (e.g., but not limited to, 32), the scaling unit (not shown) multiplies multiple candidate offset step sizes by a first scaling factor greater than 1 (e.g., but not limited to, 4). If neither the horizontal nor vertical components of the first motion vector divide the first component threshold but both divide a second component threshold (e.g., but not limited to, 16), the scaling unit (not shown) multiplies multiple candidate offset step sizes by a second scaling factor greater than 1 (e.g., but not limited to, 2). If neither the horizontal nor vertical components of the first motion vector divide the first nor the second component threshold, the scaling unit (not shown) multiplies multiple candidate offset step sizes by a third scaling factor equal to 1 (i.e., no scaling is performed), wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0169] According to an exemplary embodiment of this disclosure, the video encoding apparatus 800 may further include a range selection unit (not shown). The range selection unit (not shown) can determine the size of the current block; and based on the size of the current block, select a plurality of candidate offset steps from a plurality of preset offset steps (e.g., 8 preset offset steps {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}); wherein, the smaller the size of the current block, the smaller the plurality of preset offset steps are selected from the plurality of preset offset steps as the plurality of candidate offset steps.

[0170] For example, if the size (width × height) of the current block does not exceed a first size threshold (e.g., but not limited to, 256), the range selection unit (not shown) selects a smaller predetermined number of preset offset steps (e.g., but not limited to, {1 / 4, 1 / 2, 1, 2}) from a plurality of preset offset steps as a plurality of candidate offset steps; if the size of the current block exceeds the first size threshold, the range selection unit (not shown) determines all of the plurality of preset offset steps (e.g., {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}) as a plurality of candidate offset steps, that is, consistent with the original MMVD design.

[0171] Selection unit 803 can select a target extended motion vector from the extended motion vector set as the predicted motion vector for the current block. Selection unit 803 can use a rate-distortion optimization algorithm to select the optimal extended motion vector from the extended motion vector set as the target extended motion vector. That is, selection unit 803 can calculate the rate-distortion cost of each extended motion vector in the extended motion vector set and select the extended motion vector with the minimum rate-distortion cost as the target extended motion vector.

[0172] The coding unit 804 can obtain the coding information of the current block based on the predicted motion vector of the current block. The execution of this step can be referred to the previous introduction to block-based video coding and decoding systems.

[0173] According to an exemplary embodiment of this disclosure, the video encoding apparatus 800 may further include a transmitting unit (not shown). When the target extended motion vector is a bidirectional motion vector, the transmitting unit (not shown) may transmit first flag information, which indicates which of a plurality of candidate offset strategies (e.g., the above-mentioned 8 candidate offset strategies) the offset strategy corresponding to the target extended motion vector is.

[0174] According to an exemplary embodiment of this disclosure, the transmitting unit (not shown) can transmit second flag information. When the target extended motion vector is a bidirectional motion vector, the second flag information indicates which of a plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, wherein the plurality of candidate offset directions includes the x-axis direction and the y-axis direction; when the target extended motion vector is a unidirectional motion vector, the second flag information indicates which of a plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, wherein the plurality of candidate offset directions includes the positive x-axis direction, the negative x-axis direction, the positive y-axis direction, and the negative y-axis direction.

[0175] According to an exemplary embodiment of this disclosure, the transmitting unit (not shown) may transmit third flag information. When the size of the current block does not exceed the first size threshold, the third flag information indicates which of a predetermined number of preset offset steps (e.g., the first 4 preset offset steps) the offset step corresponding to the target expansion motion vector is; when the size of the current block exceeds the first size threshold, the third flag information indicates which of all the multiple preset offset steps (e.g., 8 preset offset steps) the offset step corresponding to the target expansion motion vector is.

[0176] Figure 9 This is a block diagram illustrating a video decoding apparatus according to an exemplary embodiment of the present disclosure.

[0177] Reference Figure 9 The video decoding apparatus 900 according to an exemplary embodiment of the present disclosure may include an acquisition unit 901, an offset unit 902, a selection unit 903, and a decoding unit 904.

[0178] The acquisition unit 901 can acquire the encoding information and motion information candidate list of the current block, wherein the motion information candidate list includes multiple candidate motion vectors. On the decoding side, the motion information candidate list is constructed in the same way as the motion information candidate list constructed on the encoding side.

[0179] The offset unit 902 can perform offset processing on each candidate motion vector in the motion information candidate list to obtain an extended motion vector set. On the decoding side, the extended motion vector set is constructed in the same way as the extended motion vector set constructed on the encoding side.

[0180] According to an exemplary embodiment of the present disclosure, when the candidate motion vectors in the motion information candidate list include bidirectional motion vectors, the offset unit 902 obtains multiple candidate offset strategies for the bidirectional motion vectors. The multiple candidate offset strategies include multiple offset strategies for offsetting the forward motion vector and the backward motion vector in the bidirectional motion vector in the same direction, offsetting in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors.

[0181] According to exemplary embodiments of this disclosure, the following scenarios can be considered: forward and backward motion vectors offset in the same direction, offset in opposite directions, and zero offset. Eight offset strategies are designed for the forward and backward motion vectors: both forward and backward motion vectors offset in the positive direction; both forward and backward motion vectors offset in the negative direction; the forward motion vector offset in the positive direction and the backward motion vector offset in the negative direction; the forward motion vector offset in the negative direction and the backward motion vector offset in the positive direction; the forward motion vector offset in the positive direction and the backward motion vector offsets to zero; the forward motion vector offset in the negative direction and the backward motion vector offsets to zero; the forward motion vector offsets to zero and the backward motion vector offsets to the positive direction; and the forward motion vector offsets to zero and the backward motion vector offsets to the negative direction. These eight candidate offset strategies can be applied to either the x-axis or y-axis direction. Of course, this disclosure is not limited to these eight candidate offset strategies; other candidate offset strategies can be designed based on various complex motion situations.

[0182] According to an exemplary embodiment of this disclosure, the video decoding apparatus 900 may further include a scaling unit (not shown). The scaling unit (not shown) determines the motion vector magnitude (including the horizontal component magnitude and the vertical component magnitude) of a first motion vector. Here, the first motion vector may include a forward motion vector and / or a backward motion vector in a bidirectional motion vector. Subsequently, the scaling unit (not shown) scales a plurality of candidate offset steps for offsetting the first motion vector based on the motion vector magnitude of the first motion vector, wherein the scaled candidate offset steps are used to perform offsetting on the first motion vector. That is, an extended motion vector of the first motion vector is obtained by performing offsetting on the first motion vector using the scaled candidate offset steps, and placed into an extended motion vector set. Here, the larger the motion vector magnitude of the first motion vector, the larger the scaled candidate offset steps are.

[0183] For example, if both the horizontal and vertical components of the first motion vector divide a first component threshold (e.g., but not limited to, 32), the scaling unit (not shown) multiplies multiple candidate offset step sizes by a first scaling factor greater than 1 (e.g., but not limited to, 4). If neither the horizontal nor vertical components of the first motion vector divide the first component threshold but both divide a second component threshold (e.g., but not limited to, 16), the scaling unit (not shown) multiplies multiple candidate offset step sizes by a second scaling factor greater than 1 (e.g., but not limited to, 2). If neither the horizontal nor vertical components of the first motion vector divide the first nor the second component threshold, the scaling unit (not shown) multiplies multiple candidate offset step sizes by a third scaling factor equal to 1 (i.e., no scaling is performed), wherein the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

[0184] According to an exemplary embodiment of this disclosure, the video decoding apparatus 900 may further include a range selection unit (not shown). The range selection unit (not shown) can determine the size of the current block; based on the size of the current block, select a plurality of candidate offset steps from a plurality of preset offset steps (e.g., 8 preset offset steps {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}); wherein, the smaller the size of the current block, the smaller the plurality of preset offset steps are selected from the plurality of preset offset steps as the plurality of candidate offset steps.

[0185] For example, if the size (width × height) of the current block does not exceed a first size threshold (e.g., but not limited to, 256), the range selection unit (not shown) selects a smaller predetermined number of preset offset steps (e.g., but not limited to, {1 / 4, 1 / 2, 1, 2}) from a plurality of preset offset steps as a plurality of candidate offset steps; if the size of the current block exceeds the first size threshold, the range selection unit (not shown) determines all of the plurality of preset offset steps (e.g., {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}) as a plurality of candidate offset steps, that is, consistent with the original MMVD design.

[0186] Selection unit 903 can select a target extended motion vector from the extended motion vector set as the predicted motion vector for the current block. The decoder receives encoding information about the current block sent by the encoder and parses it to obtain three flags related to the MMVD mode sent by the encoder: the encoding candidate list index (mmvd_cand_flag), the offset step index (mmvd_distance_idx), and the offset direction index (mmvd_direction_idx). Additionally, if the target extended motion vector selected by the encoder is a bidirectional motion vector, the decoder can also parse the offset strategy index (mmvd_mv_offset_idx). Based on the parsed three or four flags, selection unit 903 can select a target extended motion vector from the extended motion vector set.

[0187] According to an exemplary embodiment of this disclosure, the video decoding apparatus 900 may further include a receiving unit (not shown). The receiving unit (not shown) may receive first flag information (e.g., an offset strategy index (mmvd_mv_offset_idx)), the first flag information indicating which of a plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is; and the selection unit 903 may select the target extended motion vector from the plurality of extended motion vectors based on the first flag information. Here, when the target extended motion vector selected by the encoding end is a bidirectional motion vector, the receiving unit (not shown) at the decoding end receives the first flag information, and the selection unit 903, based on the first flag information, can determine which offset strategy the target extended motion vector has selected, thereby determining the target extended motion vector by combining other information (encoding candidate list index, offset step index, and direction index).

[0188] According to an exemplary embodiment of this disclosure, the receiving unit (not shown) may receive second flag information (e.g., offset direction index (mmvd_direction_idx)), wherein the second flag information indicates which of a plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, and the selection unit 903 may select the target extended motion vector from the plurality of extended motion vectors based on the second flag information. Here, when the target extended motion vector selected by the encoding end is a unidirectional motion vector, the second flag information received by the receiving unit (not shown) at the decoding end may indicate one of four candidate offset directions (positive x-axis direction, positive y-axis direction, negative x-axis direction, negative y-axis direction); when the target extended motion vector selected by the encoding end is a bidirectional motion vector, the second flag information received by the receiving unit (not shown) at the decoding end may indicate one of two candidate offset directions (x-axis direction, y-axis direction). The selection unit 903 at the decoding end may determine the offset direction corresponding to the target extended motion vector selected by the encoding end based on the second flag information, and determine the target extended motion vector by combining other information (encoding candidate list index, offset step size index, and offset strategy index).

[0189] According to an exemplary embodiment of this disclosure, a receiving unit (not shown) may receive third flag information (e.g., offset step index (mmvd_distance_idx)), the third flag information indicating the offset step corresponding to the target extended motion vector, and a selection unit 903 may select the target extended motion vector from multiple extended motion vectors based on the third flag information. Here, when the size of the current block does not exceed a first size threshold, the third flag information received by the receiving unit (not shown) at the decoding end indicates one of multiple preset offset steps (i.e., the 8 offset steps specified by MMVD); when the size of the current block does not exceed the first size threshold, the third flag information received by the receiving unit (not shown) at the decoding end indicates one of a smaller predetermined number of preset offset steps selected from multiple preset offset steps (e.g., the first 4 smaller offset steps specified by MMVD). The selection unit 903 at the decoding end may determine the offset step corresponding to the target extended motion vector selected by the encoding end based on the size of the current block and the third flag information, and determine the target extended motion vector by combining other information (encoding candidate list index, offset strategy index, and offset strategy index).

[0190] The decoding unit 904 can obtain the reconstructed pixel value of the current block based on the predicted motion vector and coding information of the current block.

[0191] Figure 10 This is a block diagram of an electronic device 1000 according to an exemplary embodiment of the present disclosure.

[0192] Reference Figure 10The electronic device 1000 includes at least one memory 1001 and at least one processor 1002. The at least one memory 1001 stores a set of computer-executable instructions. When the set of computer-executable instructions is executed by the at least one processor 1002, a video encoding method or a video decoding method according to an exemplary embodiment of the present disclosure is performed.

[0193] As an example, electronic device 1000 may be a PC, tablet, personal digital assistant, smartphone, or other device capable of executing the aforementioned set of instructions. Here, electronic device 1000 is not necessarily a single electronic device; it may be any collection of devices or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. Electronic device 1000 may also be part of an integrated control system or system manager, or may be configured to interconnect with a portable electronic device locally or remotely (e.g., via wireless transmission) through an interface.

[0194] In electronic device 1000, processor 1002 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, etc.

[0195] The processor 1002 can execute instructions or code stored in the memory 1001, which can also store data. Instructions and data can also be sent and received via a network through a network interface device, which can employ any known transmission protocol.

[0196] The memory 1001 may be integrated with the processor 1002, for example, by arranging RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 1001 may include a separate device, such as an external disk drive, a storage array, or other storage device usable by any database system. The memory 1001 and the processor 1002 may be operatively coupled, or may communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 1002 to read files stored in the memory.

[0197] In addition, the electronic device 1000 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device 1000 can be interconnected via a bus and / or network.

[0198] According to exemplary embodiments of the present disclosure, a computer-readable storage medium may also be provided, wherein when instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor causes the processor to perform a video encoding method or a video decoding method according to the present disclosure. Examples of computer-readable storage media herein include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the aforementioned computer-readable storage medium can run in an environment deployed in computer devices such as clients, hosts, agent devices, servers, etc. Furthermore, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner through one or more processors or computers.

[0199] According to exemplary embodiments of the present disclosure, a computer program product may also be provided, including computer instructions that can be executed by at least one processor to perform a video encoding method or a video decoding method according to exemplary embodiments of the present disclosure.

[0200] According to the video encoding or decoding method disclosed herein, considering the various motion scenarios that may exist in the video, more motion vector offset adjustment schemes are introduced (e.g., for symmetrical motion scenarios, asymmetrical motion scenarios, no relative motion scenarios, etc.), so as to more effectively represent the various motion scenarios included in the video, thereby improving the encoding performance of MMVD and achieving the effect of improving the video encoding and decoding quality.

[0201] Furthermore, according to the video encoding or decoding method disclosed herein, the precision of the offset step is adjusted based on the precision of the candidate motion vector, so that the precision of the offset step is more closely matched with the precision of the candidate motion vector, thereby improving the encoding performance of MMVD and achieving the effect of improving video encoding and decoding quality.

[0202] Furthermore, according to the video encoding or decoding method disclosed herein, different offset step ranges are selected from the original offset step range based on blocks of different sizes, thereby reducing the bit rate and improving encoding efficiency.

[0203] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0204] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A video encoding method, characterized in that, The video encoding method includes: Obtain a candidate list of motion information for the current block, wherein the candidate list of motion information includes multiple candidate motion vectors; For each candidate motion vector in the motion information candidate list, offset processing is performed to obtain an expanded set of motion vectors; Select a target extended motion vector from the set of extended motion vectors and use it as the predicted motion vector for the current block; Based on the predicted motion vector of the current block, the encoding information of the current block is obtained; Specifically, the step of performing offset processing on each candidate motion vector in the motion information candidate list to obtain an expanded motion vector set includes: When the plurality of candidate motion vectors includes bidirectional motion vectors, a plurality of candidate offset strategies for the bidirectional motion vectors are obtained, wherein the plurality of candidate offset strategies include offset strategies for the forward motion vector and the backward motion vector in the bidirectional motion vectors in the same direction, offset in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors. The video encoding method further includes: determining the motion vector magnitude of a first motion vector; and scaling a plurality of candidate offset step sizes used for offsetting the first motion vector based on the motion vector magnitude, wherein the first motion vector includes the forward motion vector and / or the backward motion vector in the bidirectional motion vectors, and the scaled candidate offset step sizes are used to perform offsetting on the first motion vector. The scaling process for the plurality of candidate offset step sizes used to offset the first motion vector, based on the magnitude of the first motion vector, includes: In the first case where both the horizontal and vertical components of the first motion vector are divisible by the first component threshold, the plurality of candidate offset step sizes are multiplied by a first scaling factor greater than 1. In the second case where the horizontal and vertical components of the first motion vector cannot divide the first component threshold but can both divide the second component threshold, the plurality of candidate offset step sizes are multiplied by a second scaling factor greater than 1. Wherein, the accuracy of the first motion vector satisfying the first condition is lower than the accuracy of the first motion vector satisfying the second condition, the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

2. The video encoding method as described in claim 1, characterized in that, The video encoding method further includes: When the target extended motion vector is a bidirectional motion vector, a first flag information and a second flag information are sent. The first flag information indicates which of the plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is, and the second flag information indicates which of the plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, including the x-axis direction and the y-axis direction.

3. The video encoding method as described in claim 1, characterized in that, The video encoding method further includes: Determine the size of the current block; Based on the size of the current block, select the plurality of candidate offset steps from a plurality of preset offset step sizes; Wherein, the smaller the size of the current block, the smaller the preset offset step size is selected from multiple preset offset step sizes as the multiple candidate offset step sizes.

4. The video encoding method as described in claim 3, characterized in that, The step of selecting the plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block includes: If the size of the current block does not exceed the first size threshold, a smaller predetermined number of preset offset steps are selected from the plurality of preset offset step sizes as the plurality of candidate offset step sizes; If the size of the current block exceeds the first size threshold, the plurality of preset offset step sizes are determined as the plurality of candidate offset step sizes; The video encoding method further includes: Send a third flag message, wherein, if the size of the current block does not exceed the first size threshold, the third flag message indicates which of the predetermined number of preset offset steps the offset step corresponding to the target extended motion vector is.

5. The video encoding method as described in claim 1, characterized in that, The multiple candidate offset strategies include: both the forward and backward motion vectors are offset in the positive direction; both the forward and backward motion vectors are offset in the negative direction; the forward motion vector is offset in the positive direction and the backward motion vector is offset in the negative direction; the forward motion vector is offset in the negative direction and the backward motion vector is offset in the positive direction; the forward motion vector is offset in the positive direction and the backward motion vector has zero offset; the forward motion vector is offset in the negative direction and the backward motion vector has zero offset; the forward motion vector has zero offset and the backward motion vector is offset in the positive direction; and the forward motion vector has zero offset and the backward motion vector is offset in the negative direction.

6. A video decoding method, characterized in that, The video decoding method includes: Obtain the encoding information and motion information candidate list of the current block, wherein the motion information candidate list includes multiple candidate motion vectors; For each candidate motion vector in the motion information candidate list, offset processing is performed to obtain an expanded set of motion vectors; Select a target extended motion vector from the set of extended motion vectors and use it as the predicted motion vector for the current block; Based on the predicted motion vector and the encoded information of the current block, the reconstructed pixel value of the current block is obtained; Specifically, the offset processing performed on each candidate motion vector in the motion information candidate list to obtain multiple extended motion vectors includes: When the plurality of candidate motion vectors includes bidirectional motion vectors, a plurality of candidate offset strategies for the bidirectional motion vectors are obtained, wherein the plurality of candidate offset strategies include offset strategies for the forward motion vector and the backward motion vector in the bidirectional motion vectors in the same direction, offset in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors. The video decoding method further includes: determining the motion vector magnitude of a first motion vector; and scaling a plurality of candidate offset step sizes used for offsetting the first motion vector based on the motion vector magnitude, wherein the first motion vector includes the forward motion vector and / or the backward motion vector in the bidirectional motion vectors, and the scaled candidate offset step sizes are used to perform offsetting on the first motion vector. The scaling process for the plurality of candidate offset step sizes used to offset the first motion vector, based on the magnitude of the first motion vector, includes: In the first case where both the horizontal and vertical components of the first motion vector are divisible by the first component threshold, the plurality of candidate offset step sizes are multiplied by a first scaling factor greater than 1. In the second case where the horizontal and vertical components of the first motion vector cannot divide the first component threshold but can both divide the second component threshold, the plurality of candidate offset step sizes are multiplied by a second scaling factor greater than 1. Wherein, the accuracy of the first motion vector satisfying the first condition is lower than the accuracy of the first motion vector satisfying the second condition, the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

7. The video decoding method as described in claim 6, characterized in that, The video decoding method further includes: When the target extended motion vector is a bidirectional motion vector, first flag information and second flag information are received, wherein the first flag information indicates which of the plurality of candidate offset strategies the offset strategy corresponding to the target extended motion vector is, and the second flag information indicates which of the plurality of candidate offset directions the offset direction corresponding to the target extended motion vector is, wherein the plurality of candidate offset directions includes the x-axis direction and the y-axis direction; The step of selecting a target extended motion vector from the set of extended motion vectors includes: Based on the first and second flag information, the target extended motion vector is selected from the plurality of extended motion vectors.

8. The video decoding method as described in claim 6, characterized in that, The video decoding method further includes: Determine the size of the current block; Based on the size of the current block, select the plurality of candidate offset steps from a plurality of preset offset step sizes; Wherein, the smaller the size of the current block, the smaller the preset offset step size is selected from multiple preset offset step sizes as the multiple candidate offset step sizes.

9. The video decoding method as described in claim 8, characterized in that, The step of selecting the plurality of candidate offset steps from a plurality of preset offset steps based on the size of the current block includes: If the size of the current block does not exceed the first size threshold, a smaller predetermined number of preset offset steps are selected from the plurality of preset offset step sizes as the plurality of candidate offset step sizes; If the size of the current block exceeds the first size threshold, the plurality of preset offset step sizes are determined as the plurality of candidate offset step sizes; The video decoding method further includes: Receive third flag information, wherein, if the size of the current block does not exceed the first size threshold, the third flag information indicates which of the predetermined number of preset offset steps the offset step corresponding to the target extended motion vector is; The step of selecting a target extended motion vector from the set of extended motion vectors includes: Based on the third flag information, the target extended motion vector is selected from the plurality of extended motion vectors.

10. A video encoding device, characterized in that, The video encoding device includes: The acquisition unit is configured to acquire a candidate list of motion information for the current block, wherein the candidate list of motion information includes multiple candidate motion vectors; An offset unit is configured to perform offset processing on each candidate motion vector in the motion information candidate list to obtain multiple extended motion vectors; The selection unit is configured to select a target extended motion vector from the plurality of extended motion vectors as the predicted motion vector of the current block; The encoding unit is configured to obtain the encoding information of the current block based on the predicted motion vector of the current block; The offset unit is configured as follows: When the plurality of candidate motion vectors includes bidirectional motion vectors, a plurality of candidate offset strategies for the bidirectional motion vectors are obtained, wherein the plurality of candidate offset strategies include offset strategies for the forward motion vector and the backward motion vector in the bidirectional motion vectors in the same direction, offset in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors. The video encoding apparatus further includes a scaling unit configured to: determine the motion vector magnitude of a first motion vector; and, based on the motion vector magnitude of the first motion vector, scale a plurality of candidate offset step sizes used for offsetting the first motion vector, wherein the first motion vector includes the forward motion vector and / or the backward motion vector in the bidirectional motion vectors, and the scaled candidate offset step sizes are used to perform offsetting on the first motion vector. The scaling unit is configured to: in a first case where both the horizontal and vertical components of the first motion vector are divisible by a first component threshold, multiply the plurality of candidate offset step sizes by a first scaling factor greater than 1; and in a second case where the horizontal and vertical components of the first motion vector are not divisible by the first component threshold but are divisible by a second component threshold, multiply the plurality of candidate offset step sizes by a second scaling factor greater than 1. Wherein, the accuracy of the first motion vector satisfying the first condition is lower than the accuracy of the first motion vector satisfying the second condition, the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

11. A video decoding device, characterized in that, The video decoding device includes: The acquisition unit is configured to acquire the encoding information and motion information candidate list of the current block, wherein the motion information candidate list includes multiple candidate motion vectors; An offset unit is configured to perform offset processing on each candidate motion vector in the motion information candidate list to obtain multiple extended motion vectors; The selection unit is configured to select a target extended motion vector from the plurality of extended motion vectors as the predicted motion vector of the current block; The decoding unit is configured to obtain the reconstructed pixel values ​​of the current block based on the predicted motion vector and the encoded information of the current block; The offset unit is configured as follows: When the plurality of candidate motion vectors includes bidirectional motion vectors, a plurality of candidate offset strategies for the bidirectional motion vectors are obtained, wherein the plurality of candidate offset strategies include offset strategies for the forward motion vector and the backward motion vector in the bidirectional motion vectors in the same direction, offset in opposite directions, and zero offset. Based on the multiple candidate offset strategies, offset processing is performed on the forward motion vector and the backward motion vector according to multiple candidate offset step sizes and multiple candidate offset directions to obtain multiple extended motion vectors. The video decoding device further includes a scaling unit configured to: determine the motion vector magnitude of a first motion vector; and, based on the motion vector magnitude of the first motion vector, scale a plurality of candidate offset step sizes used for offsetting the first motion vector, wherein the first motion vector includes the forward motion vector and / or the backward motion vector in the bidirectional motion vectors, and the scaled candidate offset step sizes are used to perform offsetting on the first motion vector. The scaling unit is configured to: in a first case where both the horizontal and vertical components of the first motion vector are divisible by a first component threshold, multiply the plurality of candidate offset step sizes by a first scaling factor greater than 1; and in a second case where the horizontal and vertical components of the first motion vector are not divisible by the first component threshold but are divisible by a second component threshold, multiply the plurality of candidate offset step sizes by a second scaling factor greater than 1. Wherein, the accuracy of the first motion vector satisfying the first condition is lower than the accuracy of the first motion vector satisfying the second condition, the first component threshold is greater than the second component threshold, and the first scaling factor is greater than the second scaling factor.

12. An electronic device, characterized in that, include: At least one processor; At least one memory that stores computer-executable instructions. The computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform the video encoding method as described in any one of claims 1 to 5 or the video decoding method as described in any one of claims 6 to 9.

13. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor causes the at least one processor to perform the video encoding method as claimed in any one of claims 1 to 5 or the video decoding method as claimed in any one of claims 6 to 9.

14. A method for transmitting a bit stream, characterized in that, include: Perform the generation of a bitstream according to the video encoding method as described in any one of claims 1 to 5; Send the bit stream.

15. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by at least one processor, they implement the video encoding method as claimed in any one of claims 1 to 5 or the video decoding method as claimed in any one of claims 6 to 9.