Coding method, decoding method, communication device, storage medium, and program product

By generating a list of motion candidates and transmitting index information during video encoding, the process of determining motion vectors is optimized, solving the problem of insufficient motion vector accuracy and achieving a reduction in data volume and an improvement in transmission efficiency.

WO2026129733A1PCT designated stage Publication Date: 2026-06-25ZTE CORP

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ZTE CORP
Filing Date
2025-09-03
Publication Date
2026-06-25

AI Technical Summary

Technical Problem

In existing video coding technologies, the accuracy of motion vector determination is insufficient, resulting in large video file sizes, slow transmission speeds, and high storage and transmission costs.

Method used

Instead of directly transmitting motion vector data, a motion candidate list is generated at the encoding end, and index information indicating motion vectors is transmitted. The decoding end determines the motion vectors based on the index information, and optimizes the motion vector determination process by using vector difference and template cost.

Benefits of technology

It significantly reduces the amount of encoded data, improves the accuracy of motion vector determination and the efficiency of the decoding process, and reduces storage and transmission costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025118734_25062026_PF_FP_ABST
    Figure CN2025118734_25062026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure provides a coding method, a decoding method, a communication device, a storage medium, and a program product. The decoding method comprises: a decoder receiving a bitstream, wherein the bitstream comprises first indication information, and the first indication information is used for indicating at least one first motion vector in a motion candidate list of a current coding block; and determining at least one second motion vector of the current coding block on the basis of the at least one first motion vector, wherein a vector difference between each first motion vector among the at least one first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies a first condition, and the at least one second motion vector is related to the motion vector of the current coding block.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding and decoding methods, communication devices, storage media and program products

[0001] This application claims priority to Chinese patent application No. 202411866221.7, filed on December 16, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This disclosure relates to the field of video processing technology, and in particular to an encoding / decoding method, communication device, storage medium, and program product. Background Technology

[0003] With the continuous development of technologies such as artificial intelligence and big data, video coding technology is also constantly innovating and progressing. In the video coding process, the determination of motion vectors is crucial for achieving efficient video compression. Through accurate motion vectors, the encoder can identify and eliminate repetitive information between frames in the video, thus transmitting only the changed pixels, rather than all pixels. This not only significantly reduces file size but also speeds up transmission and reduces storage and transmission costs. Therefore, improving the accuracy of motion vector determination during encoding and decoding is an important direction for the development of current video coding technology. Summary of the Invention

[0004] This disclosure provides an encoding / decoding method, a communication device, a storage medium, and a program product, among other embodiments.

[0005] On one hand, a decoding method is provided, applied at a decoding end. The method includes: receiving a bitstream, the bitstream including first indication information, the first indication information being used to indicate at least one first motion vector in a motion candidate list of the current coding block; and determining at least one second motion vector of the current coding block based on the at least one first motion vector. The vector difference between each of the at least one first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies a first condition, and the at least one second motion vector is related to the motion vector of the current coding block.

[0006] On the other hand, an encoding method is provided for use at an encoding end. The method includes: determining at least one first motion vector in a motion candidate list of a current encoding block; the vector difference between each of the at least one first motion vector and a second motion vector of the current encoding block satisfies a first condition, wherein the second motion vector of the current encoding block is related to the motion vector of the current encoding block; and sending a bit stream to a decoding end, the bit stream including first indication information indicating at least one first motion vector.

[0007] In another aspect, a communication device is provided for use at a decoding end. The communication device includes a processing module and a communication module. The communication module is used to receive a bitstream. The bitstream includes first indication information, which indicates at least one first motion vector in a motion candidate list of the current coded block. The processing module is used to determine at least one second motion vector of the current coded block based on the at least one first motion vector. The vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies a first condition, and the at least one second motion vector is associated with the motion vector of the current coded block.

[0008] In another aspect, a communication device is provided for use at an encoding end. The communication device includes a processing module and a communication module. The processing module is used to determine at least one first motion vector in a motion candidate list of the current coded block. The vector difference between each first motion vector and a second motion vector of the current coded block satisfies a first condition, wherein the second motion vector of the current coded block is related to the motion vector of the current coded block. The communication module is used to send a bit stream to a decoding end. The bit stream includes first indication information indicating at least one first motion vector.

[0009] In another aspect, a communication device is provided. This communication device includes a memory and a processor. The memory and the processor are coupled; the memory stores instructions executable by the processor; when the processor executes the instructions, it implements the aforementioned information processing method.

[0010] In another aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores computer program instructions that, when executed on a computer, implement the aforementioned information processing method.

[0011] In another aspect, a computer program product is provided. This computer program product includes computer program instructions that, when executed by a processor, implement the aforementioned information processing method. Attached Figure Description

[0012] Figure 1 is a schematic diagram of adjacent coding blocks of a current coding block according to some embodiments;

[0013] Figure 2 is a system architecture diagram of an encoding and decoding system according to some embodiments;

[0014] Figure 3 is a flowchart of a decoding method according to some embodiments;

[0015] Figure 4 is a schematic diagram of matching a template of a current coding block with a template of a coding block in a reference frame according to some embodiments;

[0016] Figure 5 is a schematic diagram of the coding block adjacent to the left and the coding block adjacent to the top outside of a maximum coding unit according to some embodiments;

[0017] Figure 6 is a schematic diagram of the left-adjacent coding block and the top-adjacent coding block within a maximum coding unit according to some embodiments;

[0018] Figure 7 is a flowchart of another decoding method according to some embodiments;

[0019] Figure 8 is a flowchart of an encoding method according to some embodiments;

[0020] Figure 9 is a flowchart of another encoding method according to some embodiments;

[0021] Figure 10 is a block diagram of a communication device according to some embodiments;

[0022] Figure 11 is a block diagram of another communication device according to some embodiments;

[0023] Figure 12 is a hardware structure diagram of a communication device according to some embodiments. Detailed Implementation

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

[0025] It should be noted that, in the embodiments disclosed herein, the terms "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments disclosed herein should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplarily" or "for example" is intended to present relevant concepts by way of example.

[0026] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0027] In the description of the embodiments disclosed herein, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, "at least one" refers to one or more, and "multiple" refers to two or more.

[0028] Advanced Video Coding Standard (AVS) is a video coding and decoding technology. AVS includes two inter-frame prediction modes: Skip mode and Direct mode. Skip mode predicts the motion vector (MV) of the current coding block using motion information from neighboring encoded blocks. In Skip mode, if the residual information of the current coding block is assumed to be zero, then this residual information is not transmitted. In Direct mode, the process of predicting the motion vector of the current coding block is similar to Skip mode, but in Direct mode, the residual information of the current coding block is calculated and transmitted to further improve the prediction accuracy of the current coding block.

[0029] When predicting motion vectors for the current coded block at the encoder using Skip or Direct mode, the encoder first generates a motion candidate list, which includes multiple motion vectors. The encoder then selects the best motion vector from this list. The encoder sends the index of the best motion vector to the decoder; this index indicates the best motion vector's order within the motion candidate list.

[0030] After receiving the index value sent by the encoder, the decoder generates a motion candidate list in the same way as the encoder. The decoder selects the motion vector corresponding to the index value from the motion candidate list, and predicts the motion vector of the current coded block based on the selected motion vector.

[0031] The above list of motion candidates typically includes the following motion vectors in a fixed candidate order:

[0032] One temporal candidate (or sub-block temporal candidate) (also known as a temporal candidate motion vector);

[0033] The three airspace candidates (also known as airspace candidate motion vectors) are: one bidirectional candidate, one backward candidate, and one forward candidate.

[0034] 0 to 5 motion vector angle prediction candidates (also known as motion vector angular prediction (MVAP));

[0035] 0–8 historical motion candidates (also known as history-based motion vector prediction, HMVP); and

[0036] There are 0 to X candidates for repeated filling, where X is a positive integer;

[0037] The maximum number of candidates in the motion candidate list is 12.

[0038] The decoding or encoding end determines the above three spatial domain candidates in the following ways.

[0039] Taking the current coding block as coding block #E as an example, the candidate coding blocks to the left and above of coding block #E are: coding block #A, coding block #B, coding block #C, coding block #D, coding block #F, and coding block #G, respectively. The positions of each coding block are shown in Figure 1.

[0040] When selecting spatial candidates, the decoding or encoding end sequentially acquires the motion vectors of these coded blocks in the order of coded block #F, coded block #G, coded block #C, coded block #A, coded block #B, and coded block #D. If the acquired motion vector differs from the motion vector in the current motion candidate list, the acquired coded block is taken as a candidate coded block, and the motion vector of the candidate coded block is called a spatial candidate. For example, the motion vector of the first selected candidate coded block is called a spatial bidirectional candidate, the motion vector of the second selected candidate coded block is called a spatial backward candidate, and the motion vector of the third selected candidate coded block is called a spatial forward candidate.

[0041] With the continuous development of technologies such as artificial intelligence and big data, video coding technology is also constantly innovating and progressing. In the video coding process, the determination of motion vectors is crucial for achieving efficient video compression. Through accurate motion vectors, the encoder can identify and eliminate repetitive information between frames in the video, thus transmitting only the changed pixels, rather than all pixels. This not only significantly reduces file size but also speeds up transmission and reduces storage and transmission costs. Therefore, improving the accuracy of motion vector determination during encoding and decoding is an important direction for the development of current video coding technology.

[0042] In view of this, some embodiments of this disclosure provide an encoding method, the method comprising: a decoding end receiving a bitstream, the bitstream including first indication information, the first indication information being used to indicate at least one first motion vector in a motion candidate list of a current coding block; and determining at least one second motion vector of the current coding block based on the at least one first motion vector. The vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies a first condition, and the at least one second motion vector is associated with the motion vector of the current coding block.

[0043] In this way, firstly, since the first indication information used to indicate at least one first motion vector in the motion candidate list is transmitted, instead of directly transmitting the motion vector data of the current coded block, the amount of encoded data can be significantly reduced. Secondly, the vector difference between each first motion vector and the corresponding second motion vector among at least one second motion vector satisfies the first condition, reducing the deviation between the received at least one first motion vector and the actual motion vector of the current coded block, avoiding excessive deviation. This helps the decoder to more accurately and quickly search for at least one second motion vector around at least one first motion vector, thereby determining the optimal motion vector of the current coded block and improving the accuracy of the motion vectors used in the decoding process.

[0044] The encoding methods provided in some embodiments of this disclosure can be applied to the encoding and decoding system 10 shown in FIG2. As shown in FIG2, the encoding and decoding system 10 includes: an encoding end (encoder) 11 and a decoding end (decoder) 12.

[0045] Encoding end 11 generates a motion candidate list and selects at least one first motion vector from the list. The vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies a first condition, and the at least one second motion vector is associated with the motion vector of the current coded block. Thereafter, encoding end 11 sends a bitstream to decoding end 12 including first indication information indicating the at least one first motion vector. Decoding end 12 generates a motion candidate list in the same manner as encoding end 11, and after receiving the bitstream including the first indication information sent by encoding end 11, selects at least one first motion vector corresponding to the first indication information from the motion candidate list, and determines at least one second motion vector of the current coded block based on the at least one first motion vector.

[0046] In some embodiments, for any one of the at least one first motion vectors, the decoding end 12 determines, in the reference frame, around the position of the first coding block indicated by the first motion vector, a coding block whose template cost satisfies the second condition with the current coding block, and obtains at least one target coding block; and determines the motion vector corresponding to the at least one target coding block as at least one second motion vector.

[0047] In some embodiments, the bitstream sent by the encoder 11 to the decoder 12 further includes motion vector difference information, which indicates the vector difference between each first motion vector and a corresponding second motion vector among at least one second motion vector. Thus, after receiving the bitstream, the decoder 12 can directly determine at least one second motion vector based on the motion vector difference information and the at least one first motion vector indicated by the first indication information, thereby determining the motion vector of the current coding block and improving the accuracy and efficiency of the motion vector determined by the decoder 12.

[0048] It should be noted that Figure 2 is only an exemplary framework diagram. The number of devices included in Figure 2 and the names of each device are not limited. In addition to the devices shown in Figure 2, the encoding and decoding system may also include other devices, such as video playback devices, video servers, etc. This disclosure does not impose any restrictions on this.

[0049] This disclosure does not limit the application scenarios. The system architecture and business scenarios described in some embodiments of this disclosure are for the purpose of more clearly illustrating the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of this disclosure. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by some embodiments of this disclosure are also applicable to similar technical problems.

[0050] The decoding methods provided by some embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0051] Figure 3 is a flowchart of a decoding method according to some embodiments, the method including the following steps S101 to S102:

[0052] In step S101, the decoding end receives a bitstream, which includes first indication information. The first indication information is used to indicate at least one first motion vector in the motion candidate list of the current coding block.

[0053] The first motion vector may have other names, such as the basic motion vector or basic motion information, and this disclosure does not limit this. The motion vector may include the motion velocity, motion direction, and displacement corresponding to the coded block.

[0054] In step S102, the decoding end determines at least one second motion vector of the current coded block based on at least one first motion vector.

[0055] The motion vector difference (MVD) between each first motion vector and the corresponding second motion vector among at least one second motion vector satisfies a first condition, where at least one second motion vector is associated with the motion vector of the current coding block. At least one second motion vector can be a motion vector candidate for the current coding block, and the optimal one among the at least one second motion vectors can be used as the motion vector of the current coding block. For example, the second motion vector (i.e., the optimal second motion vector) that minimizes the template cost between the coding block in the reference frame indicated by the at least one second motion vector and the current coding block can be used as the motion vector of the current coding block.

[0056] The motion vector of the current coding block may have other names, such as the optimal motion vector of the current coding block or the optimal motion information of the current coding block, and this disclosure does not limit this. The motion vector of the current coding block is the motion vector that the current coding block will eventually use to generate the prediction block of the current coding block.

[0057] For example, the first condition is that the vector difference between each first motion vector and a corresponding second motion vector among at least one second motion vector is less than a first threshold (or the vector difference is minimal). For example, a vector difference less than the first threshold can be understood as the second motion vector being searched around the coded block indicated by the first motion vector, and the specific search range size is determined based on the size of the first threshold.

[0058] For example, the second motion vector of the current coding block is the motion vector of the coding block with the minimum template cost found around the coding block indicated by the first motion vector.

[0059] For example, the second motion vector of the current coding block is the motion vector of the coding block searched around the coding block indicated by the first motion vector where the template cost is less than the first threshold.

[0060] In some embodiments, the template cost between the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block and the current coding block satisfies the second condition.

[0061] The coded block in the reference frame can be referred to as the reference coded block, and this disclosure does not impose any limitation on this. The template cost is used to characterize the error between the pixels of the adjacent reconstructed coded blocks of the current coded block and the pixels of the adjacent reconstructed coded blocks of the coded block in the reference frame.

[0062] For example, as shown in Figure 4, which is a schematic diagram of matching a template of a current coding block with a template of a coding block in a reference frame according to some embodiments, the adjacent reconstructed coding blocks of the current coding block generally refer to the coding blocks adjacent to at least one of the top and left sides of the current coding block (denoted as the current upper template and the current left template); the adjacent reconstructed coding blocks of the coding block in the reference frame generally refer to the coding blocks adjacent to at least one of the top and left sides of the coding block in the reference frame (denoted as the reference upper template and the reference left template). The pixel error between the two is denoted as the template cost.

[0063] For example, the second condition can be that the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block is at least one coding block with the minimum template cost between it and the current coding block.

[0064] For example, the second condition can be that the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block is at least one coding block with the minimum template cost between it and the current coding block, calculated within a preset time period.

[0065] For example, the second condition can be that the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block is at least one coding block whose template cost between it and the current coding block is less than a second threshold.

[0066] In some embodiments, the target coded block is a coded block determined around the position of a first coded block in a reference frame, whose template cost between it and the current coded block satisfies a second condition, and the first coded block is indicated by a first motion vector.

[0067] In some embodiments, the decoding end determines at least one second motion vector of the current coding block based on at least one first motion vector, including: for any one of the at least one first motion vectors, in the reference frame around the position of the first coding block indicated by the first motion vector, determining a coding block whose template cost between it and the current coding block satisfies a second condition, thereby obtaining at least one target coding block; and determining the motion vector corresponding to the at least one target coding block as at least one second motion vector.

[0068] In some embodiments, the decoding end determines, within a reference frame, a coding block whose template cost satisfies a second condition around the position of the first coding block indicated by the first motion vector, including:

[0069] Calculate the template cost between the coded block at at least one preset position in the first region and the current coded block; the first region is established with the first coded block indicated by the first motion vector in the reference frame as the center, and is updated with the coded block corresponding to the minimum template cost calculated in the first region as the center.

[0070] If the number of updates in the first region reaches N times, or if the coding block with the smallest template cost between the first region and the current coding block is located in the center of the first region, then the coding block with the smallest template cost between the first region and the current coding block is taken as the target coding block.

[0071] The preset positions include the vertex and center positions of the first region. The preset positions may also include other positions within the first region, such as on the diagonal within the first region, or within the target quadrant of the first region.

[0072] In some embodiments, the shape of the first region established in the i-th update may be the same as or different from the shape of the first region established in the (i-1)-th update, where i is less than or equal to N. For example, the shape of the first region may be hexagonal or quadrilateral, or other shapes, and this disclosure does not limit this.

[0073] In some embodiments, the decoding end establishes a hexagonal region centered on the first coding block in the reference frame indicated by the first motion vector, and calculates the template cost between the coding block at at least one preset position in the hexagonal region and the current coding block.

[0074] Using the coding block corresponding to the minimum template cost calculated in the hexagonal region as the center, update the established hexagonal region until the number of times the hexagonal region is updated reaches L times or the coding block with the minimum template cost between the current coding block and the hexagonal region is the coding block at the center position of the hexagonal region. Then, using the coding block with the minimum template cost between the current coding block and the hexagonal region as the center, establish a quadrilateral region and calculate the template cost between the coding block at at least one preset position in the quadrilateral region and the current coding block.

[0075] The quadrilateral region is updated using the coded block corresponding to the minimum template cost calculated within it as the center. This process continues until the quadrilateral region has been updated P times, or until the coded block with the minimum template cost between it and the current coded block is located at the center of the quadrilateral region. At this point, the coded block with the minimum template cost between it and the current coded block is selected as the target coded block. P is the difference between N and L. For example, a hexagonal region is established 30 times and updated L times, while a quadrilateral region is established once and updated P times.

[0076] For example, taking template cost calculation as an example, performing template matching search, around the position of the current coding block indicated by the first motion vector in the reference frame, searches for the coding block with the minimum template cost between it and the current coding block, including the following steps:

[0077] First, a motion candidate list is generated. The first four motion vectors are selected from the motion candidate list, and each of these four motion vectors is deduplicated and adjusted to an integer pixel position by rounding down.

[0078] Taking one of these four motion vectors as an example, the following operations are performed on the motion vector: a template (the template width can be 4) is constructed on the adjacent reconstructed coding block in the reference frame indicated by the motion vector, and a template matching search is performed for each available direction of the motion vector.

[0079] During the template matching search process, a hexagonal search is first used, that is, a hexagonal region is established with the coded block in the reference frame indicated by the motion vector as the center, and the template cost between the coded block at at least one preset position in the hexagonal region and the current coded block is calculated (the template cost can be calculated using the Sum of Absolute Differences (SAD) method).

[0080] Using the coded block in the reference frame corresponding to the calculated minimum template cost as the center, update the established hexagonal region until the number of updates to the hexagonal region reaches 30 or the coded block with the minimum template cost between the current coded block and the coded block in the hexagonal region is the coded block at the center of the hexagonal region. Then, use quadrilateral search, that is, use the coded block with the minimum template cost between the current coded block and the coded block in the hexagonal region as the center to establish a quadrilateral region.

[0081] Calculate the template cost between the coded block at at least one preset position in the quadrilateral region and the current coded block (the template cost can be calculated using the SAD method); select the coded block with the minimum template cost between the coded block and the current coded block in the quadrilateral region as the target coded block.

[0082] It is understandable that the smaller the template cost between the coded block in the reference frame indicated by the motion vector and the current coded block, the better the motion vector is for the current coded block.

[0083] In some embodiments, the bitstream further includes motion vector difference information to determine at least one second motion vector of the current coded block based on at least one first motion vector, including: determining at least one second motion vector based on the motion vector difference information and at least one first motion vector. The motion vector difference information is used to indicate the vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector. This can improve the accuracy and efficiency of the motion vectors determined at the decoding end.

[0084] In some embodiments, determining at least one second motion vector of the current coding block based on at least one first motion vector includes: determining at least one second motion vector based on motion vector difference information and at least one first motion vector.

[0085] The motion vector difference information can include multiple motion vector differences, each motion vector difference corresponding to one or more first motion vectors. Based on a motion vector difference and the one or more first motion vectors corresponding to that motion vector difference, one or more second motion vectors can be determined.

[0086] In some embodiments, the first indication information is index information indicating the position of at least one first motion vector in the motion candidate list. This allows the decoding end to determine the first motion vector from the motion candidate list based on the index information of the first motion vector. The index of the motion vector is used to characterize the order of the motion vector in the motion candidate list.

[0087] In some embodiments, the first indication information is encoded in the bitstream using variable-length codes.

[0088] In some embodiments, the motion candidate list includes at least one preset motion vector, and a first motion vector belongs to the at least one preset motion vector. The order of the preset motion vectors in the motion candidate list is determined based on the template cost between the current coding block indicated by the preset motion vector and the corresponding coding block in the reference frame. Thus, when the optimal motion vector is indicated by the index of the motion vector, the transmitted index value is smaller, and a smaller index value occupies fewer coding bits. Therefore, in some embodiments of this disclosure, after sorting the preset motion vectors in the motion candidate list by template cost, the coding bits occupied by the index indicating the optimal motion vector can be reduced, improving compression efficiency.

[0089] In some embodiments, the motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit (LCU) where the current coding block is located.

[0090] In some embodiments, the preset motion vectors in the motion candidate list are the M motion vectors with the minimum template cost between the corresponding coding block in the reference frame and the current coding block among the K motion vectors in the initial motion candidate list. K indicates the number of motion vectors in the initial motion candidate list, and both K and M are positive integers, with K being greater than or equal to M.

[0091] In some embodiments, the K motion vectors include motion vectors of at least one preset coding block, wherein the preset coding block is a coding block adjacent to the boundary of the largest coding unit in which the current coding block is located.

[0092] In some examples, the decoder selects at least one preset coding block from among multiple coding blocks adjacent to the boundary of the largest coding unit containing the current coding block. The decoder writes the motion vector of at least one preset coding block (also known as a spatial expansion candidate) and the motion vectors of other candidate coding blocks determined by other methods into an initial motion candidate list.

[0093] This provides more spatial expansion candidates. Since there may be a first motion vector among the spatial expansion candidates that is closer to the currently encoded motion vector, the encoding method provided in some embodiments of this disclosure can improve the accuracy of the first motion vector determined during the encoding process.

[0094] In some embodiments, the initial motion candidate list may not include the motion vectors of at least one preset coding block. For example, if there are no adjacent coding blocks at the boundary of the largest coding unit, or if there are no motion vectors in the adjacent coding blocks, the motion candidate list may not include the motion vectors of at least one preset coding block; or, for example, if the motion vectors of the coding blocks adjacent to the boundary of the largest coding unit are all the same as the motion vectors already determined in the motion candidate list, the motion candidate list may not include the motion vectors of at least one preset coding block. This disclosure does not limit this.

[0095] In some embodiments, at least one preset coding block includes: a coding block outside the maximum coding unit and adjacent to the boundary of the maximum coding unit, and at least one coding block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.

[0096] For example, the boundary of the largest coding unit (LCU) includes at least one of the following: the left boundary of the LCU and the top boundary of the LCU. To utilize motion information from non-directly adjacent blocks as much as possible and reduce duplication with other candidates, the spatial expansion candidate is obtained from the left and top boundaries of the LCU containing the current block. That is, the block position derived from the spatial expansion candidate does not change with the current block's position within the LCU.

[0097] In some embodiments, the motion vector of at least one preset coding block is different from the motion vectors in the initial motion candidate list other than the motion vector of at least one preset coding block; or, the motion vectors of at least one preset coding block are different; or, the motion vector of at least one preset coding block is different from the motion vectors in the initial motion candidate list other than the motion vector of at least one preset coding block, and the motion vectors of at least one preset coding block are different.

[0098] In some embodiments, the initial motion candidate list may or may not contain identical motion vectors. For example, at least one preset coding block may contain motion vectors identical to other motion vectors in the initial motion candidate list besides those in at least one preset coding block; or, at least two motion vectors in at least one preset coding block may be identical; or, at least one preset coding block may contain motion vectors identical to other motion vectors in the initial motion candidate list besides those in at least one preset coding block, and at least two motion vectors in at least one preset coding block may be identical. Furthermore, the motion candidate list determined based on the initial motion candidate list may also contain at least two identical preset motion vectors. This disclosure does not impose any limitations on this.

[0099] In some embodiments, at least one preset coding block includes: a coding block selected from coding blocks adjacent to the boundary of the largest coding unit based on at least one of the coding block position order in the video frame and a preset interval. In other words, when the decoding end selects the at least one preset coding block from the coding blocks adjacent to the boundary of the largest coding unit, it can make the selection based on at least one of the coding block position order in the video frame and a preset interval.

[0100] For example, the positional order includes bottom-to-top and left-to-right. The decoder selects a coding block every other coding block in a bottom-to-top, left-to-right manner and adds the motion vector of the selected coding block to the initial motion candidate list. In some embodiments, before adding the motion vector of the selected coding block to the initial motion candidate list, the decoder may pre-determine whether the motion vector of the selected coding block meets a condition (such as whether it is the same as the current motion vector in the initial motion candidate list), and add the motion vector of the selected coding block to the initial motion candidate list if the condition is met.

[0101] In some embodiments, the process of selecting at least one preset coding block at the decoding end from coding blocks outside the largest coding unit and adjacent to the left and upper boundaries of the largest coding unit is as follows:

[0102] The decoder determines the largest coding unit (MCU) containing the current coding block, and also determines the coding blocks adjacent to the left and top of the largest coding unit. Figure 5 shows the coding blocks adjacent to the left and top of the largest coding unit. For example, the size of the largest coding unit is 128×128 pixels; the size of the coding block is 4×4 pixels.

[0103] The decoder selects a coding block from bottom to top and from left to right, skipping one coding block at a time, and determines the motion vector of the selected coding block. The coding blocks selected by the decoder are shown in bold in Figure 5.

[0104] The decoder determines whether at least one of the motion vector and bidirectional gradient correction (BGC) information of the selected coded block meets the requirements. For example, whether the motion vector of the coded block is the same as the K motion vectors included in the initial motion candidate list, or whether the bidirectional gradient correction information of the coded block meets the preset conditions. If it does, the decoder adds the motion vector of the currently selected coded block to the initial motion candidate list.

[0105] In some embodiments, the process of selecting at least one preset coding block from the coding blocks within the largest coding unit and adjacent to the left and upper boundaries of the largest coding unit at the decoding end is as follows:

[0106] The decoder determines the maximum coding unit (MCU) containing the current coding block, and then determines the leftmost and topmost coding blocks within the MCU. Figure 6 shows the coding blocks within the MCU, adjacent to the left of the MCU, and adjacent to the top of the MCU. In some examples, the MCU size is 128×128 pixels, and the coding block size is 4×4 pixels.

[0107] The decoder selects a coding block from bottom to top and from left to right, skipping one coding block at a time, and determines the motion vector of the selected coding block. The coding blocks selected by the decoder are shown in bold in Figure 6.

[0108] The decoder determines whether at least one of the motion vector and bidirectional gradient correction information of the selected coded block meets the requirements. For example, whether the motion vector of the coded block is the same as the current motion vector among the K motion vectors included in the initial motion candidate list, or whether the bidirectional gradient correction information of the coded block meets the preset conditions. If it meets the requirements, the decoder adds the motion vector of the currently selected coded block to the initial motion candidate list.

[0109] It is understood that the size of the aforementioned coding block and the size of the maximum coding unit can be determined according to actual needs, and this disclosure does not impose any restrictions on them.

[0110] It should be noted that the above explanation only uses the example of the boundary of the largest coding unit including at least one of the left boundary and the upper boundary of the largest coding unit. In practical applications, the boundary of the largest coding unit may also include, but is not limited to, other boundaries, such as at least one of the right boundary and the lower boundary of the largest coding unit; this disclosure does not limit this.

[0111] In some embodiments, the K motion vectors in the initial motion candidate list may include other motion vectors besides those of at least one preset coded block. For example, the K motion vectors may include: temporal candidate motion vectors, spatial candidate motion vectors, history-based motion vectors, and motion vectors of at least one preset coded block. It should be understood that the K motion vectors may also include more or fewer motion vectors than in this example, and this disclosure does not limit this.

[0112] For example, suppose the initial motion candidate list includes: temporal candidate motion vectors of sub-blocks, spatial candidate motion vectors, motion vectors predicted based on motion vector angles, historical motion vectors, and motion vectors of at least one preset coding block.

[0113] In some implementations, the motion vectors in the initial motion candidate list are arranged in the following order:

[0114] 1. Temporal candidate motion vectors;

[0115] 2. Candidate motion vectors in the airspace;

[0116] 3. Motion vector (spatial expansion candidate) of at least one preset coded block;

[0117] 4. Motion vectors based on history.

[0118] In other embodiments, the motion vectors in the initial motion candidate list are arranged in the following order:

[0119] 1. Temporal candidate motion vectors;

[0120] 2. Candidate motion vectors in the airspace;

[0121] 3. Motion vectors based on history;

[0122] 4. Motion vector of at least one preset coding block (spatial expansion candidate).

[0123] The motion vector of at least one preset coding block in the initial motion candidate list is different from the motion vectors in the initial motion candidate list other than the motion vector of at least one preset coding block; or, the motion vectors in the motion vector of at least one preset coding block are different; or, the motion vector of at least one preset coding block in the initial motion candidate list is different from the motion vectors in the initial motion candidate list other than the motion vector of at least one preset coding block, and the motion vectors in the motion vector of at least one preset coding block are different.

[0124] Compared to motion candidate lists in related technologies, the motion vectors of at least one preset coding block added to the initial motion candidate list in this disclosure are deduplicated motion vectors, and motion vectors for which template costs cannot be calculated are excluded, such as motion vectors predicted based on motion vector angles. Therefore, the motion vectors in the initial motion candidate list in this disclosure can all be sorted based on template costs. For example, adding 10 deduplicated motion vectors of preset coding blocks that are different from the original motion vectors in the motion candidate lists of related technologies yields the initial motion candidate list.

[0125] The template cost corresponding to each motion vector in the initial motion candidate list is calculated, and the motion vectors are sorted based on the calculated template cost. These motion vectors are then added to the final motion candidate list based on the sorting. In some implementations, motion vectors with smaller template costs are ranked higher, and correspondingly, their index values ​​are smaller. A smaller template cost indicates a smaller pixel error in the coding block to which the motion vector belongs, and a higher probability that the motion vector is identified as the optimal motion vector. In other words, in some embodiments of this disclosure, after sorting based on template costs, the index value of the optimal motion vector is usually a smaller value. This results in a smaller index value being sent to the decoding end when indicating the optimal motion vector by its index, and a smaller index value occupies fewer coding bits. Therefore, in some embodiments of this disclosure, after sorting the motion vectors in the initial motion candidate list by template cost, the number of coding bits occupied by the index indicating the optimal motion vector can be reduced, improving compression efficiency.

[0126] If the initial motion candidate list contains a large number of motion vectors, a subset of these vectors with the lowest template costs can be selected and added to the final motion candidate list, instead of adding all motion vectors from the initial list. In other words, if the initial motion candidate list contains K motion vectors, the preset motion vectors in the final list are the M vectors with the lowest template costs among these K vectors; both K and M are positive integers, and K is greater than M. For example, after reordering the motion vectors in the initial list, at most the top 5 motion vectors with the lowest template costs can be retained as preset motion vectors in the final list.

[0127] In this way, at least one preset coding block is selected from the adjacent coding blocks of the largest coding unit where the current coding block is located, and the motion vector of at least one preset coding block is added to the initial motion candidate list, thereby increasing the selection range of motion vectors (i.e. the first motion vector) in the final motion candidate list and thus improving the accuracy of the selected motion vector.

[0128] In some embodiments, the method of adding motion vectors of coded blocks adjacent to the boundary of the largest coding unit to the motion candidate list is called the spatial expansion candidate function. The decoder can also indicate whether the spatial expansion candidate function is enabled in the motion candidate list based on the first indication information. As shown in Figure 7, this can be specifically implemented through the following steps S201 and S202.

[0129] In step S201, the decoding end receives the second indication information.

[0130] The second indication information is used to indicate whether the motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit where the current coding block is located.

[0131] In some embodiments, the second indication information is present in the bitstream received by the decoding end. It is understood that the decoding end may also receive the second indication information in other ways, and this disclosure does not limit this.

[0132] In step S202, the decoding end determines whether the motion candidate list includes motion vectors of coding blocks adjacent to the boundary of the largest coding unit where the current coding block is located, based on the second indication information.

[0133] In some embodiments, the second indication information can indicate whether the motion candidate list includes the motion vector of a coding block adjacent to the boundary of the largest coding unit where the current coding block is located (i.e., whether the spatial expansion candidate function is enabled) through the value of the corresponding bit. For example, when the value of the first preset bit is 1, it indicates that the spatial expansion candidate function is enabled; when the value of the first preset bit is 0, it indicates that the spatial expansion candidate function is disabled.

[0134] In some embodiments, the second indication information is further used to indicate whether the motion vectors in the motion candidate list are sorted based on the size of the template cost. In other words, the second indication information is also used to indicate whether the function of sorting based on the size of the template cost is enabled.

[0135] In some embodiments, the second indication information is further used to indicate the maximum number of motion vectors in the motion candidate list. For example, the maximum number of motion vectors in the motion candidate list is M, where M is a positive integer and can be a fixed value.

[0136] In some embodiments, the second indication information can indicate whether the template cost-based sorting function is enabled by the value of a corresponding bit. For example, a value of 1 for the second preset bit indicates that the template cost-based sorting function is enabled; a value of 0 for the second preset bit indicates that the template cost-based sorting function is disabled.

[0137] In some other embodiments, where the second indication information is used to indicate that the motion candidate list is determined based on the motion vectors of coded blocks adjacent to the boundary of the largest coding unit to which the current coded block belongs; the second indication information is also used to indicate the number of motion vectors of coded blocks adjacent to the boundary of the largest coding unit to which the current coded block belongs in the motion candidate list (i.e., the second indication information can also be used to indicate the number of spatial expansion candidates). In some embodiments, the number of spatial expansion candidates is N, where N is a positive integer, and the value of N can be a fixed value or the value indicated by the second indication information. For example, the value of N is 10.

[0138] Based on the above, the second indication information may indicate at least one of the following: whether the spatial expansion candidate function is enabled, whether the function is sorted based on the size of the template cost, and the number of spatial expansion candidates.

[0139] In some embodiments, the second indication information (control flag) is carried in at least one of the following: the transmission bitstream of the sequence header of the video sequence, the transmission bitstream of the video frame, the transmission bitstream of the video strip (slice), and the transmission bitstream of the video slice. This facilitates flexible control over the switching on and off of the spatial domain extension candidate function and the switching on and off of the motion candidate list reordering.

[0140] In other words, the decoding end can indicate at least one of the following at the granularity of video sequence: whether the spatial domain expansion candidate function is enabled, whether the function is sorted based on the size of the template cost, and the number of spatial domain expansion candidates; or, the decoding end can indicate at the granularity of video frame: whether the function is sorted based on the size of the template cost, and the number of spatial domain expansion candidates; or, the decoding end can indicate at the granularity of video strip: whether the function is sorted based on the size of the template cost, and the number of spatial domain expansion candidates; or, the decoding end can indicate at the granularity of video slice: whether the function is sorted based on the size of the template cost, and the number of spatial domain expansion candidates.

[0141] Taking the second indication information carried in the transmission bitstream of the video sequence header as an example, a control flag "spatial_ext_cands_enable_flag" is added to the bitstream of the sequence header to indicate whether the spatial extension candidate function is enabled. When the value of the flag is 1, it indicates that the spatial extension candidate function is enabled; when the value of the flag is 0, it indicates that the spatial extension candidate function is disabled.

[0142] For example, the format of a sequence header with the "spatial_ext_cands_enable_flag" flag is shown in Table 1 below:

[0143] Table 1

[0144] The above explains the process of enabling and disabling related functions through the second instruction information.

[0145] In some embodiments of this disclosure, the motion candidate list corresponding to each coding block in the maximum coding unit includes the motion vectors of coding blocks selected from the coding blocks adjacent to the boundary of the maximum coding unit.

[0146] In other words, in some embodiments of this disclosure, different coding blocks within the same maximum coding unit only need to determine the boundary-adjacent coding blocks of that maximum coding unit once (denoted as target coding blocks). The motion candidate lists corresponding to these coding blocks all include the motion vectors of the coding blocks selected from the target coding blocks.

[0147] It is understandable that the motion candidate lists corresponding to different coding blocks within the same maximum coding unit all include the motion vectors of the coding blocks selected from the target coding block. However, the motion vectors of the coding blocks selected from the target coding block included in the motion candidate lists corresponding to different coding blocks may be different.

[0148] For example, the temporal candidate motion vectors, spatial candidate motion vectors, and history-based motion vectors in the motion candidate lists corresponding to different coding blocks may be different. When selecting motion vectors from the target coding block at the decoding end, if it is necessary to deduplicate the selected motion vectors, the deduplicated motion vectors may be different, and correspondingly, the motion vectors added to the motion candidate list at the decoding end will also be different.

[0149] The decoding method in some embodiments of this disclosure has been described in detail above. Before the decoding end receives the bitstream including the first indication information sent by the encoding end, the encoding end determines at least one first motion vector in the motion candidate list of the current coding block. The encoding process is described in detail below with reference to FIG8. As shown in FIG8, the encoding method provided in some embodiments of this disclosure includes the following steps S301 and S302:

[0150] In step S301, the encoding end determines at least one first motion vector from the motion candidate list of the current encoding block.

[0151] The vector difference between each first motion vector and the second motion vector of the current coding block satisfies the first condition, and the second motion vector of the current coding block is related to the motion vector of the current coding block.

[0152] For example, the first condition is that the vector difference between each first motion vector and a corresponding second motion vector among at least one second motion vector is less than a first threshold (or the vector difference is minimal). A vector difference less than the first threshold can be understood as the second motion vector being searched around the coded block indicated by the first motion vector, and the specific search range is determined based on the size of the first threshold.

[0153] For example, the second motion vector of the current coding block is the motion vector of the coding block with the lowest cost found around the coding block indicated by the first motion vector.

[0154] For example, the second motion vector of the current coding block is the motion vector of the coding block whose cost is less than the first threshold that is searched around the coding block indicated by the first motion vector.

[0155] Alternatively, for example, using second motion vectors of one or more current coded blocks determined by other means, the motion vector with the smallest vector difference between each second motion vector in the motion candidate list can be used as the first motion vector.

[0156] If there are multiple first motion vectors, there will be multiple corresponding second motion vectors.

[0157] In some embodiments, the method further includes: determining at least one second motion vector of the current coding block before determining at least one first motion vector. The cost between the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block and the current coding block satisfies a second condition.

[0158] For example, the second condition could be that the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block is at least one coding block with the minimum cost to the current coding block.

[0159] For example, the second condition can be that the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block is at least one coding block with the minimum cost between it and the current coding block, calculated within a preset time period.

[0160] For example, the second condition could be that the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block is at least one coding block whose cost to the current coding block is less than a second threshold.

[0161] The cost includes at least one of template cost or current block cost. Template cost is used to characterize the error between pixels in adjacent reconstructed coded blocks of the current coded block and pixels in adjacent reconstructed coded blocks of the reference frame. Current block cost is used to characterize the error between pixels in the current coded block and pixels in coded blocks of the reference frame.

[0162] In some embodiments, the target coded block is a coded block determined around the location of a first coded block in a reference frame, whose cost relative to the current coded block satisfies a second condition, the first coded block being indicated by a first motion vector.

[0163] In some embodiments, determining at least one second motion vector of the current coding block includes: determining at least one motion vector from a motion candidate list; for any of the at least one motion vectors, determining, in a reference frame, around the position of the coding block indicated by the motion vector, a second coding block whose cost between it and the current coding block satisfies a third condition, thus obtaining at least one second coding block; and determining the motion vector corresponding to the second coding block whose cost between it and the current coding block satisfies a fourth condition as at least one second motion vector. At least one first motion vector is the motion vector of the coding block indicated by the at least one motion vector that corresponds to the second coding block satisfying the fourth condition.

[0164] When the cost is the template cost, the process of determining at least one second coded block can be called the template matching search process. When the cost is the current block cost, the process of determining at least one second coded block can be called the direct motion search process.

[0165] It is understandable that, for any given first motion vector, a second coding block can be determined around the location of the coding block indicated by the first motion vector in the reference frame, where the cost between the current coding block and the second coding block simultaneously satisfies the third and fourth conditions.

[0166] For example, the third condition could be at least one second coding block whose cost to the current coding block is less than a third threshold. It is understood that each motion vector in at least one motion vector has a corresponding threshold, some motion vectors in at least one motion vector may have the same threshold, or any two motion vectors in at least one motion vector may have different thresholds.

[0167] For example, the third condition could be at least one second coding block with the lowest cost relative to the current coding block.

[0168] For example, the third condition could be at least one second coding block that has the lowest cost relative to the current coding block, calculated within a preset time period.

[0169] For example, determining the motion vector corresponding to the second coding block whose cost between it and the current coding block satisfies the fourth condition in at least one second coding block includes: determining the motion vector corresponding to the second coding block whose cost between it and the current coding block is less than the fourth threshold in at least one second coding block.

[0170] For example, determining the motion vector corresponding to the second coding block in at least one second coding block that satisfies the fourth condition with respect to the current coding block as at least one second motion vector includes: determining the motion vector corresponding to the second coding block in at least one second coding block that has the smallest cost with respect to the current coding block as at least one second motion vector.

[0171] For example, determining the motion vector corresponding to the second coding block in at least one second coding block that satisfies the fourth condition with respect to the current coding block as at least one second motion vector includes: determining the motion vector corresponding to the second coding block in at least one second coding block that has the smallest cost with respect to the current coding block within a preset time period as at least one second motion vector.

[0172] In some embodiments, at least one motion vector includes all or part of the motion vectors in the motion candidate list.

[0173] In some embodiments, determining a second coding block in a reference frame, around the location of the coding block indicated by the motion vector, whose cost satisfies the third condition relative to the current coding block, includes:

[0174] Calculate the cost between the coded block at at least one preset position in the first region and the current coded block; the first region is established centered on the coded block indicated by the motion vector in the reference frame, and updated centered on the coded block corresponding to the minimum cost calculated in the first region.

[0175] If the number of updates in the first region reaches N times, or if the coding block with the lowest cost between the first region and the current coding block is located in the center of the first region, then the coding block with the lowest cost between the first region and the current coding block is selected as the second coding block.

[0176] The preset positions include the vertex and center positions of the first region. The preset positions may also include other positions within the first region, such as on the diagonal within the first region, or within the target quadrant of the first region.

[0177] In some embodiments, the shape of the first region established in the i-th update may be the same as or different from the shape of the first region established in the (i-1)-th update, where i is less than or equal to N. For example, the shape of the first region may be hexagonal or quadrilateral, or other shapes, and this disclosure does not limit this.

[0178] Although the above description describes determining the second motion vector by searching for coded blocks that satisfy preset conditions around the coded blocks indicated by the motion vector in the motion candidate list, and then determining the first motion vector, this disclosure is not limited to this. The second motion vector can be determined in other ways, and the first motion vector can then be determined subsequently. For example, the motion vector corresponding to the coded block in the coded blocks indicated by the motion vector in the motion candidate list that is closest to the target coded block indicated by the determined second motion vector can be determined as the first motion vector.

[0179] In step S302, the encoding end sends a code stream to the decoding end, the code stream including first indication information indicating at least one first motion vector.

[0180] In some embodiments, the bitstream further includes motion vector difference information, which indicates the vector difference between each first motion vector and a corresponding second motion vector among at least one second motion vector.

[0181] In some embodiments, the first indication information is index information indicating the position of at least one first motion vector in the motion candidate list. This allows the decoding end to determine the first motion vector from the motion candidate list based on the index information of the first motion vector. The index of the motion vector is used to characterize the order of the motion vector in the motion candidate list.

[0182] In some embodiments, the encoder encodes the first indication information into the bitstream using variable-length codes. The motion vectors in the motion candidate list can be sorted before encoding.

[0183] In some embodiments, the sorting of preset motion vectors in the motion candidate list is determined based on the template cost between the current coding block indicated by the preset motion vector and the corresponding coding block in the reference frame. This way, when the encoder indicates the optimal motion vector using the motion vector index, the index value sent to the decoder is smaller, and the smaller index value occupies fewer coding bits. Therefore, in some embodiments of this disclosure, after sorting the motion vectors in the motion candidate list using the template cost, the coding bits occupied by the index indicating the optimal motion vector can be reduced, improving compression efficiency.

[0184] In some embodiments, the motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit in which the current coding block is located.

[0185] In some embodiments, the preset motion vectors in the motion candidate list are the M motion vectors with the smallest template cost between the corresponding coding block in the reference frame and the current coding block among the K motion vectors in the initial motion candidate list; K indicates the number of motion vectors in the motion candidate list, and both K and M are positive integers, with K being greater than or equal to M.

[0186] In some embodiments, the K motion vectors include motion vectors of at least one preset coding block, wherein the preset coding block is a coding block adjacent to the boundary of the largest coding unit in which the current coding block is located.

[0187] In some embodiments, at least one preset encoding block includes:

[0188] At least one of the following: a coded block outside the maximum coding unit and adjacent to the boundary of the maximum coding unit, and a coded block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.

[0189] In some embodiments, the boundary of the largest coding unit includes at least one of the following:

[0190] The left boundary of the largest coding unit; and

[0191] The upper boundary of the largest coding unit.

[0192] In some embodiments, the motion vector of at least one preset coding block is different from the motion vectors in the motion candidate list other than the motion vector of at least one preset coding block; or, the motion vectors of at least one preset coding block are different; or, the motion vector of at least one preset coding block is different from the motion vectors in the motion candidate list other than the motion vector of at least one preset coding block, and the motion vectors of at least one preset coding block are different.

[0193] In some embodiments, at least one preset coding block includes: a coding block selected from coding blocks adjacent to the boundary of the largest coding unit based on at least one of the positional order of coding blocks in a video frame and a preset interval.

[0194] In some embodiments, the K motion vectors further include at least one of the following:

[0195] Temporal candidate motion vectors;

[0196] Candidate motion vectors in the airspace; and

[0197] Motion vectors based on history.

[0198] For a description of other related content in steps S301 and S302, please refer to the above embodiments or examples, and they will not be repeated here.

[0199] In some embodiments, the method of adding motion vectors of coded blocks adjacent to the boundary of the largest coded unit to the motion candidate list is called the spatial expansion candidate function. The encoder can also indicate to the decoder whether the spatial expansion candidate function is enabled in the motion candidate list. As shown in Figure 9, the process of the encoder indicating to the decoder whether the spatial expansion candidate function is enabled in the motion candidate list can be implemented through the following steps S401 and S402.

[0200] In step S401, the encoding end generates second indication information.

[0201] The second indication information is used to indicate whether the motion candidate list includes motion vectors of coding blocks adjacent to the boundary of the largest coding unit containing the current coding block. In other words, the second indication information is used to indicate whether the spatial expansion candidate function is enabled.

[0202] In some embodiments, the second indication information can indicate whether the spatial expansion candidate function is enabled by the value of a corresponding bit. For example, when the value of the first preset bit is 1, it indicates that the spatial expansion candidate function is enabled; when the value of the first preset bit is 0, it indicates that the spatial expansion candidate function is disabled.

[0203] In step S402, the encoding end sends the second indication information to the decoding end.

[0204] In some embodiments, the second indication information is further used to indicate at least one of whether the motion vectors in the motion candidate list are sorted based on the size of the template cost, and the number of motion vectors in the motion candidate list that are adjacent to the boundary of the largest coding unit to which the current coding block belongs. This disclosure does not elaborate further on this.

[0205] In some embodiments, the second indication information may be carried in the bitstream sent from the encoder to the decoder. The encoder may also send the second indication information to the decoder in other ways, and this disclosure does not impose any limitations on this.

[0206] For a detailed understanding of the second instruction information, please refer to the description of the second instruction information in the above embodiments; this disclosure will not repeat it further.

[0207] For a description of other related content in steps S401 and S402, please refer to the above embodiments or examples, and they will not be repeated here.

[0208] The above scenarios and methods can be combined, and this disclosure does not limit them.

[0209] It is understood that, in order to achieve the above-mentioned functions, the communication device includes at least one of the hardware structures and software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the algorithmic steps of the various examples described in conjunction with the embodiments of this disclosure, the embodiments of this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of some embodiments of this disclosure.

[0210] Some embodiments of this disclosure can divide the communication device into functional modules according to the above method embodiments. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one functional module. The integrated module can be implemented in hardware or software. It should be noted that the module division in some embodiments of this disclosure is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. The following description uses the example of dividing each functional module according to each function.

[0211] Figure 10 is a block diagram of a communication device according to some embodiments. The communication device can execute the decoding method provided in the above-described method embodiments and can be applied to a decoding end. As shown in Figure 10, the communication device includes: a communication module 1001 and a processing module 1002.

[0212] The communication module 1001 is used to receive a bit stream. The bit stream includes first indication information, which indicates at least one first motion vector in the motion candidate list of the current coded block.

[0213] Processing module 1002 is configured to determine at least one second motion vector of the current coding block based on at least one first motion vector. The vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies a first condition, and at least one second motion vector is related to the motion vector of the current coding block.

[0214] In some embodiments, the template cost between the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block and the current coding block satisfies the second condition.

[0215] In some embodiments, the target coded block is a coded block determined around the position of a first coded block in a reference frame, whose template cost between it and the current coded block satisfies a second condition, and the first coded block is indicated by a first motion vector.

[0216] For example, processing module 1002 is configured to: for any one of the at least one first motion vectors, in a reference frame around the position of the first coding block indicated by the first motion vector, determine a coding block whose template cost between it and the current coding block satisfies a second condition, thereby obtaining at least one target coding block; and determine the motion vector corresponding to the at least one target coding block as at least one second motion vector.

[0217] In some embodiments, the processing module 1002 is configured to: calculate the template cost between a coding block at at least one preset position in a first region and the current coding block, wherein the preset position includes the vertex position and the center position of the first region; establish the first region centered on the first coding block indicated by the first motion vector in the reference frame, and update the coding block corresponding to the minimum template cost calculated in the first region as the center; and, if the number of updates in the first region reaches N times or the coding block with the minimum template cost between the first region and the current coding block is located at the center position of the first region, take the coding block with the minimum template cost between the first region and the current coding block as the target coding block.

[0218] In some embodiments, the bitstream further includes motion vector difference information, which indicates the vector difference between each first motion vector and a corresponding second motion vector among at least one second motion vector. In this case, the processing module 1002 is further configured to determine at least one second motion vector based on the motion vector difference information and at least one first motion vector.

[0219] In some embodiments, the sorting of preset motion vectors in the motion candidate list is determined based on the template cost between the current coding block indicated by the preset motion vector and the corresponding coding block in the reference frame; the first indication information is index information indicating the position of at least one first motion vector in the motion candidate list.

[0220] In some embodiments, the motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit in which the current coding block is located.

[0221] In some embodiments, the preset motion vectors in the motion candidate list are the M motion vectors with the smallest template cost between the corresponding coding block in the reference frame and the current coding block among the K motion vectors in the initial motion candidate list; K indicates the number of motion vectors in the initial motion candidate list, and both K and M are positive integers, with K being greater than or equal to M.

[0222] In some embodiments, the K motion vectors include motion vectors of at least one preset coding block, wherein the preset coding block is a coding block adjacent to the boundary of the largest coding unit in which the current coding block is located.

[0223] In some embodiments, at least one preset coding block includes at least one of a coding block outside the maximum coding unit and adjacent to the boundary of the maximum coding unit, and a coding block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.

[0224] In some embodiments, the boundary of the maximum coding unit includes at least one of the following: the left boundary of the maximum coding unit and the upper boundary of the maximum coding unit.

[0225] In some embodiments, the motion vector of at least one preset coding block is different from the motion vectors in the initial motion candidate list other than the motion vector of at least one preset coding block; or, the motion vectors of at least one preset coding block are different; or, the motion vector of at least one preset coding block is different from the motion vectors in the initial motion candidate list other than the motion vector of at least one preset coding block, and the motion vectors of at least one preset coding block are different.

[0226] In some embodiments, at least one preset coding block includes: a coding block selected from coding blocks adjacent to the boundary of the largest coding unit based on at least one of the positional order of coding blocks in a video frame and a preset interval.

[0227] In some embodiments, the K motion vectors further include at least one of the following:

[0228] Temporal candidate motion vectors;

[0229] Candidate motion vectors in the airspace; and

[0230] Motion vectors based on history.

[0231] In some embodiments, the communication module 1001 is configured to receive second indication information, which indicates whether the motion candidate list includes motion vectors of coding blocks adjacent to the boundary of the largest coding unit where the current coding block is located.

[0232] In some embodiments, the second indication information is carried in at least one of the following: the transmission bitstream of the sequence header of the video sequence, the transmission bitstream of the video frame, the transmission bitstream of the video strip, and the transmission bitstream of the video slice.

[0233] For a more detailed description of the communication module 1001 and processing module 1002, as well as a more detailed description of their respective technical features and beneficial effects, please refer to the corresponding method embodiment section above, which will not be repeated here.

[0234] Figure 11 is a block diagram of another communication device according to some embodiments. The communication device can execute the encoding method provided in the above-described method embodiments and can be applied to an encoding end. As shown in Figure 11, the communication device includes: a processing module 1101 and a communication module 1102.

[0235] Processing module 1101 is configured to determine at least one first motion vector in the motion candidate list of the current coding block. The vector difference between each first motion vector and a second motion vector of the current coding block satisfies a first condition, wherein the second motion vector of the current coding block is related to the motion vector of the current coding block.

[0236] The communication module 1102 is used to send a bit stream to the decoding end. The bit stream includes first indication information indicating at least one first motion vector.

[0237] In some embodiments, processing module 1101 is configured to determine at least one second motion vector of the current coding block before determining at least one first motion vector. The cost between the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block and the current coding block satisfies a second condition.

[0238] In some embodiments, the target coded block is a coded block determined around the location of a first coded block in a reference frame, whose cost relative to the current coded block satisfies a second condition. The first coded block is indicated by a first motion vector.

[0239] In some embodiments, the processing module 1101 is configured to: determine at least one motion vector from a motion candidate list; for any of the at least one motion vectors, determine, in a reference frame, a second coding block whose cost between the current coding block and the motion vector satisfies a third condition around the location of the coding block indicated by the motion vector, thereby obtaining at least one second coding block; and determine the motion vector corresponding to the second coding block whose cost between the current coding block and the motion vector satisfies a fourth condition as at least one second motion vector. At least one first motion vector is the motion vector of the coding block indicated by the at least one motion vector that corresponds to the second coding block satisfying the fourth condition.

[0240] In some embodiments, the processing module 1101 is configured to: calculate the cost between a coding block at at least one preset position in a first region and the current coding block, wherein the preset position includes the vertex position and the center position of the first region; establish the first region centered on the coding block indicated by the motion vector in the reference frame, and update the coding block corresponding to the minimum cost calculated in the first region as the center; if the number of updates in the first region reaches N times or the coding block with the minimum cost between the first region and the current coding block is located at the center position of the first region, then take the coding block with the minimum cost between the first region and the current coding block as the second coding block.

[0241] In some embodiments, the communication module 1102 is further configured to send second indication information. The second indication information is used to indicate whether the motion candidate list includes the motion vector of a coding block adjacent to the boundary of the largest coding unit where the current coding block is located.

[0242] For a more detailed description of the processing module 1101 and the communication module 1102, as well as a more detailed description of their respective technical features and beneficial effects, please refer to the corresponding method embodiment section above, which will not be repeated here.

[0243] In the case of implementing the functions of the integrated modules described above in hardware, some embodiments of this disclosure provide another possible structure for the communication device involved in the above embodiments. As shown in FIG12, the communication device 120 includes a processor 1202 and a bus 1204. In some embodiments, the communication device may further include a memory 1201. In some embodiments, the communication device may further include a communication interface 1203.

[0244] Processor 1202 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with some embodiments of this disclosure. Processor 1202 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Processor 1202 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with some embodiments of this disclosure. Processor 1202 may also be a combination of functions implementing computation. For example, processor 1202 may include one or more microprocessor combinations, such as a combination of a digital signal processor (DSP) and a microprocessor.

[0245] The communication interface 1203 is used to connect to other devices via a communication network. This communication network can be Ethernet, a wireless access network, or a wireless local area network (WLAN).

[0246] The memory 1201 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but this disclosure is not limited thereto.

[0247] In some embodiments, the memory 1201 may exist independently of the processor 1202. The memory 1201 may be connected to the processor 1202 via a bus 1204 and may be used to store instructions or program code. When the processor 1202 calls and executes the instructions or program code stored in the memory 1201, it may implement the encoding or decoding methods provided in some embodiments of this disclosure.

[0248] In some embodiments, the memory 1201 may also be integrated with the processor 1202.

[0249] Bus 1204 can be an Extended Industry Standard Architecture (EISA) bus. Bus 1204 can be divided into an address bus, a data bus, and a control bus. For ease of illustration, only one thick line is used to represent it in Figure 12, but this does not mean that there is only one bus or one type of bus.

[0250] This disclosure provides, in some embodiments, a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions. When the computer program instructions are executed on a computer, the computer causes the computer to perform an encoding or decoding method as described in any of the embodiments above.

[0251] For example, the aforementioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., compact disks (CDs) or digital versatile disks (DVDs)), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives). The various computer-readable storage media described in some embodiments of this disclosure may represent one or more devices for storing information and at least one of other machine-readable storage media. The term "machine-readable storage media" may include, but is not limited to: wireless channels and various other media capable of storing, containing, and / or carrying at least one of instructions and data.

[0252] This disclosure provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the encoding or decoding method described in any of the above embodiments.

[0253] The above description is merely a specific implementation of the embodiments of this disclosure, but the protection scope of the embodiments of this disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this disclosure should be covered within the protection scope of the embodiments of this disclosure. Therefore, the protection scope of the embodiments of this disclosure should be determined by the protection scope of the claims.

Claims

1. A decoding method, applied at a decoding end, the method comprising: Receive a bitstream, the bitstream including first indication information, the first indication information being used to indicate at least one first motion vector in the motion candidate list of the current coding block; as well as Based on the at least one first motion vector, at least one second motion vector of the current coding block is determined; wherein the vector difference between each of the at least one first motion vectors and the corresponding second motion vector among the at least one second motion vectors satisfies a first condition, and the at least one second motion vector is related to the motion vector of the current coding block.

2. The method according to claim 1, wherein, The template cost between the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block and the current coding block satisfies the second condition.

3. The method according to claim 2, wherein, The target coding block is a coding block determined around the position of a first coding block in the reference frame, whose template cost between it and the current coding block satisfies the second condition, and the first coding block is indicated by the first motion vector.

4. The method according to claim 2, wherein, Determining at least one second motion vector of the current coded block based on the at least one first motion vector includes: For any one of the at least one first motion vectors, in the reference frame, around the position of the first coding block indicated by the first motion vector, determine coding blocks whose template cost between them and the current coding block satisfies the second condition, thereby obtaining at least one target coding block; and The motion vector corresponding to the at least one target coding block is determined as the at least one second motion vector.

5. The method according to claim 4, wherein, The step of determining, within the reference frame, around the position of the first coding block indicated by the first motion vector, a coding block whose template cost satisfies the second condition relative to the current coding block includes: Calculate the template cost between the coded block at at least one preset position in the first region and the current coded block; wherein the first region is established centered on the first coded block indicated by the first motion vector in the reference frame, and updated centered on the coded block corresponding to the minimum template cost calculated in the first region; and If the number of updates in the first region reaches N times, or if the coding block with the smallest template cost between the first region and the current coding block is located at the center of the first region, then the coding block with the smallest template cost between the first region and the current coding block is taken as the target coding block.

6. The method according to claim 1, wherein, The bitstream also includes motion vector difference information, and determining at least one second motion vector of the current coding block based on the at least one first motion vector includes: Based on the motion vector difference information and the at least one first motion vector, the at least one second motion vector is determined; wherein, the motion vector difference information is used to indicate the vector difference between each first motion vector and the corresponding second motion vector among the at least one second motion vector.

7. The method according to claim 1, wherein, The order of the preset motion vectors in the motion candidate list is determined based on the template cost between the current coding block indicated by the preset motion vector and the corresponding coding block in the reference frame. The first indication information is index information indicating the position of the at least one first motion vector in the motion candidate list.

8. The method according to claim 1, wherein, The motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit where the current coding block is located.

9. The method according to claim 7, wherein, The preset motion vectors in the motion candidate list are the M motion vectors from the K motion vectors in the initial motion candidate list that indicate the minimum template cost between the current coding block and the corresponding coding block in the reference frame; where K indicates the number of motion vectors in the initial motion candidate list, K and M are both positive integers, and K is greater than or equal to M.

10. The method according to claim 9, wherein, The K motion vectors include motion vectors of at least one preset coding block, wherein the preset coding block is a coding block adjacent to the boundary of the largest coding unit where the current coding block is located.

11. The method according to claim 10, wherein, The at least one preset encoded block includes at least one of the following: The coding blocks outside the maximum coding unit and adjacent to the boundary of the maximum coding unit; and the coding blocks inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.

12. The method according to claim 10, wherein, The boundary of the largest coding unit includes at least one of the following: The left boundary of the largest coding unit; and The upper boundary of the largest coding unit.

13. The method according to claim 10, wherein, The at least one preset coding block satisfies at least one of the following: The motion vector of the at least one preset coding block is different from the motion vectors in the initial motion candidate list other than the motion vector of the at least one preset coding block; and The motion vectors of the at least one preset coding block are different for each motion vector.

14. The method of claim 10, wherein, The at least one preset coding block includes: a coding block selected from coding blocks adjacent to the boundary of the largest coding unit, based on at least one of the positional order of coding blocks in the video frame and a preset interval.

15. The method according to claim 10, wherein, The K motion vectors also include at least one of the following: Temporal candidate motion vectors; Candidate motion vectors in the airspace; and Motion vectors based on history.

16. The method according to claim 1, further comprising: Receive second indication information, which is used to indicate whether the motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit where the current coding block is located.

17. The method according to claim 16, wherein, The second indication information is carried in at least one of the following: the transmission bitstream of the sequence header of the video sequence, the transmission bitstream of the video frame, the transmission bitstream of the video strip, and the transmission bitstream of the video slice.

18. An encoding method applied at an encoding end, the method comprising: Determine at least one first motion vector from the motion candidate list of the current coding block; The vector difference between each of the at least one first motion vectors and the second motion vector of the current coding block satisfies a first condition, and the second motion vector of the current coding block is related to the motion vector of the current coding block; as well as A bitstream is sent to the decoding end, the bitstream including first indication information indicating the at least one first motion vector.

19. The method of claim 18, further comprising: Before determining the at least one first motion vector, at least one second motion vector of the current coded block is determined; Wherein, the cost between the target coding block indicated by each second motion vector of the current coding block in the reference frame corresponding to the current coding block and the current coding block satisfies the second condition.

20. The method according to claim 19, wherein, The target coding block is a coding block determined around the position of a first coding block in the reference frame, whose cost relative to the current coding block satisfies the second condition, and the first coding block is indicated by the first motion vector.

21. The method according to claim 20, wherein, The cost includes at least one of the template cost and the current block cost. The template cost is used to characterize the error between the pixels of the adjacent reconstructed coded blocks of the current coded block and the pixels of the adjacent reconstructed coded blocks of the coded block in the reference frame; The current block cost is used to characterize the error between the pixels of the current coded block and the pixels of the coded block in the reference frame.

22. The method according to claim 19, wherein, Determining at least one second motion vector of the current coded block includes: At least one motion vector is determined from the list of motion candidates; For any of the at least one motion vector, in the reference frame, around the position of the coding block indicated by the motion vector, determine a second coding block whose cost between it and the current coding block satisfies a third condition, thereby obtaining at least one second coding block; and The motion vector corresponding to the second coding block in the at least one second coding block whose cost between it and the current coding block satisfies the fourth condition is determined as the at least one second motion vector; The at least one first motion vector is the motion vector of the coding block indicated by the at least one motion vector, which corresponds to the second coding block that satisfies the fourth condition.

23. The method according to claim 22, wherein, The at least one motion vector includes all or part of the motion vectors in the motion candidate list.

24. The method according to claim 22, wherein, Determining a second coding block in the reference frame, around the position of the coding block indicated by the motion vector, whose cost relative to the current coding block satisfies the third condition, includes: Calculate the cost between a coded block at at least one preset position in a first region and the current coded block; wherein the first region is established centered on the coded block indicated by the motion vector in the reference frame, and updated centered on the coded block corresponding to the minimum cost calculated in the first region; and If the number of updates in the first region reaches N times, or if the coding block with the lowest cost between the first region and the current coding block is located at the center of the first region, then the coding block with the lowest cost between the first region and the current coding block is selected as the second coding block.

25. The method according to claim 18, wherein, The bitstream also includes motion vector difference information, which is used to indicate the vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector.

26. The method according to claim 18, wherein, The order of the preset motion vectors in the motion candidate list is determined based on the template cost between the current coding block indicated by the preset motion vector and the corresponding coding block in the reference frame. The first indication information is index information indicating the position of the at least one first motion vector in the motion candidate list.

27. The method according to claim 18, wherein, The motion candidate list includes motion vectors of coding blocks that are adjacent to the boundary of the largest coding unit where the current coding block is located.

28. The method according to claim 27, wherein, The preset motion vectors in the motion candidate list are the M motion vectors from the K motion vectors in the initial motion candidate list that indicate the minimum template cost between the current coding block and the corresponding coding block in the reference frame; where K indicates the number of motion vectors in the initial motion candidate list, K and M are both positive integers, and K is greater than or equal to M.

29. The method according to claim 28, wherein, The K motion vectors include motion vectors of at least one preset coding block, wherein the preset coding block is a coding block adjacent to the boundary of the largest coding unit where the current coding block is located.

30. The method according to claim 29, wherein, The at least one preset coding block satisfies at least one of the following: The motion vector of the at least one preset coding block is different from the motion vectors in the initial motion candidate list other than the motion vector of the at least one preset coding block; and The motion vectors of the at least one preset coding block are different for each motion vector.

31. The method of claim 18, further comprising: Send a second indication message, which is used to indicate whether the motion candidate list includes the motion vector of a coding block that is adjacent to the boundary of the largest coding unit where the current coding block is located.

32. A communication device, comprising: Memory and processor; The memory and the processor are coupled; The memory is used to store instructions that can be executed by the processor; When the processor executes the instructions, it performs the method according to any one of claims 1-31.

33. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer program instructions that, when executed on a computer, cause the computer to perform the method according to any one of claims 1-31.

34. A computer program product, wherein, The computer program product includes computer program instructions that, when executed by a processor, implement the method according to any one of claims 1-31.