Video encoding method and device, video decoding method and device, and electronic device
By generating multiple backward motion vector difference candidates in the symmetric motion vector difference mode, the problem of low coding efficiency in SMVD is solved, and the accuracy and efficiency of video coding are improved.
Patent Information
- Application Number
- CN202310008312.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-04
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-01-04
AI Technical Summary
Existing Symmetric Motion Vector Difference (SMVD) coding techniques have limitations in coding efficiency, especially when the motion of objects in the video is random, resulting in low coding efficiency.
In the symmetric motion vector difference mode, forward and backward reference image frames are determined from the reference image frame list of the current image frame, and multiple backward motion vector difference candidates are generated by processing the forward motion vector difference. The optimal backward motion vector difference is selected and written into the bitstream, which relaxes the restrictions on the selection of reference image frames and improves coding accuracy.
By generating multiple backward motion vector difference candidates, coding efficiency is improved, helping the current block find a more matching prediction block during the decoding process, thereby improving the accuracy and efficiency of coding.
Smart Images

Figure CN116016945B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of video processing, and in particular to a video encoding method and apparatus, a video decoding method and apparatus, and an electronic device. Background Technology
[0002] In video coding, predictive coding includes intra-frame prediction and inter-frame prediction. Compared to intra-frame prediction, inter-frame prediction can achieve a higher compression ratio and better coding performance. Symmetric Motion Vector Difference (SMVD) is an inter-frame prediction technique. Typically, the motion of objects in a video has temporal continuity. SMVD utilizes this characteristic, employing a symmetrical approach to derive the backward motion vector difference of a coding block through forward motion vector difference. Therefore, the coding block only needs to encode the forward motion vector difference, saving the bit overhead of encoding the backward motion vector difference and thus improving coding efficiency.
[0003] However, due to the many limitations of SMVD in terms of application scenarios, its coding efficiency is also limited. For example, SMVD stipulates that backward motion vectors must be scaled in the opposite direction to forward motion vectors, resulting in low coding efficiency. Summary of the Invention
[0004] This disclosure provides a video encoding method and apparatus, a video decoding method and apparatus, and an electronic device to at least solve the problem of low encoding efficiency in related technologies.
[0005] According to a first aspect of the present disclosure, a video coding method is provided, comprising: in a symmetric motion vector difference mode, determining a forward reference image frame and a backward reference image frame of a current block in the current image frame from a list of reference image frames corresponding to the current image frame; determining a plurality of backward motion vector difference candidates based on the forward motion vector difference corresponding to the forward reference image frame; selecting the backward motion vector difference corresponding to the backward reference image frame from the plurality of backward motion vector difference candidates; and writing the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0006] Optionally, based on the forward motion vector difference corresponding to the forward reference image frame, multiple backward motion vector difference candidates are determined, including: performing pre-processing on the horizontal and vertical components of the forward motion vector difference to determine multiple backward motion vector difference candidates.
[0007] Optionally, the horizontal and vertical components of the forward motion vector difference are pre-processed to determine multiple candidates for backward motion vector difference, including: inverting the horizontal and vertical components of the forward motion vector difference to obtain inverted horizontal and vertical components; and determining multiple candidates for backward motion vector difference based on the horizontal and vertical components of the forward motion vector difference, the inverted horizontal components, and the inverted vertical components.
[0008] Optionally, based on the horizontal and vertical components, the inverted horizontal component, and the inverted vertical component of the forward motion vector difference, multiple backward motion vector difference candidates are determined, including: obtaining a first backward motion vector difference candidate based on the horizontal and vertical components of the forward motion vector difference; obtaining a second backward motion vector difference candidate based on the horizontal and inverted vertical components of the forward motion vector difference; obtaining a third backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference; and obtaining a fourth backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference.
[0009] Optionally, selecting the backward motion vector difference corresponding to the backward reference image frame from multiple backward motion vector difference candidates includes: obtaining a prediction block corresponding to each backward motion vector difference candidate based on the initial prediction block of the current block in the backward reference image frame and each backward motion vector difference candidate, wherein the initial prediction block is obtained based on the motion vector selected from a pre-established list of candidate predicted motion vectors; obtaining the rate-distortion cost of the prediction block corresponding to each backward motion vector difference candidate and the current block respectively; and using the backward motion vector difference candidate corresponding to the minimum rate-distortion cost as the backward motion vector difference corresponding to the backward reference image frame.
[0010] Optionally, each of the multiple backward motion vector difference candidates has its own index. The process of writing relevant information about the forward motion vector difference and the backward motion vector difference into the bitstream includes writing the indices of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0011] Optionally, determining the forward reference image frame and backward reference image frame of the current block in the current image frame from the reference image frame list corresponding to the current image frame includes: obtaining the rate-distortion cost of the prediction block and the current block in each reference image frame in the reference image frame list; based on the rate-distortion cost, obtaining the forward reference image frame and backward reference image frame of the current block from the reference image frame list; wherein, writing the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream includes: writing the index of the forward reference image frame and the backward reference image frame in the reference image frame list, and the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0012] Optionally, based on the rate-distortion cost, the forward reference image frame and the backward reference image frame of the current block are obtained from the list of reference image frames, including: traversing each reference image frame in the list of reference image frames, selecting the first predetermined reference image frame with the smallest rate-distortion cost as the forward reference image frame of the current block, and selecting the second predetermined reference image frame with the smallest rate-distortion cost as the backward reference image frame of the current block, wherein the playback order of the first predetermined reference image frame is before the current image frame, and the playback order of the second predetermined reference image frame is after the current image frame.
[0013] Optionally, the forward motion vector difference corresponding to the forward reference image frame is obtained as follows: the horizontal offset between the initial prediction block and the prediction block in the forward reference image frame is obtained as the horizontal component of the forward motion vector difference, wherein the initial prediction block is obtained based on the motion vector selected from a pre-established list of candidate prediction motion vectors, and the prediction block is obtained by motion search based on the initial prediction block; the vertical offset between the initial prediction block and the prediction block in the forward reference image frame is obtained as the vertical component of the forward motion vector difference.
[0014] According to a second aspect of the present disclosure, a video decoding method is provided, comprising: obtaining relevant information on the forward motion vector difference and the backward motion vector difference of a current block in a current image frame from a received bitstream; obtaining the backward motion vector difference based on the relevant information on the forward motion vector difference and the backward motion vector difference; and performing motion compensation on the current block based on the forward motion vector difference and the backward motion vector difference.
[0015] Optionally, the backward motion vector difference is obtained based on the relevant information of the forward motion vector difference and the backward motion vector difference, including: obtaining the backward motion vector difference based on the horizontal component and vertical component of the forward motion vector difference and the relevant information of the backward motion vector difference.
[0016] Optionally, the backward motion vector difference is obtained based on the relevant information of the horizontal and vertical components of the forward motion vector difference and the backward motion vector difference, including: when the relevant information indicates that the backward motion vector difference is composed of the horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained based on the horizontal and vertical components of the forward motion vector difference; when the relevant information indicates that the backward motion vector difference is composed of the horizontal component and the inverted vertical component of the forward motion vector difference, the vertical component of the forward motion vector difference is inverted to obtain the inverted vertical component, and the backward motion vector difference is obtained based on the horizontal component and the inverted vertical component of the forward motion vector difference; in the case of relevant information... When the indicated backward motion vector difference consists of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal components of the forward motion vector difference are inverted to obtain the inverted horizontal components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained.
[0017] Optionally, when the relevant information of the backward motion vector difference is used as an index, the backward motion vector difference is obtained based on the horizontal and vertical components of the forward motion vector difference and the relevant information of the backward motion vector difference, including: determining the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference based on the index of the backward motion vector difference; and obtaining the backward motion vector difference based on the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference, as well as the horizontal and vertical components of the forward motion vector difference.
[0018] Optionally, from the received bitstream, the forward reference image frame and the backward reference image frame of the current block are obtained, and their indices in the reference image frame list corresponding to the current image frame are obtained. The indices of the forward reference image frame and the backward reference image frame of the current block are obtained based on the rate-distortion cost between the predicted block and the current block in each reference image frame in the reference image frame list. Based on the indices of the forward reference image frame and the backward reference image frame, the forward reference image frame and the backward reference image frame of the current block are obtained. Motion compensation is performed on the current block based on the forward motion vector difference and the backward motion vector difference, including: performing motion compensation on the current block based on the forward reference image frame, the backward reference image frame, the forward motion vector difference, and the backward motion vector difference.
[0019] According to a third aspect of the present disclosure, a video encoding apparatus is provided, comprising: a reference image frame acquisition unit configured to, in a symmetric motion vector difference mode, determine a forward reference image frame and a backward reference image frame of a current block in the current image frame from a list of reference image frames corresponding to the current image frame; a backward motion vector difference candidate acquisition unit configured to determine a plurality of backward motion vector difference candidates based on the forward motion vector difference corresponding to the forward reference image frame; a backward motion vector difference acquisition unit configured to select the backward motion vector difference corresponding to the backward reference image frame from the plurality of backward motion vector difference candidates; and an encoding unit configured to write relevant information of the forward motion vector difference and the backward motion vector difference into a bitstream.
[0020] Optionally, the backward motion vector difference candidate acquisition unit is further configured to perform predetermined processing on the horizontal and vertical components of the forward motion vector difference to determine multiple backward motion vector difference candidates.
[0021] Optionally, the backward motion vector difference candidate acquisition unit is further configured to invert the horizontal and vertical components of the forward motion vector difference to obtain the inverted horizontal and vertical components; and to determine multiple backward motion vector difference candidates based on the horizontal and vertical components of the forward motion vector difference, the inverted horizontal components, and the inverted vertical components.
[0022] Optionally, the backward motion vector difference candidate acquisition unit is further configured to obtain a first backward motion vector difference candidate based on the horizontal and vertical components of the forward motion vector difference; obtain a second backward motion vector difference candidate based on the horizontal and inverted vertical components of the forward motion vector difference; obtain a third backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference; and obtain a fourth backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference.
[0023] Optionally, the backward motion vector difference acquisition unit is further configured to obtain a prediction block corresponding to each backward motion vector difference candidate based on the initial prediction block of the current block in the backward reference image frame and each backward motion vector difference candidate, wherein the initial prediction block is obtained based on the motion vector selected from a pre-established list of candidate predicted motion vectors; obtain the rate-distortion cost of the prediction block corresponding to each backward motion vector difference candidate and the current block respectively; and use the backward motion vector difference candidate corresponding to the minimum rate-distortion cost as the backward motion vector difference corresponding to the backward reference image frame.
[0024] Optionally, multiple backward motion vector difference candidates have their own indices, wherein the coding unit is also configured to write the indices of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0025] Optionally, the reference image frame acquisition unit is further configured to acquire the rate-distortion cost of the predicted block and the current block in each reference image frame in the reference image frame list; based on the rate-distortion cost, acquire the forward reference image frame and the backward reference image frame of the current block from the reference image frame list; wherein, writing the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream includes: writing the indices of the forward reference image frame and the backward reference image frame in the reference image frame list, and the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0026] Optionally, the reference image frame acquisition unit is further configured to traverse each reference image frame in the reference image frame list, select the first predetermined reference image frame with the smallest rate-to-distortion cost as the forward reference image frame of the current block, and select the second predetermined reference image frame with the smallest rate-to-distortion cost as the backward reference image frame of the current block, wherein the playback order of the first predetermined reference image frame is before the current image frame, and the playback order of the second predetermined reference image frame is after the current image frame.
[0027] Optionally, the forward motion vector difference corresponding to the forward reference image frame is obtained as follows: the horizontal offset between the initial prediction block and the prediction block in the forward reference image frame is obtained as the horizontal component of the forward motion vector difference, wherein the initial prediction block is obtained based on the motion vector selected from a pre-established list of candidate prediction motion vectors, and the prediction block is obtained by motion search based on the initial prediction block; the vertical offset between the initial prediction block and the prediction block in the forward reference image frame is obtained as the vertical component of the forward motion vector difference.
[0028] According to a fourth aspect of the present disclosure, a video decoding apparatus is provided, comprising: an information acquisition unit configured to acquire information related to the forward motion vector difference and the backward motion vector difference of a current block in a current image frame from a received bitstream; a backward motion vector difference acquisition unit configured to obtain a backward motion vector difference based on the information related to the forward motion vector difference and the backward motion vector difference; and a compensation unit configured to perform motion compensation on the current block based on the forward motion vector difference and the backward motion vector difference.
[0029] Optionally, the backward motion vector difference acquisition unit is also configured to obtain the backward motion vector difference based on the horizontal component, vertical component and related information of the forward motion vector difference and the backward motion vector difference.
[0030] Optionally, the backward motion vector difference acquisition unit is further configured to: when relevant information indicates that the backward motion vector difference consists of the horizontal and vertical components of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal and vertical components of the forward motion vector difference; when relevant information indicates that the backward motion vector difference consists of the horizontal component and the inverted vertical component of the forward motion vector difference, invert the vertical component of the forward motion vector difference to obtain the inverted vertical component, and obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference; when relevant information indicates that the backward motion vector difference consists of the horizontal component and the inverted vertical component of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference; and when relevant information indicates that the backward motion vector difference consists of the horizontal component and the inverted vertical component of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference. When the forward motion vector difference consists of the inverted horizontal and vertical components, the horizontal components of the forward motion vector difference are inverted to obtain the inverted horizontal components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained. When relevant information indicates that the backward motion vector difference consists of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal and vertical components of the forward motion vector difference are inverted to obtain the inverted horizontal and vertical components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained.
[0031] Optionally, when the relevant information of the backward motion vector difference is an index, the backward motion vector difference acquisition unit is further configured to determine the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference based on the index of the backward motion vector difference; and to obtain the backward motion vector difference based on the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference, as well as the horizontal and vertical components of the forward motion vector difference.
[0032] Optionally, the information acquisition unit is further configured to acquire, from the received bitstream, the indices of the forward reference image frame and the backward reference image frame of the current block in the reference image frame list corresponding to the current image frame, wherein the indices of the forward reference image frame and the backward reference image frame of the current block are obtained based on the rate-distortion cost between the prediction block and the current block in each reference image frame in the reference image frame list; and to acquire the forward reference image frame and the backward reference image frame of the current block based on the indices of the forward reference image frame and the backward reference image frame; wherein the compensation unit is further configured to perform motion compensation on the current block based on the forward reference image frame, the backward reference image frame, the forward motion vector difference, and the backward motion vector difference.
[0033] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a video encoding method and / or a video decoding method according to the present disclosure.
[0034] According to a sixth 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 at least one processor to perform the video encoding method and / or video decoding method as described above according to the present disclosure.
[0035] According to a seventh aspect of the present disclosure, a computer program product is provided, including computer instructions that, when executed by a processor, implement a video encoding method and / or a video decoding method according to the present disclosure.
[0036] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:
[0037] According to the video coding method and apparatus, video decoding method and apparatus, and electronic device disclosed herein, multiple backward motion vector candidates are provided. The backward motion vector corresponding to the backward reference image frame is determined from these multiple candidates. This allows the determined backward motion vector difference to help the current block find a more matching prediction block from the backward reference image frame during the decoding process, thereby improving coding efficiency. Therefore, this disclosure solves the problem of low coding efficiency in related technologies.
[0038] 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
[0039] 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.
[0040] Figure 1 This is a schematic diagram illustrating an implementation scenario of a video encoding method and a video decoding method according to exemplary embodiments of the present disclosure;
[0041] Figure 2 This is a flowchart illustrating a video encoding method according to an exemplary embodiment;
[0042] Figure 3 This is a schematic diagram illustrating the positions of the current block and the predicted block according to an exemplary embodiment;
[0043] Figure 4 This is a flowchart illustrating a video decoding method according to an exemplary embodiment;
[0044] Figure 5 This is a schematic diagram of a motion vector according to an exemplary embodiment;
[0045] Figure 6This is a block diagram illustrating a video encoding apparatus according to an exemplary embodiment;
[0046] Figure 7 This is a block diagram illustrating a video decoding apparatus according to an exemplary embodiment;
[0047] Figure 8 This is a block diagram of an electronic device 800 according to an embodiment of the present disclosure. Detailed Implementation
[0048] 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.
[0049] 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.
[0050] 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.
[0051] This disclosure provides a video encoding method and a video decoding method that can improve the efficiency of video encoding and decoding. The following explanation uses a video transmission scenario as an example.
[0052] Figure 1 This is a schematic diagram illustrating an implementation scenario of a video encoding method and a video decoding method according to exemplary embodiments of the present disclosure, such as... Figure 1The implementation scenario includes server 100, user terminal 110, and user terminal 120. The number of user terminals is not limited to two, and includes, but is not limited to, devices such as mobile phones and personal computers. The user terminals can be equipped with cameras to acquire video. The server can be a single server, a server cluster composed of several servers, or a cloud computing platform or virtualization center.
[0053] User terminal 110 acquires a video through a camera and needs to send the video to user terminal 120. During transmission, the video is encoded and decoded. Specifically, each image frame of the video undergoes the following encoding operation: In symmetric motion vector difference mode, the forward reference image frame and the backward reference image frame of the current block in the current image frame are determined from the reference image frame list corresponding to the current image frame; based on the forward motion vector difference corresponding to the forward reference image frame, multiple backward motion vector difference candidates are determined; the backward motion vector difference corresponding to the backward reference image frame is selected from the multiple backward motion vector difference candidates; the relevant information of the forward motion vector difference and the backward motion vector difference is written into the bitstream and sent to user terminal 120. After receiving the bitstream, user terminal 120 obtains the relevant information of the forward motion vector difference and the backward motion vector difference of the current block in the current image frame from the received bitstream; based on the relevant information of the forward motion vector difference and the backward motion vector difference, the backward motion vector difference is obtained; based on the forward motion vector difference and the backward motion vector difference, motion compensation is performed on the current block to obtain the pixels of the current block.
[0054] It should be noted that user terminals 110 and 120 can perform this task independently, or they can receive data services from server 100; this disclosure does not limit this. When receiving data services from server 100, user terminal 110 acquires a video through a camera and needs to send the video to user terminal 120. First, user terminal 110 uploads the video to server 100. During transmission, the encoder on server 100 encodes the video, the decoder decodes the encoded video, and then sends the decoded video to user terminal 120. Specifically, the encoder of server 100 performs the following encoding operations on each image frame of the video: In symmetric motion vector difference mode, it determines the forward reference image frame and the backward reference image frame of the current block in the current image frame from the list of reference image frames corresponding to the current image frame; based on the forward motion vector difference corresponding to the forward reference image frame, it determines multiple backward motion vector difference candidates; it selects the backward motion vector difference corresponding to the backward reference image frame from the multiple backward motion vector difference candidates; it writes the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream and sends it to the decoder on server 100. After receiving the bitstream, the decoder obtains the relevant information of the forward motion vector difference and the backward motion vector difference of the current block in the current image frame from the received bitstream; based on the relevant information of the forward motion vector difference and the backward motion vector difference, it obtains the backward motion vector difference; based on the forward motion vector difference and the backward motion vector difference, it performs motion compensation on the current block to obtain the pixel of the current block. After obtaining all the pixels of the video, server 100 sends the pixel to user terminal 120.
[0055] The video encoding method and apparatus, and the video decoding method and apparatus according to exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings.
[0056] Figure 2 This is a flowchart illustrating a video encoding method according to an exemplary embodiment, such as... Figure 2 As shown, the video encoding method includes the following steps:
[0057] In step S201, under the symmetric motion vector difference mode, the forward reference image frame and the backward reference image frame of the current block in the current image frame are determined from the reference image frame list corresponding to the current image frame.
[0058] Specifically, if the Symmetric Motion Vector Difference (SMVD) mode is used, the forward and backward reference image frames of the current block must meet the following conditions: the current block must be bidirectionally predicted; the selected forward reference image frame must be the reference image frame whose Picture Order Count (POC) is less than that of the current image frame and whose POC is closest to the current image frame; and the selected backward reference image frame must be the reference image frame whose POC is greater than that of the current image frame and whose POC is closest to the current image frame.
[0059] For example, when determining the forward and backward reference frames for the current block from the list of reference frames for the current image frame, this can be done according to the SMVD selection rules. Specifically, the point of view (POC) of the forward and backward reference frames is closest to the POC of the current image frame, and the POC of the forward reference frame is less than that of the current image frame, while the POC of the backward reference frame is greater than that of the current image frame. Assume the current image frame has a POC of 4, the list of reference frames includes two forward reference frames with POCs {1, 3}, and two backward reference frames with POCs {5, 7}. According to the SMVD selection rules, the current image frame selects the reference frames with POCs of 3 and 5 as the forward and backward reference frames, respectively.
[0060] It should be noted that the SMVD mode uses the aforementioned fixed selection rule to select the forward and backward reference frames for the current block from the reference frame list. This eliminates the bitrate overhead of encoding reference frame information at the encoder, allowing the decoder to autonomously obtain the forward and backward reference frames for the current block based on this rule. However, in practical applications, it has been found that in many cases, especially when the video sequence contains complex motion content, this fixed selection rule cannot find the optimal forward and backward reference frames for the current block. Due to the randomness of motion, a reference frame with a larger POC distance may actually be a better reference frame for the current block. Therefore, this disclosure relaxes the restrictions on the selection of forward and backward reference frames for each coding block. That is, for the SMVD mode, the fixed selection rule is no longer used. Instead, a rate-distortion cost is used to traverse all reference frames in the reference frame list, selecting the optimal forward and backward reference frames and their corresponding indices for the corresponding coding block. The indices of the selected reference frames are also written into the bitstream.
[0061] According to an exemplary embodiment of this disclosure, determining the forward reference image frame and the backward reference image frame of the current block in the current image frame from the reference image frame list corresponding to the current image frame may include: obtaining the rate-distortion cost of the predicted block and the current block in each reference image frame in the reference image frame list; and obtaining the forward reference image frame and the backward reference image frame of the current block from the reference image frame list based on the rate-distortion cost. According to this embodiment, by determining the forward reference image frame and the backward reference image frame corresponding to the current block through the rate-distortion cost of the predicted block and the current block in each reference image frame, the selection restriction of the two reference image frames is relaxed.
[0062] It should be noted that the predicted block in each reference image frame is the coded block with the smallest pixel difference from the current block in that reference image frame. This disclosure does not limit the method for obtaining the coded block with the smallest pixel difference from the current block in each reference image frame. For example, it can be obtained through Advanced Motion Vector Prediction (AMVP). AMVP utilizes the correlation between spatial and temporal motion vectors to establish a list of candidate predicted motion vectors (MVs) for the current block. The encoder selects the optimal MV from this list as the predicted value of the motion vector (MVP) and performs differential encoding on the MVP. In other words, the true MV is obtained through motion search, and the motion vector difference is encoded. The coded block corresponding to the true MV obtained through this motion search is the predicted block. Furthermore, the rate-distortion cost between the predicted block and the current block in each reference image frame represents the distortion of each predicted block relative to the current block. A smaller rate-distortion cost indicates less distortion of the predicted block relative to the current block. It should be noted that other metrics besides rate-distortion cost can also be used here, as long as they can indicate the distortion situation.
[0063] According to an exemplary embodiment of this disclosure, obtaining the forward reference image frame and the backward reference image frame of the current block from the reference image frame list based on rate-distortion cost may include: traversing each reference image frame in the reference image frame list, selecting a first predetermined reference image frame with the lowest rate-distortion cost as the forward reference image frame of the current block, and selecting a second predetermined reference image frame with the lowest rate-distortion cost as the backward reference image frame of the current block, wherein the first predetermined reference image frame is played before the current image frame, and the second predetermined reference image frame is played after the current image frame. According to this embodiment, by traversing the reference image frame list to obtain the forward reference image frame and the backward reference image frame with the lowest rate-distortion cost, the accuracy of the forward reference image frame and the backward reference image frame can be improved, thus improving the accuracy of the encoding.
[0064] For example, still assuming the current image frame POC = 4, the first predetermined reference image frame in the reference image frame list includes two frames with POCs {1, 3}, and the second predetermined reference image frame also includes two frames with POCs {5, 7}. Traversing all reference image frames in the reference image frame list, the rate-distortion cost of the predicted block in each reference image frame and the current block is obtained. It is found that the first predetermined reference image frame with the smallest rate-distortion cost is the reference image frame with POC = 1, and the second predetermined reference image frame with the smallest rate-distortion cost is the reference image frame with POC = 7. At this point, the reference image frames with POC = 1 and POC = 7 are used as the forward and backward reference image frames for the current block, respectively.
[0065] return Figure 2 In step S202, multiple candidates for backward motion vector difference are determined based on the forward motion vector difference corresponding to the forward reference image frame.
[0066] It should be noted that the SMVD specification in related technologies obtains the backward MVD by inverting the forward motion vector difference (MVD). This approach assumes that the motion in the video follows a continuous, fixed direction in time. However, by relaxing the restrictions on the selection of forward and backward reference frames for each coded block, the POC of the selected reference frame may not be the closest to the POC of the current frame. This could lead to the motion of the current block, the predicted block in the forward reference frame, and the predicted block in the backward reference frame not being continuous, such as... Figure 3 As shown, the current block is located directly below the current image frame. However, the forward and backward reference image frames selected using the method of this disclosure are both far from the current image frame. In this case, the optimal predicted block found through motion estimation in the forward reference image frame is located in the upper right corner of that frame, while the optimal predicted block found through motion estimation in the backward reference image frame is located in the upper left corner. Clearly, the motion of these three blocks is not sequentially continuous. Therefore, the backward MVD operation specified in the related SMVD mode, which obtains the backward MVD by inverting the forward MVD, cannot handle this situation well. Based on this, this disclosure optimizes the derivation of the backward MVD by determining multiple backward motion vector difference candidates based on the forward motion vector difference corresponding to the forward reference image frame, instead of simply obtaining it by inverting the forward motion vector difference.
[0067] According to an exemplary embodiment of this disclosure, determining multiple backward motion vector difference candidates based on the forward motion vector difference corresponding to a forward reference image frame includes: performing predetermined processing on the horizontal and vertical components of the forward motion vector difference to determine multiple backward motion vector difference candidates. According to this embodiment, obtaining multiple backward motion vector difference candidates means that it is no longer limited to obtaining a single backward motion vector difference candidate from only the inverted horizontal and vertical components.
[0068] For example, the horizontal and vertical components of the forward motion vector difference can be inverted to obtain inverted horizontal and vertical components. Multiple candidate backward motion vector differences can then be obtained using the horizontal and vertical components of the forward motion vector difference, the inverted horizontal components, and the inverted vertical components. Of course, the predetermined processing in this embodiment is not limited to inversion; other processing can also be applied to the horizontal and vertical components. For instance, the horizontal and vertical components of the forward motion vector difference can be finely adjusted to ensure that the adjusted horizontal and vertical components still belong to the same radius of a circle as the original horizontal and vertical components.
[0069] According to an exemplary embodiment of this disclosure, performing predetermined processing on the horizontal and vertical components of the forward motion vector difference to determine multiple backward motion vector difference candidates may include: inverting the horizontal and vertical components of the forward motion vector difference to obtain inverted horizontal and vertical components; and determining multiple backward motion vector difference candidates based on the horizontal and vertical components of the forward motion vector difference, the inverted horizontal component, and the inverted vertical component. According to this embodiment, multiple backward motion vector difference candidates can be obtained using the horizontal and vertical components of the forward motion vector difference, the inverted horizontal component, and the inverted vertical component.
[0070] According to an exemplary embodiment of this disclosure, determining multiple backward motion vector difference candidates based on the horizontal and vertical components, the inverted horizontal component, and the inverted vertical component of the forward motion vector difference may include: obtaining a first backward motion vector difference candidate based on the horizontal and vertical components of the forward motion vector difference; obtaining a second backward motion vector difference candidate based on the horizontal and inverted vertical components of the forward motion vector difference; obtaining a third backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference; and obtaining a fourth backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference. According to this embodiment, four backward motion vector difference candidates can be conveniently and quickly obtained based on the horizontal and vertical components, the inverted horizontal component, and the inverted vertical component of the forward motion vector difference.
[0071] Specifically, assuming the forward MVD = {mvdx0, mvdy0}, this embodiment can invert and combine the horizontal and vertical components of the forward MVD to obtain four backward MVD candidates, namely (MVD1_0, MVD1_1, MVD1_2, MVD1_3), where MVD1_0 = {mvdx0, mvdy0}, MVD1_1 = {mvdx0, -mvdy0}, MVD1_2 = {-mvdx0, mvdy0}, and MVD1_3 = {-mvdx0, -mvdy0}. It can be seen that MVD1_3 is the result of inverting the forward MVD. However, this embodiment is not limited to this result, but rather selects the optimal candidate from the above four candidates as the backward motion vector difference.
[0072] According to an exemplary embodiment of this disclosure, the forward motion vector difference corresponding to the forward reference image frame is obtained as follows: the horizontal offset between the initial prediction block and the prediction block in the forward reference image frame is obtained as the horizontal component of the forward motion vector difference, wherein the initial prediction block is obtained based on a motion vector selected from a pre-established list of candidate predicted motion vectors, and the prediction block is obtained by motion search based on the initial prediction block; the vertical offset between the initial prediction block and the prediction block in the forward reference image frame is obtained as the vertical component of the forward motion vector difference. According to this embodiment, the forward motion vector difference can be obtained quickly.
[0073] For example, it can be obtained through Advanced Motion Vector Prediction (AMVP). This method utilizes the correlation between motion vectors in the spatial and temporal domains to create a list of candidate predicted motion vectors (MVs) for the current block. The encoder selects the optimal MV from this list as the predicted value of the motion vector (MVP) and performs differential encoding on the MVP. In other words, the true MV is obtained through motion search, and the difference between the motion vectors is encoded. The encoded block corresponding to the true MV obtained through this motion search is the prediction block, and the encoded block corresponding to the MVP is the initial prediction block.
[0074] return Figure 2 In step S203, the backward motion vector difference corresponding to the backward reference image frame is selected from multiple backward motion vector difference candidates. This step can obtain the prediction block corresponding to each backward motion vector difference candidate in the backward reference image frame for the current block, and select the backward motion vector difference corresponding to the backward reference image frame based on the distortion of the prediction block and the current block.
[0075] According to an exemplary embodiment of this disclosure, selecting the backward motion vector difference corresponding to a backward reference image frame from multiple backward motion vector difference candidates may include: obtaining a prediction block corresponding to each backward motion vector difference candidate based on an initial prediction block of the current block in the backward reference image frame and each backward motion vector difference candidate, wherein the initial prediction block is obtained based on a motion vector selected from a pre-established list of candidate predicted motion vectors; obtaining the rate-distortion cost of the prediction block corresponding to each backward motion vector difference candidate with respect to the current block; and selecting the backward motion vector difference candidate with the minimum rate-distortion cost as the backward motion vector difference corresponding to the backward reference image frame. According to this embodiment, by obtaining the prediction blocks corresponding to the motion vector difference candidates and calculating the rate-distortion costs of the four prediction blocks with respect to the current block, the optimal backward motion vector difference candidate is determined as the backward motion vector difference corresponding to the backward reference image frame, thereby improving the accuracy of encoding.
[0076] It should be noted that the initial prediction block mentioned above can be obtained through the Advanced Motion Vector Prediction (AMVP) method, which will not be discussed in detail here.
[0077] In step S204, the relevant information of the forward motion vector difference and the backward motion vector difference is written into the bit stream.
[0078] According to an exemplary embodiment of this disclosure, multiple backward motion vector difference candidates each have their own index. Writing relevant information about the forward and backward motion vector differences into the bitstream may include writing the indices of the forward and backward motion vector differences into the bitstream. In this embodiment, each backward motion vector difference corresponds to its own index. During encoding, only the index of the backward motion vector difference can be encoded, eliminating the need to encode the backward motion vector differences themselves, thus reducing bitrate consumption and further improving encoding efficiency.
[0079] For example, still assuming the forward MVD = {mvdx0, mvdy0}, the horizontal and vertical components of the forward MVD are inverted and combined to obtain four backward MVD candidates: (MVD1_0, MVD1_1, MVD1_2, MVD1_3). Here, MVD1_0 = {mvdx0, mvdy0}, MVD1_1 = {mvdx0, -mvdy0}, MVD1_2 = {-mvdx0, mvdy0}, and MVD1_3 = {-mvdx0, -mvdy0}. In this embodiment, the index of the backward MVD candidate can range from 0 to 3, corresponding to MVD1_0 to MVD1_3 respectively. Based on the corresponding index, it can be determined which backward MVD candidate has been selected.
[0080] According to an exemplary embodiment of the present disclosure, when the forward reference image frame and the backward reference image frame of the current block are determined based on the rate-distortion cost of the prediction block of each reference image frame in the reference image frame list and the current block, writing the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream may include: writing the indices of the forward reference image frame and the backward reference image frame in the reference image frame list, and the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0081] Figure 4 This is a flowchart illustrating a video decoding method according to an exemplary embodiment, such as... Figure 4 As shown, the video decoding method includes the following steps:
[0082] In step S401, relevant information about the forward motion vector difference and backward motion vector difference of the current block in the current image frame is obtained from the received bitstream.
[0083] In step S402, the backward motion vector difference is obtained based on the relevant information of the forward motion vector difference and the backward motion vector difference.
[0084] According to an exemplary embodiment of this disclosure, the backward motion vector difference is obtained based on the relevant information of the forward motion vector difference and the backward motion vector difference, including: obtaining the backward motion vector difference based on the horizontal component, vertical component, and relevant information of the backward motion vector difference. According to this embodiment, multiple backward motion vector difference candidates can be obtained through the horizontal component, vertical component, inverted horizontal component, and inverted vertical component of the forward motion vector difference, so that it is no longer limited to obtaining a single backward motion vector difference candidate from only the inverted horizontal component and the inverted vertical component.
[0085] According to an exemplary embodiment of this disclosure, obtaining a backward motion vector difference based on the relevant information of the horizontal and vertical components of the forward motion vector difference and the backward motion vector difference includes: when the relevant information indicates that the backward motion vector difference is composed of the horizontal and vertical components of the forward motion vector difference, obtaining the backward motion vector difference based on the horizontal and vertical components of the forward motion vector difference; when the relevant information indicates that the backward motion vector difference is composed of the horizontal component and the inverted vertical component of the forward motion vector difference, inverting the vertical component of the forward motion vector difference to obtain the inverted vertical component, and obtaining the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference. When relevant information indicates that the backward motion vector difference consists of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal components of the forward motion vector difference are inverted to obtain the inverted horizontal components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained. Similarly, when relevant information indicates that the backward motion vector difference consists of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal and vertical components of the forward motion vector difference are inverted to obtain the inverted horizontal and vertical components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained. According to this embodiment, the relationship between the horizontal, vertical, inverted horizontal, and inverted vertical components of the backward motion vector difference and the forward motion vector difference can be known through relevant information, thereby conveniently and quickly obtaining four candidate backward motion vector differences.
[0086] Specifically, assuming the forward MVD = {mvdx0, mvdy0}, the four backward MVD candidates are (MVD1_0, MVD1_1, MVD1_2, MVD1_3), where MVD1_0 = {mvdx0, mvdy0}, MVD1_1 = {mvdx0, -mvdy0}, MVD1_2 = {-mvdx0, mvdy0}, and MVD1_3 = {-mvdx0, -mvdy0}. The encoder can select the optimal candidate from these four candidates as the backward motion vector difference and write its corresponding index into the bitstream. The decoder can determine the composition of the backward motion vector difference based on the index in the bitstream, and thus obtain the backward motion vector difference.
[0087] According to an exemplary embodiment of this disclosure, when the relevant information of the backward motion vector difference is an index, the backward motion vector difference is obtained based on the horizontal and vertical components of the forward motion vector difference and the relevant information of the backward motion vector difference. This includes: determining the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference based on the index of the backward motion vector difference; and obtaining the backward motion vector difference based on the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference, as well as the horizontal and vertical components of the forward motion vector difference. According to this embodiment, each backward motion vector difference corresponds to its own index. During encoding, only the index of the backward motion vector difference needs to be encoded, without needing to encode the backward motion vector difference itself, thus reducing code rate consumption and further improving encoding efficiency.
[0088] For example, in this embodiment, the index of the backward MVD candidate can be in the range of 0 to 3, corresponding to MVD1_0 to MVD1_3 respectively. Based on the corresponding index, it can be known which backward MVD candidate has been selected.
[0089] In step S403, motion compensation is performed on the current block based on the forward motion vector difference and the backward motion vector difference.
[0090] For example, assuming forward MVD = {mvdx0, mvdy0} and backward MVD = {mvdx1, mvdy1} = {-mvdx0, -mvdy0}, after obtaining the forward motion vector difference and backward motion vector difference, the motion vector of the current block can be obtained through the forward MVD, backward MVD, the forward motion vector MVP of the initial prediction block from the current block to the forward reference image frame, and the backward motion vector MVP of the initial prediction block from the current block to the backward reference image frame. Specifically, as... Figure 5 As shown, the forward motion vector (MV) of the predicted block from the current block to the forward reference image frame is obtained first through the forward MVD and the forward motion vector MVP of the initial predicted block from the current block to the forward reference image frame. Then, the backward motion vector MV of the predicted block from the current block to the backward reference image frame is obtained through the backward MVD and the backward motion vector MVP of the initial predicted block from the current block to the backward reference image frame. Where, forward MVP = {mvpx0, mvpy0}, backward MVP = {mvpx1, mvpy1} = {-mvdx0, -mvdy0}, forward MV = {mvx0, mvy0}, and backward MV = {mvx1, mvy1}. If the index of the backward MVD carried in the bitstream is 3, it means that the backward MVD = {-mvdx0, -mvdy0}. At this time, the forward MV and backward MV are derived as follows:
[0091]
[0092] Once the forward MV and backward MV of the current block are obtained, motion compensation for the current block can be completed.
[0093] According to an exemplary embodiment of this disclosure, where the indices of the forward and backward reference image frames of the current block are obtained based on the rate-distortion cost between the predicted block and the current block in each reference image frame in the reference image frame list, the above decoding method can further obtain the indices of the forward and backward reference image frames of the current block in the reference image frame list corresponding to the current image frame from the received bitstream; obtain the forward and backward reference image frames of the current block based on the indices of the forward and backward reference image frames; and perform motion compensation on the current block based on the forward reference image frames, the backward reference image frames, the forward motion vector difference, and the backward motion vector difference. According to this embodiment, the forward and backward reference image frames corresponding to the current block are determined by the rate-distortion cost between the predicted block and the current block in each reference image frame, thereby relaxing the selection restrictions on the two reference image frames.
[0094] In summary, this disclosure provides an optimization method for the Symmetric Motion Vector Difference (SMVD) algorithm. First, the rules for deriving the reference frame index in SMVD are modified. After optimization, each current block needs to write the optimal forward and backward reference frame indices into the bitstream separately. Second, the deriving method for backward MVD is optimized, providing more candidates for backward MVD, thus allowing each current block to find a more matching reference block in the backward reference frame. This disclosure can effectively improve the coding performance of SMVD. Verification shows that the method of this disclosure can improve the encoder's coding performance by approximately 0.3%.
[0095] Figure 6 This is a block diagram illustrating a video encoding apparatus according to an exemplary embodiment. (Refer to...) Figure 6 The device includes a reference image frame acquisition unit 60, a backward motion vector difference candidate acquisition unit 62, a backward motion vector difference acquisition unit 64, and an encoding unit 66.
[0096] The reference image frame acquisition unit 60 is configured to, in symmetric motion vector difference mode, determine the forward reference image frame and the backward reference image frame of the current block in the current image frame from the reference image frame list corresponding to the current image frame; the backward motion vector difference candidate acquisition unit 62 is configured to determine multiple backward motion vector difference candidates based on the forward motion vector difference corresponding to the forward reference image frame; the backward motion vector difference acquisition unit 64 is configured to select the backward motion vector difference corresponding to the backward reference image frame from the multiple backward motion vector difference candidates; and the encoding unit 66 is configured to write the relevant information of the forward motion vector difference and the backward motion vector difference into the bit stream.
[0097] According to an exemplary embodiment of the present disclosure, the backward motion vector difference candidate acquisition unit is further configured to perform predetermined processing on the horizontal and vertical components of the forward motion vector difference to determine a plurality of backward motion vector difference candidates.
[0098] According to an exemplary embodiment of the present disclosure, the backward motion vector difference candidate acquisition unit 62 is further configured to invert the horizontal and vertical components of the forward motion vector difference to obtain the inverted horizontal and vertical components; and to determine a plurality of backward motion vector difference candidates based on the horizontal and vertical components of the forward motion vector difference, the inverted horizontal and vertical components.
[0099] According to an exemplary embodiment of the present disclosure, the backward motion vector difference candidate acquisition unit 62 is further configured to obtain a first backward motion vector difference candidate based on the horizontal and vertical components of the forward motion vector difference; obtain a second backward motion vector difference candidate based on the horizontal and inverted vertical components of the forward motion vector difference; obtain a third backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference; and obtain a fourth backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference.
[0100] According to an exemplary embodiment of the present disclosure, a plurality of backward motion vector difference candidates correspond to their respective indices, wherein the encoding unit 66 is further configured to write the indices of the forward motion vector difference and the backward motion vector difference into the bit stream.
[0101] According to an exemplary embodiment of the present disclosure, the reference image frame acquisition unit 60 is further configured to acquire the rate-distortion cost of the prediction block and the current block in each reference image frame in the reference image frame list; based on the rate-distortion cost, acquire the forward reference image frame and the backward reference image frame of the current block from the reference image frame list; wherein, writing the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream includes: writing the index of the forward reference image frame and the backward reference image frame in the reference image frame list, and the relevant information of the forward motion vector difference and the backward motion vector difference into the bitstream.
[0102] According to an exemplary embodiment of the present disclosure, the reference image frame acquisition unit 60 is further configured to traverse each reference image frame in the reference image frame list, select a first predetermined reference image frame with the smallest rate-to-distortion cost as the forward reference image frame of the current block, and select a second predetermined reference image frame with the smallest rate-to-distortion cost as the backward reference image frame of the current block, wherein the playback order of the first predetermined reference image frame is before the current image frame, and the playback order of the second predetermined reference image frame is after the current image frame.
[0103] According to an exemplary embodiment of the present disclosure, the backward motion vector difference acquisition unit 64 is further configured to obtain a prediction block corresponding to each backward motion vector difference candidate based on the initial prediction block of the current block in the backward reference image frame and each backward motion vector difference candidate, wherein the initial prediction block is obtained based on a motion vector selected from a pre-established list of candidate predicted motion vectors; obtain the rate-distortion cost of the prediction block corresponding to each backward motion vector difference candidate and the current block respectively; and use the backward motion vector difference candidate corresponding to the minimum rate-distortion cost as the backward motion vector difference corresponding to the backward reference image frame.
[0104] According to an exemplary embodiment of this disclosure, the forward motion vector difference corresponding to the forward reference image frame is obtained as follows: the horizontal offset between the initial prediction block and the prediction block of the current block in the forward reference image frame is obtained as the horizontal component of the forward motion vector difference, wherein the initial prediction block is obtained based on the motion vector selected from a pre-established list of candidate prediction motion vectors, and the prediction block is obtained by motion search based on the initial prediction block; the vertical offset between the initial prediction block and the prediction block of the current block in the forward reference image frame is obtained as the vertical component of the forward motion vector difference.
[0105] Figure 7 This is a block diagram illustrating a video decoding apparatus according to an exemplary embodiment. (Refer to...) Figure 7 The device includes an information acquisition unit 70, a backward motion vector difference acquisition unit 72, and a compensation unit 74.
[0106] Information acquisition unit 70 is configured to acquire relevant information about the forward motion vector difference and backward motion vector difference of the current block in the current image frame from the received bit stream; backward motion vector difference acquisition unit 72 is configured to obtain the backward motion vector difference based on the relevant information about the forward motion vector difference and backward motion vector difference; compensation unit 74 is configured to perform motion compensation on the current block based on the forward motion vector difference and backward motion vector difference.
[0107] According to an exemplary embodiment of this disclosure, the backward motion vector difference acquisition unit 72 is further configured to obtain the backward motion vector difference based on the horizontal component, vertical component and related information of the forward motion vector difference and the backward motion vector difference.
[0108] According to an exemplary embodiment of this disclosure, the backward motion vector difference acquisition unit 72 is further configured to: when relevant information indicates that the backward motion vector difference consists of the horizontal and vertical components of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal and vertical components of the forward motion vector difference; when relevant information indicates that the backward motion vector difference consists of the horizontal component and the inverted vertical component of the forward motion vector difference, invert the vertical component of the forward motion vector difference to obtain the inverted vertical component, and obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference; and when relevant information indicates that the backward motion vector difference... When the forward motion vector difference consists of the inverted horizontal and vertical components, the horizontal components of the forward motion vector difference are inverted to obtain the inverted horizontal components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained. When relevant information indicates that the backward motion vector difference consists of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal and vertical components of the forward motion vector difference are inverted to obtain the inverted horizontal and vertical components. Based on the inverted horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained.
[0109] According to an exemplary embodiment of this disclosure, when the relevant information of the backward motion vector difference is an index, the backward motion vector difference acquisition unit is further configured to determine the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference based on the index of the backward motion vector difference; and to obtain the backward motion vector difference based on the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference, as well as the horizontal and vertical components of the forward motion vector difference.
[0110] According to an exemplary embodiment of this disclosure, the information acquisition unit 70 is further configured to acquire from the received bitstream the indices of the forward reference image frame and the backward reference image frame of the current block in the reference image frame list corresponding to the current image frame, wherein the indices of the forward reference image frame and the backward reference image frame of the current block are obtained based on the rate-distortion cost between the prediction block and the current block in each reference image frame in the reference image frame list; and to acquire the forward reference image frame and the backward reference image frame of the current block based on the indices of the forward reference image frame and the backward reference image frame; wherein the compensation unit 74 is further configured to perform motion compensation on the current block based on the forward reference image frame, the backward reference image frame, the forward motion vector difference, and the backward motion vector difference.
[0111] According to embodiments of this disclosure, an electronic device may be provided. Figure 8This is a block diagram of an electronic device 800 according to an embodiment of the present disclosure. The electronic device includes at least one memory 801 and at least one processor 802. The at least one memory stores a set of computer-executable instructions. When the set of computer-executable instructions is executed by the at least one processor, a video encoding method and / or a video decoding method according to an embodiment of the present disclosure are executed.
[0112] As an example, electronic device 800 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, but may be any collection of devices or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. Electronic device 800 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.
[0113] In electronic device 800, processor 802 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 802 may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, etc.
[0114] The processor 802 can execute instructions or code stored in memory, wherein memory 801 can also store data. Instructions and data can also be sent and received over a network via a network interface device, wherein the network interface device can employ any known transmission protocol.
[0115] The memory 801 may be integrated with the processor 802, for example, by placing RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 801 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 801 and the processor 802 may be operatively coupled, or may communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 802 to read files stored in the memory 801.
[0116] In addition, the electronic device 800 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 can be interconnected via a bus and / or network.
[0117] According to embodiments of this 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 to perform the video encoding method and / or video decoding method of embodiments of this 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.
[0118] According to embodiments of this disclosure, a computer program product is provided, including computer instructions, which, when executed by a processor, implement the video encoding method and / or video decoding method of embodiments of this disclosure.
[0119] 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.
[0120] 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, include: In the symmetric motion vector difference mode, the forward reference image frame and the backward reference image frame of the current block in the current image frame are determined from the reference image frame list corresponding to the current image frame; Based on the forward motion vector difference corresponding to the forward reference image frame, multiple backward motion vector difference candidates are determined; Select the backward motion vector difference corresponding to the backward reference image frame from the plurality of backward motion vector difference candidates; Write the relevant information of the backward motion vector difference and the forward motion vector difference into the bitstream; The step of determining multiple candidate backward motion vector differences based on the forward motion vector difference corresponding to the forward reference image frame includes: The horizontal and vertical components of the forward motion vector difference are inverted to obtain the inverted horizontal and vertical components. Based on the horizontal and vertical components of the forward motion vector difference, a first candidate backward motion vector difference is obtained; Based on the horizontal component and the inverted vertical component of the forward motion vector difference, a second candidate backward motion vector difference is obtained; Based on the inverted horizontal and vertical components of the forward motion vector difference, a third candidate backward motion vector difference is obtained; Based on the inverted horizontal and vertical components of the forward motion vector difference, a fourth candidate backward motion vector difference is obtained.
2. The video encoding method as described in claim 1, characterized in that, The step of selecting the backward motion vector difference corresponding to the backward reference image frame from the plurality of backward motion vector difference candidates includes: Based on the initial prediction block of the current block in the backward reference image frame and each backward motion vector difference candidate, a prediction block corresponding to each backward motion vector difference candidate is obtained, wherein the initial prediction block is obtained based on the motion vector selected from a pre-established list of candidate predicted motion vectors; Obtain the rate-distortion cost of the prediction block corresponding to each candidate backward motion vector difference and the current block; The candidate backward motion vector difference corresponding to the minimum rate distortion cost is used as the backward motion vector difference corresponding to the backward reference image frame.
3. The video encoding method as described in claim 1, characterized in that, Each of the multiple candidate backward motion vector differences has its own index. The process of writing the relevant information of the backward motion vector difference and the forward motion vector difference into the bitstream includes: The index of the backward motion vector difference and the forward motion vector difference are written into the bitstream.
4. A video decoding method, characterized in that, include: Obtain relevant information about the backward motion vector difference and the forward motion vector difference of the current block in the current image frame from the received bitstream; The backward motion vector difference is obtained based on the relevant information of the backward motion vector difference and the forward motion vector difference; Motion compensation is performed on the current block based on the forward motion vector difference and the backward motion vector difference; The step of obtaining the backward motion vector difference based on the relevant information of the backward motion vector difference and the forward motion vector difference includes: When the relevant information indicates that the backward motion vector difference is composed of the horizontal and vertical components of the forward motion vector difference, the backward motion vector difference is obtained based on the horizontal and vertical components of the forward motion vector difference; When the relevant information indicates that the backward motion vector difference is composed of the horizontal component and the inverted vertical component of the forward motion vector difference, the vertical component of the forward motion vector difference is inverted to obtain the inverted vertical component, and the backward motion vector difference is obtained based on the horizontal component and the inverted vertical component of the forward motion vector difference. When the relevant information indicates that the backward motion vector difference is composed of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal components of the forward motion vector difference are inverted to obtain the inverted horizontal components, and the backward motion vector difference is obtained based on the inverted horizontal and vertical components of the forward motion vector difference. When the relevant information indicates that the backward motion vector difference is composed of the inverted horizontal component and the inverted vertical component of the forward motion vector difference, the horizontal component and the vertical component of the forward motion vector difference are inverted respectively to obtain the inverted horizontal component and the inverted vertical component, and the backward motion vector difference is obtained based on the inverted horizontal component and the inverted vertical component of the forward motion vector difference.
5. The video decoding method as described in claim 4, characterized in that, When the relevant information of the backward motion vector difference is an index, obtaining the backward motion vector difference based on the horizontal and vertical components of the forward motion vector difference and the relevant information of the backward motion vector difference includes: Based on the index of the backward motion vector difference, determine the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference; The backward motion vector difference is obtained based on the relationship between the horizontal and vertical components of the backward motion vector difference and the forward motion vector difference, as well as the horizontal and vertical components of the forward motion vector difference.
6. A video encoding device, characterized in that, include: The reference image frame acquisition unit is configured to determine the forward reference image frame and the backward reference image frame of the current block in the current image frame from the reference image frame list corresponding to the current image frame in symmetric motion vector difference mode. The backward motion vector difference candidate acquisition unit is configured to determine multiple backward motion vector difference candidates based on the forward motion vector difference corresponding to the forward reference image frame; The backward motion vector difference acquisition unit is configured to select the backward motion vector difference corresponding to the backward reference image frame from the plurality of backward motion vector difference candidates; The encoding unit is configured to write the relevant information of the backward motion vector difference and the forward motion vector difference into the bit stream; The backward motion vector difference candidate acquisition unit is further configured to invert the horizontal and vertical components of the forward motion vector difference to obtain inverted horizontal and vertical components; obtain a first backward motion vector difference candidate based on the horizontal and vertical components of the forward motion vector difference; obtain a second backward motion vector difference candidate based on the horizontal and inverted vertical components of the forward motion vector difference; obtain a third backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference; and obtain a fourth backward motion vector difference candidate based on the inverted horizontal and vertical components of the forward motion vector difference.
7. A video decoding device, characterized in that, include: The information acquisition unit is configured to acquire relevant information about the backward motion vector difference and the forward motion vector difference of the current block in the current image frame from the received bit stream; The backward motion vector difference acquisition unit is configured to obtain the backward motion vector difference based on the relevant information of the backward motion vector difference and the forward motion vector difference; The compensation unit is configured to perform motion compensation on the current block based on the forward motion vector difference and the backward motion vector difference; The backward motion vector difference acquisition unit is further configured to: when the relevant information indicates that the backward motion vector difference is composed of the horizontal and vertical components of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal and vertical components of the forward motion vector difference; when the relevant information indicates that the backward motion vector difference is composed of the horizontal component and the inverted vertical component of the forward motion vector difference, invert the vertical component of the forward motion vector difference to obtain the inverted vertical component, and obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference; when the relevant information indicates that the backward motion vector difference is composed of the horizontal component and the inverted vertical component of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference; and when the relevant information indicates that the backward motion vector difference is composed of the horizontal component and the inverted vertical component of the forward motion vector difference, obtain the backward motion vector difference based on the horizontal component and the inverted vertical component of the forward motion vector difference. When the forward motion vector difference is composed of the inverted horizontal and vertical components, the horizontal components of the forward motion vector difference are inverted to obtain the inverted horizontal components, and the backward motion vector difference is obtained based on the inverted horizontal and vertical components of the forward motion vector difference; when the relevant information indicates that the backward motion vector difference is composed of the inverted horizontal and vertical components of the forward motion vector difference, the horizontal and vertical components of the forward motion vector difference are inverted to obtain the inverted horizontal and vertical components, and the backward motion vector difference is obtained based on the inverted horizontal and vertical components of the forward motion vector difference.
8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to perform the video encoding method as described in any one of claims 1 to 3 and / or the video decoding method as described in any one of claims 4 to 5.
9. 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 described in any one of claims 1 to 3 and / or the video decoding method as described in any one of claims 4 to 5.
Citation Information
Patent Citations
Inter-frame prediction method, terminal device and computer storage medium
CN110545425A