Coding method, communication apparatus, storage medium and program product
By transmitting indication information from the motion candidate list, the decoding end determines the motion vector of the current coded block, solving the problem of insufficient motion vector accuracy and achieving a reduction in data volume and an improvement in transmission efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2024-12-16
- Publication Date
- 2026-06-16
AI Technical Summary
In existing video coding technologies, the accuracy of motion vector determination is insufficient, resulting in large data volume, slow transmission speed, and high storage and transmission costs after encoding.
Instead of directly transmitting the motion vector data of the current coded block, the decoder uses the indication information of the first motion vector in the motion candidate list to determine the second motion vector of the current coded block, ensuring that the vector difference between each first motion vector and the second motion vector meets certain conditions, thereby improving the accuracy of the motion vectors.
It significantly reduces the amount of encoded data, improves the accuracy and efficiency of motion vectors during decoding, and reduces storage and transmission costs.
Smart Images

Figure CN122226977A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] 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
[0003] This disclosure provides an encoding / decoding method, communication device, storage medium, and program product to improve the accuracy of motion vectors used in the encoding / decoding process.
[0004] On the one hand, an encoding method is provided for use at the decoding end, the method comprising:
[0005] 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 coded block;
[0006] Based on 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 first motion vector and the 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.
[0007] On the other hand, a decoding method is provided for application at the encoding end, the method comprising:
[0008] At least one first motion vector is determined from the motion candidate list of the current coding block; the vector difference between each first motion vector 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;
[0009] A bitstream is sent to the decoding end, the bitstream including first indication information indicating at least one first motion vector.
[0010] In another aspect, a communication device is provided for use at a decoding end, comprising: a processing module and a communication module; the communication module is configured to receive 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; the processing module is configured to determine at least one second motion vector of the current coding block based on at least one first motion vector, wherein 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.
[0011] In another aspect, a communication device is provided for use at an encoding end, comprising: a processing module and a communication module, the processing module being configured to determine at least one first motion vector in a motion candidate list of a current encoding block; the vector difference between each first motion vector and a second motion vector of the current encoding block satisfies a first condition, and the second motion vector of the current encoding block is related to the motion vector of the current encoding block; the communication module being configured to send a code stream to a decoding end, the code stream including first indication information indicating at least one first motion vector.
[0012] In another aspect, a communication device is provided, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store a computer program; and the processor, when executing the computer program, implements the information processing method of any of the above embodiments.
[0013] In another aspect, a computer-readable storage medium is provided, on which computer program instructions are stored, which, when executed by a processor, implement the information processing method of any of the above embodiments.
[0014] In another aspect, a computer program product is provided, which includes computer program instructions that, when executed by a processor, implement the information processing method of any of the above embodiments.
[0015] This disclosure provides an encoding method in which a decoding end receives a bitstream including first indication information. The first indication information indicates at least one first motion vector in a motion candidate list of the current encoding block. Based on the at least one first motion vector, at least one second motion vector of the current encoding block is determined, wherein 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 related to the motion vector of the current encoding block. This significantly reduces the amount of encoded data by transmitting first indication information to indicate at least one first motion vector in the motion candidate list, instead of directly transmitting the motion vector data of the current encoding block. Furthermore, the vector difference between each first motion vector and a corresponding second motion vector among the at least one second motion vector satisfies the first condition, reducing the excessive deviation between the received at least one first motion vector and the actual motion vector of the current encoding block. This allows the decoding end to more accurately and quickly search for at least one second motion vector around the at least one first motion vector, thereby determining the optimal motion vector of the current encoding block and improving the accuracy of the motion vectors used during decoding. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of adjacent coding blocks of the current coding block provided in an embodiment of the present disclosure;
[0017] Figure 2 A system architecture diagram of an encoding / decoding system provided in this disclosure embodiment;
[0018] Figure 3 A flowchart illustrating a decoding method provided in an embodiment of this disclosure;
[0019] Figure 4 This is a schematic diagram illustrating the matching of a template of a current coded block with a template of a coded block in a reference frame, as provided in an embodiment of this disclosure.
[0020] Figure 5 This is a schematic diagram of a coding block adjacent to the left and the coding block adjacent to the top outside the largest coding unit, provided in an embodiment of this disclosure.
[0021] Figure 6 This is a schematic diagram of the left-adjacent coding block and the top-adjacent coding block within a maximum coding unit, provided in an embodiment of this disclosure.
[0022] Figure 7 A flowchart illustrating yet another decoding method provided in this disclosure embodiment;
[0023] Figure 8 A flowchart illustrating an encoding method provided in an embodiment of this disclosure;
[0024] Figure 9 A flowchart illustrating yet another encoding method provided in this disclosure embodiment;
[0025] Figure 10 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present disclosure;
[0026] Figure 11 This is a schematic diagram of the structure of another communication device provided in an embodiment of the present disclosure;
[0027] Figure 12 This is a schematic diagram of the hardware structure of a communication device provided in an embodiment of the present disclosure. Detailed Implementation
[0028] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, 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 of ordinary skill in the art without creative effort are within the protection scope of the embodiments of this disclosure.
[0029] It should be noted that, in the embodiments disclosed herein, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" 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 "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0030] 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.
[0031] 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.
[0032] Advanced Video Coding Standard (AVS) is a video coding and decoding technology. AVS3 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, the residual information of the current coding block is assumed to be zero; therefore, no residual information is transmitted. The process of predicting the motion vector of the current coding block in Direct mode is similar to Skip mode, but Direct mode calculates and transmits the residual information of the current coding block to further improve the prediction accuracy.
[0033] 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 containing 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.
[0034] 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.
[0035] The above list of motion candidates typically includes the following motion vectors in a fixed candidate order:
[0036] One temporal candidate (or sub-block temporal candidate) (also known as a temporal candidate motion vector).
[0037] The three airspace candidates (also known as airspace candidate motion vectors) are: one bidirectional candidate, one backward candidate, and one forward candidate.
[0038] 0 to 5 motion vector angular prediction candidates (also known as motion vector angular prediction (MVAP)).
[0039] 0 to 8 historical motion candidates (also known as history-based motion vector prediction, HMVP).
[0040] There are 0 to X candidates for repeated filling, where X is a positive integer.
[0041] The maximum number of candidates in the motion candidate list is 12.
[0042] The decoding or encoding end determines the above three spatial domain candidates in the following ways.
[0043] Taking the current coding block as #E as an example, the candidate coding blocks to the left and above #E are: #A, #B, #C, #D, #F, and #G, respectively. The positions of each coding block are as follows: Figure 1 As shown.
[0044] 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 the spatial candidate. Optionally, the motion vector of the first selected candidate coded block is called the spatial bidirectional candidate, the motion vector of the second selected candidate coded block is called the spatial backward candidate, and the motion vector of the third selected candidate coded block is called the spatial forward candidate.
[0045] 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.
[0046] In view of this, embodiments of the present 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 encoding block; determining at least one second motion vector of the current encoding block based on at least one first motion vector, wherein 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 encoding block.
[0047] In this way, firstly, since the transmission of first indication information indicating at least one first motion vector in the motion candidate list is 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 excessive deviation between the received at least one first motion vector and the actual motion vector of the current coded block. This allows 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 for the current coded block and improving the accuracy of the motion vectors used in the decoding process.
[0048] The encoding method provided in this disclosure can be applied to, for example, Figure 2 In the encoding / decoding system 10 shown, such as Figure 2 As shown, the encoding and decoding system 10 includes an encoding end (encoder) 11 and a decoding end (decoder) 12.
[0049] In this process, the encoder 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. Subsequently, the encoder 11 sends a bitstream to the decoder 12 including first indication information indicating at least one first motion vector. The decoder 12 generates a motion candidate list in the same manner as the encoder 11, and upon receiving the bitstream including the first indication information from the encoder 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 this at least one first motion vector.
[0050] 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.
[0051] In some embodiments, the bitstream sent by the encoder 11 to the decoder 12 further includes motion vector difference information to indicate 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 coded block and improving the accuracy and efficiency of motion vector determination by the decoder 12.
[0052] It should be noted that, Figure 2 This is just an example framework diagram. Figure 2 The number of devices included and the names of each device are unlimited, except for... Figure 2 In addition to the devices shown, the encoding and decoding system may also include other devices, such as video playback devices, video servers, etc., and this disclosure does not impose any restrictions on this.
[0053] The application scenarios of the embodiments disclosed herein are not limited. The system architecture and business scenarios described in the 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 the embodiments of this disclosure are also applicable to similar technical problems.
[0054] The decoding method provided in the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0055] Figure 3 The following is a flowchart illustrating a decoding method provided in an embodiment of this disclosure. The method includes the following steps:
[0056] S101. The decoding end receives a bit stream, 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.
[0057] The first motion vector may have other names, such as the basic motion vector or basic motion information, and this disclosure does not limit its use. The motion vector may include the motion speed, direction of motion, displacement, etc., corresponding to the coded block.
[0058] S102. The decoding end determines at least one second motion vector of the current coding block based on at least one first motion vector.
[0059] 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 related to 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 indicates the minimum template cost between the coding block in the reference frame and the current coding block can be used as the motion vector of the current coding block.
[0060] The motion vector of the current coding block may have other names, such as the optimal motion vector of the current coding block, the optimal motion information of the current coding block, etc., 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 ultimately use to generate the prediction block of the current coding block.
[0061] 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). As an example only, 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, with the specific search range determined based on the magnitude of the first threshold.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] In this context, 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.
[0066] For example, such as Figure 4The diagram illustrates the matching of a template for a current coding block and a template for a coding block in a reference frame, according to an embodiment of this disclosure. The adjacent reconstructed coding blocks of the current coding block typically refer to the top and / or left adjacent coding blocks 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 typically refer to the top and / or left adjacent coding blocks 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.
[0067] 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.
[0068] 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.
[0069] For example, 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.
[0070] 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.
[0071] 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.
[0072] 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:
[0073] 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 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.
[0074] 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.
[0075] The preset positions include the vertex positions and the 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.
[0076] 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, quadrilateral, or other shapes, and this disclosure does not limit this.
[0077] In one possible implementation, 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.
[0078] The hexagonal region is updated and established with the coding block corresponding to the minimum template cost calculated in the hexagonal region as the center until the number of times the hexagonal region is updated and established 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 of the hexagonal region. Then, a quadrilateral region is established with the coding block with the minimum template cost between the current coding block and the hexagonal region as the center, and the template cost between the coding block at at least one preset position in the quadrilateral region and the current coding block is calculated.
[0079] The quadrilateral region is updated and established using the coded block corresponding to the minimum template cost calculated in the quadrilateral region 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 the quadrilateral region and the current coded block is the coded block at the center of the quadrilateral region. Then, the coded block with the minimum cost between the quadrilateral region and the current coded block is selected as the target coded block. Here, P is the difference between N and L. For example, a hexagonal region is established 30 times and updated and established L times, while a quadrilateral region is established 1 time and updated and established P times.
[0080] For example, taking template cost calculation as an example, performing template matching search, searching for the coding block with the minimum template cost between the current coding block and the corresponding coding block in the reference frame from the position of the current coding block indicated by the first motion vector, includes the following steps:
[0081] 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.
[0082] 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.
[0083] 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).
[0084] The hexagonal region is updated and established with the coded block in the reference frame corresponding to the calculated minimum template cost as the center. This process continues until the number of times the hexagonal region is updated and established reaches 30 times or the coded block with the minimum cost between the current coded block and the hexagonal region is the coded block at the center of the hexagonal region. Then, a quadrilateral search is used, that is, a quadrilateral region is established with the coded block with the minimum cost between the current coded block and the hexagonal region as the center.
[0085] 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 cost between the coded block and the current coded block in the quadrilateral region as the target coded block.
[0086] It is understandable that the smaller the 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.
[0087] In some embodiments, the bitstream further includes motion vector difference information to determine at least one second motion vector of the current coding 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 improves the accuracy and efficiency of motion vector determination at the decoding end.
[0088] 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.
[0089] The motion vector difference information may include multiple motion vector differences, each motion vector difference corresponding to one or more first motion vectors. One or more second motion vectors can be determined based on a motion vector difference and the one or more first motion vectors corresponding to that motion vector difference.
[0090] 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 enables 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.
[0091] In some embodiments, the first indication information is encoded in the bitstream using variable-length codes.
[0092] 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 this embodiment of the 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.
[0093] 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.
[0094] 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. Here, K indicates the number of motion vectors in the initial motion candidate list, and both K and M are positive integers, with K greater than or equal to M.
[0095] 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.
[0096] 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.
[0097] 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 this disclosure can improve the accuracy of the first motion vector determined during the encoding process.
[0098] In some other cases, the initial motion candidate list may not include the motion vector 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 vector 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 vector of at least one preset coding block. This disclosure does not limit this.
[0099] 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 / or, a coding block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.
[0100] Optionally, the boundary of the largest coding unit (LCU) includes at least one of the following: the left boundary of the LCU; the upper 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 upper 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.
[0101] 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; and / or, the individual motion vectors in the motion vector of at least one preset coding block are different.
[0102] 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 that are identical to motion vectors in the initial motion candidate list other than those in at least one preset coding block; and / or, 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.
[0103] 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 the positional order of coding blocks in the video frame and / or a preset interval. In other words, when the decoding end selects at least one preset coding block from coding blocks adjacent to the boundary of the largest coding unit, it may do so based on the positional order of coding blocks in the video frame and / or a preset interval.
[0104] As an example, the positional order includes bottom-up and left-to-right. The decoder selects a coding block every other coding block in a bottom-up and left-to-right manner and adds the motion vector of the selected coding block to the initial motion candidate list. Optionally, before adding the motion vector of the selected coding block to the initial motion candidate list, the decoder can pre-determine whether the motion vector of the selected coding block meets the conditions (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 conditions are met.
[0105] As a specific implementation, the process of selecting at least one preset coding block from the coding blocks outside 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 also determines the coding blocks adjacent to the left and top of the maximum MCU. Specifically, the coding blocks adjacent to the left and top of the maximum MCU are as follows: Figure 5 As shown. As an example, the size of the largest coding unit is 128×128 pixels; the size of the coding block is 4×4 pixels.
[0107] The decoder selects a coded block from bottom to top and from left to right, skipping every other coded block, and determines the motion vector of the selected coded block. The coded blocks selected by the decoder are as follows: Figure 5 The black-coded block is shown.
[0108] The decoder determines whether the motion vector and / or bi-directional gradient correction (BGC) information of the selected coded block meets the requirements. For example, it checks 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 bi-directional gradient correction information of the coded block meets preset conditions. If it does, the decoder adds the motion vector of the currently selected coded block to the initial motion candidate list.
[0109] As another specific implementation, 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:
[0110] The decoder determines the largest coding unit (MCU) containing the current coding block, and then determines the leftmost and topmost coding blocks within that MCU. Specifically, the leftmost and topmost coding blocks within the MCU are as follows: Figure 6 As shown. As an example, the size of the largest coding unit is 128×128 pixels. The size of the coding block is 4×4 pixels.
[0111] The decoder selects a coded block from bottom to top and from left to right, skipping every other coded block, and determines the motion vector of the selected coded block. The coded blocks selected by the decoder are as follows: Figure 6 The black-coded block is shown.
[0112] The decoder determines whether the motion vector and / or bidirectional gradient correction information of the selected coded block meets the requirements. For example, it checks 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 so, the decoder adds the motion vector of the currently selected coded block to the initial motion candidate list.
[0113] 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 limitations on them.
[0114] It should be noted that the above description 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.
[0115] 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.
[0116] As an example, suppose the initial motion candidate list includes: temporal candidate motion vectors for sub-blocks; spatial candidate motion vectors; motion vectors predicted based on motion vector angles; historical motion vectors; and motion vectors for at least one pre-defined coded block.
[0117] In some implementations, the motion vectors in the initial motion candidate list are arranged in the following order:
[0118] 1. Temporal candidate motion vectors.
[0119] 2. Candidate motion vectors in the airspace.
[0120] 3. Motion vector of at least one preset coding block (spatial expansion candidate).
[0121] 4. Motion vectors based on history.
[0122] In some other implementations, the motion vectors in the initial motion candidate list are arranged in the following order:
[0123] 1. Temporal candidate motion vectors.
[0124] 2. Candidate motion vectors in the airspace.
[0125] 3. Motion vectors based on history.
[0126] 4. Motion vector of at least one preset coding block (spatial expansion candidate).
[0127] Wherein, 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 / or, each motion vector in the motion vector of at least one preset coding block is different.
[0128] 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 some motion vectors whose 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.
[0129] 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, increasing the probability that the motion vector is identified as the optimal motion vector. In other words, in this embodiment, after sorting based on template cost, the index value of the optimal motion vector is typically a smaller value. This results in a smaller index value being sent to the decoding end when indicating the optimal motion vector, and a smaller index value occupies fewer coding bits. Therefore, in this embodiment, 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.
[0130] 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; where K and M are both positive integers, and K is greater than M. As an 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.
[0131] 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.
[0132] 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. For example... Figure 7 As shown, this can be achieved through the following steps.
[0133] S201, The decoding end receives the second instruction information.
[0134] The second indication information 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.
[0135] 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.
[0136] 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.
[0137] Optionally, 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) by the value of the corresponding bit. For example, a value of 1 for the first preset bit indicates that the spatial expansion candidate function is enabled; a value of 0 for the first preset bit indicates that the spatial expansion candidate function is disabled.
[0138] 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.
[0139] In some embodiments, the second indication information is also 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 the value of M can be a fixed value.
[0140] Optionally, 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.
[0141] 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. As an example, the value of N is 10.
[0142] 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.
[0143] In one possible implementation, 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 allows for 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.
[0144] In other words, the granularity of indicating whether to enable the spatial domain expansion candidate function, whether to sort based on the template cost, and the number of spatial domain expansion candidates can be at least one of the following: (1) using the video sequence as the granularity; (2) using the video frame as the granularity; (3) using the video strip as the granularity; (4) using the video slice as the granularity; or (5) using the video fragment as the granularity.
[0145] 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.
[0146] As an example, the format of the sequence header with the "spatial_ext_cands_enable_flag" flag added is shown in Table 1 below:
[0147] Table 1
[0148]
[0149]
[0150] The above explains the process of enabling and disabling related functions through indicator information.
[0151] In this embodiment of the disclosure, the motion candidate list corresponding to each coding block in the maximum coding unit includes the motion vector of the coding block selected from the coding blocks adjacent to the boundary of the maximum coding unit.
[0152] In other words, in this embodiment of the 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.
[0153] 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.
[0154] 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.
[0155] The decoding method in the 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 coded block. The following, in conjunction with... Figure 8 The encoding process will be described in detail. For example... Figure 8 As shown, the encoding method provided in this embodiment includes:
[0156] S301, The encoder determines at least one first motion vector in the motion candidate list of the current coding block.
[0157] 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.
[0158] 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). Here, the vector difference being 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.
[0159] 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.
[0160] 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.
[0161] 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 candidate list can be used as the first motion vector.
[0162] In cases where there are multiple first motion vectors, there will be multiple corresponding second motion vectors.
[0163] In some embodiments, at least one second motion vector of the current coding block is determined before determining at least one first motion vector. 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 a second condition.
[0164] 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.
[0165] 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 lowest cost between it and the current coding block calculated within a preset time period.
[0166] For example, 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.
[0167] The cost includes at least one of template cost or current block cost. Template cost characterizes the error between pixels in adjacent reconstructed coded blocks of the current coded block and pixels in adjacent reconstructed coded blocks of a coded block in the reference frame. Current block cost characterizes the error between pixels in the current coded block and pixels in a coded block of the reference frame.
[0168] 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.
[0169] 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. Wherein, 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.
[0170] 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.
[0171] 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.
[0172] 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, and 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.
[0173] For example, the third condition could be at least one second coding block with the lowest cost relative to the current coding block.
[0174] For example, the third condition could be at least one second coding block with the lowest cost compared to the current coding block, calculated within a preset time period.
[0175] 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 as at least one second motion vector 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 as at least one second motion vector.
[0176] 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.
[0177] 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.
[0178] In some embodiments, at least one motion vector includes all or part of the motion vectors in the motion candidate list.
[0179] 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:
[0180] The cost between the current coding block and at least one preset position in the first region is calculated. The preset positions include the vertex position and the center position of the first region. The first region is established with the coding block indicated by the motion vector in the reference frame as the center, and is updated with the coding block corresponding to the minimum cost calculated in the first region as the center.
[0181] 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.
[0182] The preset positions include the vertex positions and the 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.
[0183] 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, quadrilateral, or other shapes, and this disclosure does not limit this.
[0184] 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 thus determining the first motion vector, this disclosure is not limited to this. The second motion vector can also be determined in other ways, and 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.
[0185] 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.
[0186] 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.
[0187] 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 enables 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.
[0188] 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.
[0189] 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 results in a smaller index value sent by the encoder to the decoder when indicating the optimal motion vector using the motion vector's index, and the smaller index value occupies fewer coding bits. Therefore, in this embodiment of the disclosure, after sorting the motion vectors in the 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.
[0190] 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.
[0191] 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; wherein K indicates the number of motion vectors in the motion candidate list, K and M are both positive integers, and K is greater than or equal to M.
[0192] 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.
[0193] In some embodiments, at least one preset encoding block includes:
[0194] A coded block outside the maximum coding unit and adjacent to the boundary of the maximum coding unit; and / or a coded block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.
[0195] In some embodiments, the boundary of the largest coding unit includes at least one of the following:
[0196] The left boundary of the largest coding unit;
[0197] The upper boundary of the largest coding unit.
[0198] 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; and / or, the individual motion vectors in the motion vector of at least one preset coding block are different.
[0199] 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 the positional order of coding blocks in a video frame and / or a preset interval.
[0200] In some embodiments, the K motion vectors further include at least one of the following:
[0201] Temporal candidate motion vectors;
[0202] Candidate motion vectors in the airspace;
[0203] Motion vectors based on history.
[0204] 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.
[0205] 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 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. Figure 9 As shown, the process by which the encoder can instruct the decoder whether the spatial expansion candidate function is enabled in the motion candidate list can be implemented through the following steps.
[0206] S401, The encoding end generates the second indication information.
[0207] 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.
[0208] Optionally, the second indication information can indicate whether the spatial expansion candidate function is enabled by the value of a corresponding bit. For example, a value of 1 for the first preset bit indicates that the spatial expansion candidate function is enabled; a value of 0 for the first preset bit indicates that the spatial expansion candidate function is disabled.
[0209] S402, The encoding end sends the second instruction information to the decoding end.
[0210] 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, and / or 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 on these aspects.
[0211] 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.
[0212] 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.
[0213] 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.
[0214] The above scenarios and methods can be combined, and this disclosure does not limit them.
[0215] It is understood that, in order to achieve the above-mentioned functions, the communication device includes hardware structures and / or 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 a hardware-driven or software-driven manner 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 the embodiments of this disclosure.
[0216] This disclosure embodiment can divide the communication device into functional modules according to the above method embodiment. 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 this disclosure embodiment 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.
[0217] Figure 10 This is a schematic diagram of the structure of a communication device provided in an embodiment of this disclosure. Figure 1 The communication device can execute the decoding method provided in the above method embodiments, and can be applied to the decoding end. For example... Figure 10 As shown, the communication device includes a communication module 1001 and a processing module 1002.
[0218] Communication module 1001 is used to receive a code stream, the code stream 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;
[0219] The 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, wherein the vector difference between each first motion vector and the 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.
[0220] 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.
[0221] 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.
[0222] The processing module 1002 is specifically used for: 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 the second condition, and 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.
[0223] In some embodiments, the processing module 1002 is specifically 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; wherein the first region is established with the first coding block indicated by the first motion vector in the reference frame as the center, and is updated with the coding block corresponding to the minimum template 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 template cost between the first region and the current coding block is located at the center position of the first region, the coding block with the minimum template cost between the first region and the current coding block is taken as the target coding block.
[0224] 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. 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.
[0225] 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.
[0226] 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.
[0227] 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; wherein 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.
[0228] 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.
[0229] 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 / or, a coding block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.
[0230] 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; the upper boundary of the maximum coding unit.
[0231] 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; and / or, the individual motion vectors in the motion vector of at least one preset coding block are different.
[0232] 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 the positional order of coding blocks in a video frame and / or a preset interval.
[0233] In some embodiments, the K motion vectors further include at least one of the following:
[0234] Temporal candidate motion vectors;
[0235] Candidate motion vectors in the airspace;
[0236] Motion vectors based on history.
[0237] In some embodiments, a second indication information is received, 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.
[0238] 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.
[0239] 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.
[0240] Figure 11 This is a schematic diagram of the structure of a communication device provided in an embodiment of this disclosure. Figure 2 The communication device can execute the encoding method provided in the above-described method embodiments, and can be applied to the encoding end. For example... Figure 11 As shown, the communication device includes a processing module 1101 and a communication module 1102.
[0241] 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 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;
[0242] The communication module 1102 is used to send a code stream to the decoding end, the code stream including first indication information indicating at least one first motion vector.
[0243] In some embodiments, the 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, 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 a second condition.
[0244] 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.
[0245] In some embodiments, the processing module 1101 is specifically 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, 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, thereby obtaining at least one second coding block; determine 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; wherein 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 that satisfies the fourth condition.
[0246] In some embodiments, the processing module 1101 is specifically used 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; wherein the first region is established with the coding block indicated by the motion vector in the reference frame as the center, and is updated with the coding block corresponding to the minimum 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 cost between the first region and the current coding block is located at the center position of the first region, the coding block with the minimum cost between the first region and the current coding block is taken as the second coding block.
[0247] In some embodiments, the communication module 1102 is further configured to send second indication information, the second indication information being 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.
[0248] 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.
[0249] In implementing the functionality of the integrated modules described above using hardware, this disclosure provides another possible structure for the communication device involved in the above embodiments. For example... Figure 12 As shown, the communication device 120 includes a processor 1202 and a bus 1204. Optionally, the communication device may also include a memory 1201; alternatively, the communication device may also include a communication interface 1203.
[0250] Processor 1202 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with 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. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 1202 may also be a combination of functions implementing computational capabilities, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0251] The communication interface 1203 is used to connect with other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0252] 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 is not limited thereto.
[0253] As one possible implementation, the memory 1201 can exist independently of the processor 1202. The memory 1201 can be connected to the processor 1202 via a bus 1204 and is 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 can implement the encoding or decoding method provided in the embodiments of this disclosure.
[0254] In another possible implementation, the memory 1201 can also be integrated with the processor 1202.
[0255] Bus 1204 can be an extended industry standard architecture (EISA) bus, etc. Bus 1204 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0256] Some embodiments of this disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions that, when executed on a computer, cause the computer to perform an encoding or decoding method as described in any of the embodiments above.
[0257] For example, the computer-readable storage media described above 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), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in this disclosure can represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0258] This disclosure provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the encoding or decoding method described in any of the above embodiments.
[0259] 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, characterized in that, Applied to the decoding end, the method includes: 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; 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 first motion vector and the 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.
2. The method according to claim 1, characterized in that, 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, characterized in that, 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, characterized in that, 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, a coding block whose template cost between it and the current coding block satisfies the second condition is determined, and at least one target coding block is obtained; 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, characterized in that, 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 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; 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, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, The at least one preset coding block includes: The coding block outside the maximum coding unit and adjacent to the boundary of the maximum coding unit; and / or, the coding block inside the maximum coding unit and adjacent to the boundary of the maximum coding unit.
12. The method according to claim 10, characterized in that, The boundary of the largest coding unit includes at least one of the following: The left boundary of the largest coding unit; The upper boundary of the largest coding unit.
13. The method according to claim 10, characterized in that, 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 / or, the motion vectors in the motion vectors of the at least one preset coding block are different.
14. The method according to claim 10, characterized in that, 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 the positional order of coding blocks in the video frame and / or a preset interval.
15. The method according to claim 10, characterized in that, The K motion vectors also include at least one of the following: Temporal candidate motion vectors; Candidate motion vectors in the airspace; Motion vectors based on history.
16. The method according to claim 1, characterized in that, The method further includes: 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, characterized in that, 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, characterized in that, Applied to the encoding end, the method includes: At least one first motion vector is determined in the motion candidate list of the current coding block; the vector difference between each first motion vector 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; 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 according to claim 18, characterized in that, The method further includes: Before determining the at least one first motion vector, at least one second motion vector of the current coded block is determined. 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, characterized in that, 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 a first motion vector.
21. The method according to claim 20, characterized in that, The cost includes at least one of the template cost or 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, characterized in that, 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 vectors, in the 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 the third condition is determined, thus obtaining at least one second coding block; 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, characterized in that, 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, characterized in that, Determining a second coded block in the reference frame, around the position of the coded block indicated by the motion vector, whose cost satisfies the third condition with respect to the current coded block, 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 is updated centered on the coded block corresponding to the minimum cost calculated in the first region. 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, characterized in that, The bitstream also includes motion vector difference information, which indicates the vector difference between each of the first motion vectors and the corresponding second motion vector among the at least one second motion vector.
26. The method according to claim 18, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, 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 / or, the motion vectors in the motion vectors of the at least one preset coding block are different.
31. The method according to claim 18, characterized in that, The method further includes: 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, characterized in that, include: Memory and processor; Memory and 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 as described in any one of claims 1-31.
33. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-31.
34. A computer program product, characterized in that, The computer program product includes computing technology program instructions that, when executed by a processor, implement the method as described in any one of claims 1-31.