Method for acquiring motion vector, video bitstream processing method, and device

By introducing a block vector-guided chain motion vector construction method in video encoding and decoding, the problem of insufficient motion vector prediction candidates is solved, and the accuracy of motion estimation is improved.

WO2026007407A1PCT designated stage Publication Date: 2026-01-08ZTE CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/076667
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-04
Filing Date
2025-02-10
Publication Date
2026-01-08

AI Technical Summary

Technical Problem

In existing video encoding and decoding technologies, the richness of motion vector prediction candidates is insufficient, resulting in low accuracy of motion estimation.

Method used

By deriving an initial block vector from the motion information candidate set and constructing a chain of motion vectors based on the block vector, the richness of motion vector prediction candidates is improved.

Benefits of technology

This increases the number of motion vector prediction candidates and the search space, thereby improving the accuracy of motion estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025076667_08012026_PF_FP_ABST
    Figure CN2025076667_08012026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of video encoding and decoding. Provided are a method for acquiring a motion vector, a video bitstream processing method, and a device. The method for acquiring a motion vector comprises: deriving an initial block vector from a motion information candidate set; and on the basis of the initial block vector, performing chain motion vector construction, so as to obtain chain motion vectors guided by block vectors.
Need to check novelty before this filing date? Find Prior Art

Description

Method for obtaining motion vector, video stream processing method and device

[0001] Cross-reference to related applications

[0002] This application is based on and claims priority to Chinese Patent Application No. 202410898428.6, filed on July 4, 2024, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] Embodiments of the present application relate to the field of video coding technology, and in particular to a method for obtaining a motion vector, a video stream processing method, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND

[0004] In video coding, the motion vector prediction (MVP) technique is widely used. MVP uses the motion vector information of adjacent blocks in space and time to predict the motion vector of the current block, thereby reducing the amount of motion vector data that needs to be transmitted in the encoding process. An important goal of MVP is to add more motion vector prediction candidates to expand the search space of the motion vector and improve the accuracy of motion estimation. SUMMARY

[0005] Embodiments of the present application provide a method for obtaining a motion vector, a video stream processing method, an electronic device, a computer readable storage medium and a computer program product, aiming to improve the richness of motion vector prediction candidates.

[0006] In a first aspect, embodiments of the present application provide a method for obtaining a motion vector, the method comprising:

[0007] deriving an initial block vector from a motion information candidate set;

[0008] performing chain motion vector construction based on the initial block vector to obtain a chain motion vector guided by the block vector.

[0009] In a second aspect, embodiments of the present application provide a video stream processing method applied to an encoding end, the method comprising:

[0010] setting a preset flag in an encoding parameter to an open value, the open value indicating that a motion vector prediction candidate set of a video block is constructed according to a chain motion vector guided by a block vector;

[0011] writing the encoding parameter into a video stream;

[0012] The block vector guided chain motion vector is obtained by: deriving an initial block vector from a motion information candidate set; and performing chain motion vector construction based on the initial block vector to obtain the block vector guided chain motion vector.

[0013] In a third aspect, an embodiment of the present application provides a video bitstream processing method, applied to a decoding end, and the method comprises the following steps:

[0014] receiving a video bitstream, and obtaining an encoding parameter from the video bitstream;

[0015] when a preset flag bit in the encoding parameter is an open value, constructing a motion vector prediction candidate set of a video block based on a block vector guided chain motion vector;

[0016] The block vector guided chain motion vector is obtained by: deriving an initial block vector from a motion information candidate set; and performing chain motion vector construction based on the initial block vector to obtain the block vector guided chain motion vector.

[0017] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; at least one memory configured to store at least one program; and when the at least one program is executed by the at least one processor, the at least one processor is configured to implement the method for obtaining a motion vector prediction candidate according to the first aspect, or the video bitstream processing method according to the second aspect, or the video bitstream processing method according to the third aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and when the program is executed by a processor, the processor is configured to implement the method for obtaining a motion vector prediction candidate according to the first aspect, or the video bitstream processing method according to the second aspect, or the video bitstream processing method according to the third aspect.

[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, and when the computer program is executed by a processor, the processor is configured to implement the method for obtaining a motion vector prediction candidate according to the first aspect, or the video bitstream processing method according to the second aspect, or the video bitstream processing method according to the third aspect.

[0020] In the embodiment of the present application, a block vector associated with a current block is used as an initial guide vector, and a chain motion vector guided by the initial guide vector can be used as a motion vector prediction candidate, so that the richness of the motion vector prediction candidate is improved. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings are used to provide further understanding of the technical solutions of the present application, and constitute a part of the specification, and are used to explain the technical solutions of the present application together with the embodiments of the present application, and do not constitute a limitation to the technical solutions of the present application.

[0022] Fig. 1 is a schematic diagram of a video encoding framework provided by an embodiment of the present application;

[0023] Fig. 2 is a schematic diagram of a video decoding framework provided by an embodiment of the present application;

[0024] Fig. 3 is a schematic diagram of the position of a spatial neighboring block provided by an embodiment of the present application;

[0025] Fig. 4 is a schematic diagram of the position of a temporal collocated block provided by an embodiment of the present application;

[0026] Fig. 5 is a schematic diagram of the position of a spatial non-neighboring block provided by an embodiment of the present application;

[0027] Fig. 6 is a schematic diagram of derivation of chain motion vector based on motion vector guiding provided by an embodiment of the present application;

[0028] Fig. 7 is a schematic diagram of a method for obtaining a motion vector provided by an embodiment of the present application;

[0029] Fig. 8 is a schematic diagram of a sub-step of step S200 in Fig. 7;

[0030] Fig. 9 is a schematic diagram of an optional step of step S210 in Fig. 8;

[0031] Fig. 10 is a schematic diagram of another optional step of step S210 in Fig. 8;

[0032] Fig. 11 is a schematic diagram of still another optional step of step S210 in Fig. 8;

[0033] Fig. 12 is a schematic diagram of an optional step of step S250 in Fig. 8;

[0034] Fig. 13 is a schematic diagram of another optional step of step S250 in Fig. 8;

[0035] Fig. 14 is a schematic diagram of derivation of chain motion vector based on block vector guiding provided by an embodiment of the present application;

[0036] Fig. 15 is a schematic diagram of derivation of determining a target position provided by an embodiment of the present application;

[0037] Fig. 16 is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0039] It should be understood that, in the description of the embodiments of the present application, if "first", "second" and the like are described, it is only for the purpose of distinguishing technical features, and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or the order of the indicated technical features. "At least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. Wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" and the like means any group of these items, including single item or any group of multiple items. For example, at least one of a, b and c can mean a, b, c, a and b, a and c, b and c, or a and b and c, wherein a, b and c can be single or multiple.

[0040] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as there is no conflict.

[0041] In order to facilitate the description of the embodiments of the present application, the concepts related to the embodiments of the present application are introduced as follows.

[0042] Motion vector: is a displacement vector describing the displacement of a block from the current position to the position of the reference frame.

[0043] Block vector: is a displacement vector describing the displacement of a block in a frame from the current position to the position of the reference block. It is worth noting that the main difference between block vector and motion vector is that block vector describes the displacement of a block within a frame, and motion vector describes the displacement of a block between frames. Both block vector and motion vector can be used to predict the motion of an object.

[0044] Rate distortion cost (RDCost): is a method for measuring code rate and distortion in video encoding. Rate distortion cost indicates the minimum distortion loss achieved under a given code rate.

[0045] Original image: the original encoded image input into the encoder.

[0046] Reconstructed image: in the process of video decoding, an image as close as possible to the original image is reconstructed according to the encoded data.

[0047] Video encoding framework: As shown in FIG. 1, it is a video encoding framework, and the overall framework process of the encoding end is as follows:

[0048] (1) The input video is first divided into blocks for frames;

[0049] (2) The divided blocks are sent to the intra / inter prediction module for prediction encoding. The intra prediction module is mainly used to remove the spatial correlation of the image; the inter prediction module is mainly used to remove the temporal correlation of the image;

[0050] (3) The obtained prediction value is subtracted from the original block to obtain a residual value, and then the residual is transformed and quantized to remove the frequency domain correlation and compress the data lossily.

[0051] (4) All the encoding parameters and residuals are entropy encoded to form a binary stream for storage or transmission, and the output data of the entropy encoding module is the code stream after the original video is compressed.

[0052] (5) The prediction value and the residual after inverse quantization and inverse transformation are added to obtain a block reconstruction value, and finally a reconstructed image is formed.

[0053] (6) The reconstructed image is filtered by a loop filter and stored in an image buffer as a reference image for later use.

[0054] Video decoding framework: As shown in FIG. 2, it is a video decoding framework, and the overall framework process of the decoding end is as follows:

[0055] (1) Analyze the code stream to obtain the prediction mode and obtain the prediction value;

[0056] (2) Dequantize and inverse transform the residual obtained by analyzing the code stream;

[0057] (3) The prediction value and the residual after inverse quantization and inverse transformation are added to obtain a block reconstruction value, and finally a reconstructed image is formed.

[0058] (4) The reconstructed image is filtered by a loop filter and stored in an image buffer as a reference image for later use.

[0059] It should be noted that the "video frame", "video image", "image", "frame" or "image frame" described in the embodiments of the present application belong to the same concept. The "video block", "image block" or "block" described in the embodiments of the present application belong to the same concept.

[0060] Motion information candidate set construction:

[0061] In the motion information candidate set construction process of merge mode, inter mode and the like, the motion information candidates are added to the motion information candidate set in the following order: spatial neighboring block, temporal collocated block, spatial non-adjacent block, history-based motion information candidate, chain motion vector prediction candidate, pair-wise average candidate, and default candidate.

[0062] Motion information candidate based on spatial neighboring block:

[0063] As shown in FIG. 3, the motion information of the left and upper video blocks of the current video block is used as the spatial neighboring candidate. Among them, B1 represents the rightmost video block directly above the current video block, A1 represents the lower right video block directly left of the current video block, B0 and A0 represent the closest video blocks to the right upper and left lower of the current video block, respectively. B2 represents the closest video block to the upper left of the current video block. In the order of B1->A1->B0->A0->B2, at most 4 spatial neighboring motion information candidates are selected.

[0064] Motion information candidate based on temporal collocated block:

[0065] The temporal motion information candidate is determined by using the video block at the corresponding position of the current video block in the time domain adjacent coded image (collocated video block). The time domain adjacent coded image is specified by the syntax element of the slice header information, called collocated image. As shown in FIG. 4, if the video block at the C0 position of the image is unavailable, or there is no motion information at the position, the video block at the C1 position is used as the collocated video block. The motion information from the temporal collocated block needs to be scaled accordingly by analyzing the positional relationship with the reference image.

[0066] Motion information candidate based on spatial non-adjacent block:

[0067] The motion information of the coded video block in the image where the current video block is not adjacent to the current video block is used as the candidate. The selection mode of the non-adjacent video block is shown in FIG. 5, starting from the number 6, the non-adjacent video blocks are traversed in order, and the corresponding available motion information is added to the motion candidate information set of the current block. Among them, the distance between the non-adjacent video block and the current video block is based on the width and height of the current video block.

[0068] Chain motion vector prediction candidate based on motion vector guidance:

[0069] The chain motion vector prediction candidate is derived by recursively tracing the motion vectors and the block vectors based on the pre-derived motion vectors. As shown in FIG. 6, MVL0k(0) belongs to the pre-derived motion vectors, MVL0k(0) points to a certain position in the reference picture RefPicL0k(0), and there is a motion vector or a block vector at the position. In the example of FIG. 6, there is a block vector BVk(0), and BVk(0) points to the next position where there is a motion vector or a block vector. In the example of FIG. 6, there is a motion vector MVL0k(1). By repeating the above process, a series of connected motion information can be obtained, and a chain motion vector prediction candidate is derived by accumulating the series of connected motion information, as shown in the following formula, where k and m respectively represent the index of the pre-derived motion vector in the candidate set and the depth of the recursive tracing. MVL0 k / m = MVL0 k(0) + BV k(0) + MVL0 k(1) + MVL0 k(2) + … + MVL0 k(m) ; RefPicL0 k / m = RefPicL0 k(m) .

[0070] The pre-derived motion vectors can be derived from the motion information that has been previously added to the motion information candidate set of the current video block.

[0071] In the process of constructing the motion information candidate set of the video block, the motion information candidates mainly come from the spatial neighboring blocks, the temporal collocated blocks, the spatial non-adjacent blocks, the history-based motion information candidates, the chain motion vector prediction candidates, the pair-wise average candidates, the default candidates, and the like. The chain motion vector prediction candidate is mainly obtained by adding the motion vector of the region pointed by the guide motion vector to the guide motion vector, which is an existing motion vector in the motion information candidate set, to obtain a new chain motion vector, and adding the chain motion vector to the motion information candidate set of the video block as a new motion information candidate. The chain motion vector can be continuously grown through iteration. Specifically, the obtained chain motion vector is taken as the guide motion vector, and the similar steps are performed again to obtain a new chain motion vector, and the process can be repeated iteratively. The block vector information can also be added to the iterative process as the process motion vector of the chain motion vector. However, in the process of constructing the chain motion vector prediction candidate, the initial guide motion vector only considers the existing motion vectors in the motion information candidate set, and does not consider the block vector information associated with the video block as the initial guide motion vector.

[0072] An important goal of MVP is to add more MVP candidates to expand the search space of motion vector and improve the accuracy of motion estimation. Based on this, the embodiments of the present application provide a method for obtaining a motion vector, which guides a chain motion vector based on a block vector, aiming to improve the richness of MVP candidates.

[0073] The method for obtaining a motion vector provided by the embodiments of the present application can be applied to an encoder-side device, and can also be applied to a decoder-side device.

[0074] Please refer to FIG. 7, which is a schematic diagram of a method for obtaining a motion vector provided by the embodiments of the present application. As shown in FIG. 7, the method includes the following steps S100 and S200.

[0075] S100, derive an initial block vector from a motion information candidate set.

[0076] It should be understood that the motion information candidate set includes a plurality of motion information candidates, and the plurality of motion information candidates include at least one type of block vector.

[0077] Specifically, the motion information candidate set can include one or more of the following block vectors: a block vector based on a spatial neighboring block, a block vector based on a temporal collocated block, a block vector based on a spatial non-neighboring block, a history-based block vector prediction set, a default block vector, and a pair-wise average block vector.

[0078] For example, various types of block vectors are arranged in the motion information candidate set in the following type order: a block vector based on a spatial neighboring block, a block vector based on a temporal collocated block, a block vector based on a spatial non-neighboring block, a history-based block vector prediction set, a default block vector, and a pair-wise average block vector.

[0079] For example, deriving an initial block vector from a motion information candidate set can be achieved in the following ways.

[0080] Method 1:

[0081] Iterate through the motion information candidates in the motion information candidate set in turn, and derive the first valid block vector in the iteration as the initial block vector.

[0082] It should be understood that the motion information candidates in the motion information candidate set are iterated according to the type order in the set, i.e., according to the order of the motion information candidate based on a spatial neighboring block, the motion information candidate based on a temporal collocated block, the motion information candidate based on a spatial non-neighboring block, the history-based motion information candidate, the default motion information candidate, and the pair-wise average motion information candidate.

[0083] It should be noted that the above valid block vector should satisfy at least one of the following conditions:

[0084] (1) The region pointed by the block vector is a valid reference region, wherein the valid reference region comprises a reconstructed region of the current picture;

[0085] (2) The region pointed by the block vector exists a block vector or a motion vector.

[0086] In a possible example, the block vectors in the motion information candidate set are traversed, if the current traversed block vector is a block vector based on a spatial neighboring block, and the region pointed by the block vector belongs to a reconstructed region of the current picture, and the video block in the region pointed by the block vector exists a block vector or a motion vector, the current traversed block vector can be derived as the initial block vector.

[0087] In a possible example, if the current traversed block vector is a block vector based on a spatial neighboring block, however, the region pointed by the block vector is not a valid reference region, or the video block in the region pointed by the block vector does not exist a block vector or a motion vector, the current traversed block vector is not a valid block vector, and thus cannot be derived as the initial block vector, and the next block vector is continued to be traversed until a valid block vector is traversed.

[0088] Method two:

[0089] The motion information candidates in the motion information candidate set are traversed in sequence, and the block vector with the minimum template cost is selected from the multiple valid block vectors to derive as the initial block vector.

[0090] It should be understood that the motion information candidates in the motion information candidate set are traversed according to the type order in the set, that is, the order of the motion information candidate based on a spatial neighboring block, the motion information candidate based on a temporal co-located block, the motion information candidate based on a spatial non-neighboring block, the motion information candidate based on history, the default motion information candidate and the pair-wise average motion information candidate.

[0091] In a possible example, the block vectors in the motion information candidate set are traversed, and whether the current traversed block vector is a valid block vector is determined, if yes, it is taken as a candidate initial block vector, otherwise it is filtered; the template cost of all the candidate initial block vectors finally screened is calculated, and the block vector with the minimum template cost is selected and derived as the initial block vector.

[0092] It should be noted that the template cost described in the embodiments of the present application represents the sum of absolute differences (SAD), the sum of squared differences (SSD) or the hadamard transform parameter (SATD) of the template of the reference block pointed by the block vector and the template of the current block.

[0093] Method three:

[0094] The plurality of initial block vectors are derived from at least one of a block vector based on a spatial neighboring block, a block vector based on a temporal co-located block, a block vector based on a spatial non-neighboring block, a history-based block vector prediction set, a default block vector, and a pair-wise average block vector.

[0095] Specifically, a plurality of initial block vectors can be first selected from the motion information candidate set according to a preset condition, and then for each initial block vector, a corresponding chain motion vector is constructed based on the initial block vector.

[0096] For example, all the valid block vectors in the motion information candidate set are derived as initial block vectors. Alternatively, M (M is greater than 1) valid block vectors with the smallest template cost in the motion information candidate set are derived as initial block vectors.

[0097] S200, chain motion vector construction is performed based on the initial block vector to obtain a chain motion vector guided by the block vector.

[0098] In the embodiments of the present application, after the initial block vector is derived, chain motion vector construction is then performed based on the initial block vector to obtain a chain motion vector guided by the block vector. In this way, the block vector associated with the current block is used as an initial guide vector, and the chain motion vector guided thereby can be used as a motion vector prediction candidate, thereby improving the richness of the motion vector prediction candidate.

[0099] For step S200, as shown in FIG. 8, it can specifically include:

[0100] S210, a preset position of the current block is taken as a starting point to determine a current target block pointed to by the initial block vector.

[0101] S220, it is judged whether the current target block has a target vector, if yes, step S230 is executed, otherwise the current S200 related process is ended. The target vector includes a block vector or a motion vector.

[0102] S230, in the case where the current target block has a target vector, the initial block vector is taken as a current chain motion vector.

[0103] S240, the following vector accumulation processing is performed: the target vector on the current target block is accumulated to the current chain motion vector to obtain an updated chain motion vector.

[0104] S250, a preset position of the current target block is taken as a starting point to determine a next target block pointed to by the target vector on the current target block.

[0105] S260, it is judged whether a vector accumulation processing end condition is met, if not, step S270 is jumped to, if yes, step S280 is jumped to.

[0106] S270, in the case where the vector accumulation processing end condition is not met, replacing the current target block with a next target block, replacing the current chain motion vector with the updated chain motion vector, and continuing to perform the vector accumulation processing.

[0107] S280, in the case where the vector accumulation processing end condition is met, taking the updated chain motion vector as the chain motion vector based on block vector guidance.

[0108] The vector accumulation processing end condition can include at least one of the following:

[0109] (1) The depth of vector accumulation reaches a preset value.

[0110] Specifically, the depth of vector accumulation can be preset to be at most n (n is greater than 1), and when the updated chain motion vector obtained after the vector accumulation processing of step S240 is performed corresponds to a depth of vector accumulation that has reached n, it can be considered that the depth of vector accumulation reaches the preset value, the vector accumulation processing end condition is met, and the current S200 related process is ended.

[0111] (2) The next target block does not have a target vector.

[0112] Specifically, when the next target block does not have a motion vector or a block vector, it can be considered that the vector accumulation processing end condition is met, and the current S200 related process is ended.

[0113] (3) The region where the next target block is located is not a valid reference region of the image.

[0114] Specifically, when the region where the next target block is located is not a valid reference region of the image, i.e., the region where the next target block is located is not a reconstructed region of the image, it can be considered that the vector accumulation processing end condition is met, and the current S200 related process is ended.

[0115] (4) The image where the next target block is located is not a reference image of the current image.

[0116] Specifically, when the image where the next target block is located is not an image in the reference image set of the current image, it can be considered that the vector accumulation processing end condition is met, and the current S200 related process is ended. For example, when the current image is a P frame (forward prediction frame), its reference images include a previous I frame (intra prediction frame) and all P frames between the current frame and the previous I frame. If the image where the next target block is located is not the previous I frame and is not a P frame between the current frame and the previous I frame, it can be considered that the image where the next target block is located is not a reference image of the current image.

[0117] For step S210, the preset positions of the current block can include at least one of a center position of the current block, a top-left position of the current block, a top-right position of the current block, a bottom-left position of the current block, and a bottom-right position of the current block.

[0118] In a possible example, when there are multiple preset positions, step S210 can specifically include: traversing each preset position of the current block in a preset order, taking the currently traversed preset position as a starting point, determining a candidate current target block pointed to by the initial block vector; in a case where the candidate current target block has a block vector or a motion vector, taking the candidate current target block as the current target block, and ending the traversal.

[0119] Specifically, determining the current target block can include the following steps as shown in FIG. 9.

[0120] S2111, traversing a first preset position of the current block in a preset order;

[0121] The preset order can be the center position, the top-left position, the top-right position, the bottom-left position, and the bottom-right position.

[0122] S2112, taking the currently traversed preset position as a starting point, determining a candidate current target block pointed to by the initial block vector;

[0123] S2113, determining whether the candidate current target block has a block vector or a motion vector, if yes, jumping to step S2114, and if no, jumping to step S2115;

[0124] S2114, taking the candidate current target block as the current target block, and ending the traversal;

[0125] S2115, determining whether the traversal of all preset positions is completed, if yes, ending the traversal, and if no, jumping to step S2116;

[0126] S2116, continuing to traverse a next preset position of the current block, and returning to step S2112.

[0127] In the example shown in FIG. 9, the preset positions of the current block are traversed in order, the currently traversed preset position is taken as a starting point of the initial block vector, a block pointed to by the initial block vector is obtained, if the pointed-to block has a block vector or a motion vector, the block is determined as the current target block, otherwise, the next preset position is continuously traversed until the current target block is found.

[0128] In a possible example, when there are multiple preset positions, step S210 can specifically include: traversing each preset position of the current block, taking the currently traversed preset position as a starting point, determining a candidate current target block pointed to by the initial block vector, in a case where the candidate current target block has a block vector or a motion vector, taking the block vector or the motion vector on the candidate current target block as a candidate vector; after the traversal ends, selecting a candidate vector with a minimum template cost from all candidate vectors, and taking a candidate current target block corresponding to the selected candidate vector as the current target block.

[0129] Specifically, the determination of the current target block can include the following steps as shown in FIG. 10.

[0130] S2121, traversing a first preset position of the current block according to a preset order;

[0131] The preset order can be a center position, an upper-left position, an upper-right position, a lower-left position, and a lower-right position.

[0132] S2122, taking the currently traversed preset position as a starting point, determining a candidate current target block pointed to by the initial block vector.

[0133] S2123, judging whether the candidate current target block has a block vector or a motion vector, if yes, proceeding to step S2124, and if no, proceeding to step S2125.

[0134] S2124, taking the block vector or the motion vector on the candidate current target block as a candidate vector, adding the candidate vector to a candidate vector set, and proceeding to step S2125.

[0135] S2125, judging whether the traversal of all preset positions is completed, if yes, proceeding to step S2127, and if no, proceeding to step S2126.

[0136] S2126, continuing to traverse a next preset position of the current block, and returning to step S2122.

[0137] S2127, obtaining the candidate vector set, selecting a candidate vector with a minimum template cost from all candidate vectors, and taking a candidate current target block corresponding to the selected candidate vector as the current target block.

[0138] In the example shown in FIG. 10, preset positions of the current block are traversed in sequence, and a block pointed to by an initial block vector is obtained with the current traversed preset position as a starting point of the initial block vector. If the pointed block has a block vector or a motion vector, the pointed block is taken as a candidate current target block, and a block vector or a motion vector on the candidate current target block is taken as a candidate vector and added to a candidate vector set. Then the next preset position is continuously traversed to find the next candidate current target block. When the traversal ends, a candidate vector with the smallest template cost is selected from the candidate vector set, and a candidate current target block where the selected candidate vector is located is taken as the current target block.

[0139] In a possible example, when there are multiple preset positions, step S210 can specifically include: traversing each preset position of the current block, and determining a current target block pointed to by an initial block vector with the current traversed preset position as the starting point; and obtaining one or more current target blocks after the traversal ends.

[0140] Specifically, the determination of the current target block can include the following steps as shown in FIG. 11.

[0141] S2131, traversing a first preset position of the current block in a preset sequence;

[0142] The preset sequence can be a center position, a top-left position, a top-right position, a bottom-left position, or a bottom-right position.

[0143] S2132, taking a block pointed to by an initial block vector as a current target block with the current traversed preset position as a starting point;

[0144] S2133, determining whether the traversal of all preset positions is completed, and if yes, ending the traversal; or if no, jumping to step S2134;

[0145] S2134, continuously traversing a next preset position of the current block, and returning to step S2132.

[0146] In the example shown in FIG. 11, preset positions of the current block are traversed in sequence, and a block pointed to by an initial block vector is obtained with the current traversed preset position as a starting point of the initial block vector. If the pointed block has a block vector or a motion vector, the pointed block is taken as a current target block, and the next preset position is continuously traversed. After the traversal ends, one or more current target blocks can be obtained.

[0147] It should be understood that when there are multiple current target blocks, the vector accumulation processing can be respectively performed for each current target block, and finally multiple chain motion vectors can be obtained, each chain motion vector corresponding to a current target block.

[0148] For step S250, the preset positions of the current target block can include at least one of a center position of the current target block, a top-left position of the current target block, a top-right position of the current target block, a bottom-left position of the current target block, and a bottom-right position of the current target block.

[0149] In a possible example, when there are multiple preset positions, step S250 specifically includes: traversing each preset position of the current target block according to a preset order, taking the currently traversed preset position as a starting point, determining a candidate next target block pointed to by the target vector on the current target block, and in a case where the candidate next target block has a block vector or a motion vector, taking the candidate next target block as the next target block and ending the traversal.

[0150] Specifically, determining the next target block can include the following steps as shown in FIG. 12.

[0151] S2511, traversing a first preset position of the current target block according to a preset order;

[0152] The preset order can be a center position, a top-left position, a top-right position, a bottom-left position, and a bottom-right position.

[0153] S2512, taking the currently traversed preset position as a starting point, determining a candidate next target block pointed to by the target vector on the current target block;

[0154] S2513, determining whether the candidate next target block has a block vector or a motion vector, if yes, jumping to step S2514, and if no, jumping to step S2515;

[0155] S2514, taking the candidate next target block as the next target block and ending the traversal;

[0156] S2515, determining whether the traversal of all preset positions is completed, if yes, ending the traversal, and if no, jumping to step S2516;

[0157] S2516, continuing to traverse a next preset position of the current target block, and returning to step S2512.

[0158] In the example shown in FIG. 12, the preset positions of the current target block are traversed according to an order, the currently traversed preset position is taken as a starting point of the target vector, a block pointed to by the target vector is obtained, if the pointed-to block has a block vector or a motion vector, the block is determined as the next target block, otherwise, the next preset position is continuously traversed until the next target block is found.

[0159] In a possible example, when there are multiple preset positions, step S250 specifically comprises: traversing each preset position of the current target block, taking the currently traversed preset position as a starting point, determining a candidate next target block pointed to by the target vector on the current target block, in the case that the candidate next target block exists a block vector or a motion vector, taking the block vector or the motion vector on the candidate next target block as a candidate vector; after the traversal ends, selecting a candidate vector with a minimum template cost from all candidate vectors, and taking the candidate next target block corresponding to the selected candidate vector as the next target block.

[0160] Specifically, determining the next target block can include the following steps as shown in FIG. 13.

[0161] S2521, traversing a first preset position of the current target block according to a preset order;

[0162] The preset order can be a center position, a top-left position, a top-right position, a bottom-left position, and a bottom-right position.

[0163] S2522, taking the currently traversed preset position as a starting point, determining a candidate next target block pointed to by the target vector on the current target block;

[0164] S2523, judging whether the candidate next target block exists a block vector or a motion vector, if yes, jumping to step S2524, if no, jumping to step S2525;

[0165] S2524, taking the block vector or the motion vector on the candidate next target block as a candidate vector, adding the candidate vector to a candidate vector set, and continuing to execute step S2525;

[0166] S2525, judging whether the traversal of all preset positions is completed, if yes, jumping to step S2527, if no, jumping to step S2526;

[0167] S2526, continuing to traverse a next preset position of the current target block, and returning to step S2522;

[0168] S2527, obtaining the candidate vector set, selecting a candidate vector with a minimum template cost from all candidate vectors, and taking the candidate next target block corresponding to the selected candidate vector as the next target block.

[0169] In the example shown in FIG. 13, preset positions of the current target block are sequentially traversed, and a block pointed to by a target vector with a current traversed preset position as a starting point is obtained. If the pointed block has a block vector or a motion vector, the pointed block is taken as a candidate next target block, and a block vector or a motion vector on the candidate next target block is taken as a candidate vector and added to a candidate vector set. Then, a next candidate next target block is searched by continuing to traverse a next preset position of the current target block. When the traversal ends, a candidate vector with a minimum template cost is selected from the candidate vector set, and a candidate next target block where the selected candidate vector is located is taken as a next target block.

[0170] Optionally, for step S240, after performing the vector accumulation processing to obtain the updated chain motion vector, the method further includes: in a case where the updated chain motion vector does not satisfy a first preset condition, canceling the previous vector accumulation and re-determining the current target block and the target vector on the current target block.

[0171] The first preset condition includes at least one of the following:

[0172] (1) a position pointed to by the updated chain motion vector is located in the valid reference region with the top-left corner of the current block as the starting point;

[0173] (2) a position pointed to by the updated chain motion vector is located in the valid reference region with the bottom-right corner of the current block as the starting point;

[0174] (3) a position pointed to by the updated chain motion vector is located in the valid reference region with the bottom-left corner of the current block as the starting point;

[0175] (4) a position pointed to by the updated chain motion vector is located in the valid reference region with the top-right corner of the current block as the starting point;

[0176] (5) a reference image pointed to by the updated chain motion vector belongs to the reference image queue of the current image.

[0177] The valid reference region includes a reconstructed region of the image.

[0178] It should be understood that the growth direction of the chain motion vector is limited by the first preset condition. If the updated chain motion vector obtained after the current chain motion vector is accumulated with a new target vector does not satisfy the first preset condition, a rollback operation is triggered to cancel the previous vector accumulation. The current target block and the target vector on the current target block are re-determined, and the vector accumulation is re-performed based on the re-determined current target block and the re-determined target vector on the current target block.

[0179] For example, the current target block is the first valid block vector obtained by traversing the motion information candidate set. If the target vector on the current target block is accumulated to the current chain motion vector to obtain an updated chain motion vector, the updated chain motion vector does not satisfy the first preset condition, a rollback operation is triggered to cancel the previous vector accumulation. At this time, the second valid block vector obtained by traversing the motion information candidate set can be taken as a new current target block, and the target vector on the new current target block is accumulated to the current chain motion vector.

[0180] The construction of the chain motion vector based on the block vector guidance is described below by way of example.

[0181] As shown in FIG. 14, an initial block vector BV is derived from at least one of the following sources: the spatial neighboring block of the current block, the temporal collocated block, the spatial non-adjacent block, the history-based block vector prediction set, the default block vector and the pair-wise average block vector. k(0) Wherein, k represents the index in the set of the derivable block vectors. The specific derivation manner of the initial block vector can refer to the related description of the step S100, which will not be described here again.

[0182] As shown in FIG. 15, the center (Center, C), top left (Top Left, TL), top right (Top Right, TR), bottom left (Bottom Left, BL) and bottom right (Bottom Right, BR) of the current block are taken as initial points, and the derived initial block vector is used to locate a target position (first target block). Here, the first target block is equivalent to the current target block described above, and the positioning of the first target block can refer to the related description of the step S210 about determining the current target block, which will not be described here again.

[0183] As shown in FIG. 14 and FIG. 15, the current target block has a motion vector MVL0 k(1) Wherein, L0 represents that the reference frame of the motion vector is from the reference frame set L0. MVL0 k(1) is accumulated to the initial block vector to form a chain motion vector with a trajectory depth of 1. If the current image belongs to a B frame, i.e., bidirectional reference is allowed, and the motion vector is a bidirectional prediction motion vector, the current target block also has a motion vector MVL1k(1), wherein L1 represents that the reference frame of the motion vector is from the reference frame set L1, and the operations in the L0 and L1 directions are similar, and the construction of the chain motion vector will be described below by taking the L0 direction as an example.

[0184] A new target position (second target block) is located based on the current chain motion vector, as shown in FIG. 14, MVL0 k(1)The pointed area is also located by the 5 positions (C, TL, TR, BL, BR) of the current target block as starting points to locate the position of the next target block. Here, the second target block is equivalent to the next target block described above, and the positioning of the second target block can refer to the description of the determination of the next target block in the previous step S250, which will not be repeated here.

[0185] As shown in FIG. 14, the second target block has a motion vector MVL0 k(2) , which is accumulated to the current chain motion vector to form a chain motion vector with a trajectory depth of 2. k(2)

[0186] In this way, the third target block, the fourth target block, etc. can be determined, and the block vectors / motion vectors on each target block are accumulated to the chain motion vector, and finally the chain motion vector guided by the block vector MVL0 k / m with a trajectory depth of m is obtained.

[0187] The chain motion vector MVL0 k / m points to the reference image RefPicL0 k / m , which is RefPicL0 k(m) , as shown in the following formula: MVL0 k / m = BV k(0) + MVL0 k(1) + MVL0 k(2) + BV k(1) … + MVL0 k(m) ; RefPicL0 k / m = RefPicL0 k(m) .

[0188] Optionally, the chain motion vector guided by the block vector MVL0 k / m is derived as a chain motion vector prediction candidate.

[0189] Optionally, the derivation of the chain motion vector includes but is not limited to one of the following:

[0190] The first valid chain motion vector prediction candidate is selected by traversing the 5 positions in a fixed order.

[0191] A plurality of chain motion vectors are derived from the 5 positions respectively, and the chain motion vector with the minimum template cost is selected as the final chain motion vector prediction candidate.

[0192] Optionally, the setting of the recursive trajectory depth m includes at least one of the following:

[0193] (1) m is a fixed value set as 1, 2, 3, 4, etc.

[0194] ​(2) m is the actual effective length, i.e. when the target position of the positioning does not contain an effective motion vector or a block vector, the current updated chain motion vector is taken as a chain motion vector prediction candidate, and the current recursion length is m.

[0195] Optionally, the chain motion vector prediction candidate of the intermediate process or the final chain motion vector prediction candidate is subjected to at least one restriction or no restriction is added:

[0196] (1) taking the upper left corner of the current block as the initial point, the position pointed to by the chain motion vector needs to be located inside the effective reference region of the reference image;

[0197] (2) taking the lower right corner of the current block as the initial point, the position pointed to by the chain motion vector needs to be located inside the effective reference region of the reference image;

[0198] (3) taking the lower left corner of the current block as the initial point, the position pointed to by the chain motion vector needs to be located inside the effective reference region of the reference image;

[0199] (4) taking the upper right corner of the current block as the initial point, the position pointed to by the chain motion vector needs to be located inside the effective reference region of the reference image;

[0200] (5) the reference image pointed to by the chain motion vector belongs to the reference image in the reference image queue of the current image.

[0201] In a possible example, when the target vector on the current target block includes a bidirectional motion vector, i.e. the target block includes a forward motion vector and a backward motion vector.

[0202] When the current target block includes a forward motion vector and a backward motion vector, for step S240, specifically can include:

[0203] The forward motion vector and the backward motion vector are respectively accumulated to the current chain motion vector to obtain a forward updated chain motion vector and a backward updated chain motion vector.

[0204] For step S250, specifically can include: taking a preset position of the current target block as the starting point, determining a next target block pointed to by the forward motion vector on the current target block, and a next target block pointed to by the backward motion vector on the current target block.

[0205] For step S270, specifically, the vector accumulation processing can be continued by replacing the current target block with the next target block pointed by the forward motion vector, replacing the current chain motion vector with the forward updated chain motion vector, if the vector accumulation processing end condition is not met; and replacing the current target block with the next target block pointed by the backward motion vector, replacing the current chain motion vector with the backward updated chain motion vector, if the vector accumulation processing end condition is not met.

[0206] It should be understood that the combination of the forward (or referred to as L0 direction) and backward (or referred to as L1 direction) chain motion vector prediction can include one or more of the following manners:

[0207] (1) If the current frame is a single reference frame, only single direction chain motion vector prediction is allowed. Specifically, when a target position has a bi-directional motion vector in a certain process, the two motion vectors in the bi-directional motion vector are added to the current chain motion vector prediction to obtain two kinds of motion vector predictions. The subsequent chain motion vector prediction process is performed respectively.

[0208] (2) If the current frame is a bi-directional reference frame, bi-directional chain motion vector prediction is allowed. Specifically, if the motion vector of any one of the chain motion vector prediction process is a bi-directional motion vector, the chain motion vector prediction is taken as a bi-directional motion vector prediction.

[0209] (3) If the current frame is a bi-directional reference frame, bi-directional chain motion vector prediction is allowed. Specifically, if the motion vector of any one of the chain motion vector prediction process is a bi-directional motion vector, the chain motion vector prediction is taken as a bi-directional motion vector prediction. If there are multiple bi-directional motion vectors in the process, only the last level bi-directional motion vector is reserved, and the other bi-directional motion vectors are added to the chain motion vector prediction as two independent chain motion vector predictions. For the case that the last level belongs to a bi-directional motion vector, it is added to the chain motion vector prediction to construct a bi-directional chain motion vector prediction.

[0210] Optionally, the derived chain motion vector prediction candidate is taken as a motion vector prediction candidate of the current block.

[0211] In one possible example, a plurality of initial block vectors are derived from at least one of the spatial neighboring blocks, the temporal collocated blocks, the spatial non-adjacent blocks, the history-based block vector prediction set, the default block vector and the pair-wise average block vector of the current block, forming an initial block vector set. Then the initial block vector set is traversed, and for each initial block vector, the operation of step S200 is performed respectively, and finally a chain-based motion vector guided by different initial block vectors is obtained. For example, the initial block vector set contains n initial block vectors, and finally n or more than n chain-based motion vectors guided by block vectors can be obtained.

[0212] In one possible example, five positions (C, TL, TR, BL, BR) of the initial block vector are used to derive chain-based motion vector prediction candidates respectively, and sequentially added to the chain-based motion vector prediction candidate set.

[0213] Optionally, after step S200, the following step S300 is further included.

[0214] S300, adding the chain-based motion vector guided by the block vector to the motion vector prediction candidate set of the current block.

[0215] Here, the chain-based motion vector guided by the block vector is added to the motion vector prediction candidate set of the current block, aiming to improve the richness of the motion vector prediction candidates in the motion vector prediction candidate set, and further improve the accuracy of the motion vector prediction candidate of the current block.

[0216] For step S300, the following steps S310 and S320 can be specifically included.

[0217] S310, adding the chain-based motion vector guided by the block vector to the chain-based motion vector guided by the block vector set.

[0218] S320, selecting one or more chain-based motion vectors guided by the block vector from the chain-based motion vector guided by the block vector set and adding to the motion vector prediction candidate set of the current block, which can specifically include any one of the following S321-S325:

[0219] S321, selecting the first chain-based motion vector from the chain-based motion vector guided by the block vector set as the motion vector prediction candidate of the current block and adding to the motion vector prediction candidate set of the current block.

[0220] S322, selecting the chain-based motion vector with the lowest template cost from the chain-based motion vector guided by the block vector set as the motion vector prediction candidate of the current block and adding to the motion vector prediction candidate set of the current block.

[0221] S323, add all the chain motion vectors in the set of block vector guided chain motion vectors as motion vector prediction candidates of the current block to the motion vector prediction candidate set of the current block.

[0222] S324, add the first n chain motion vectors in the set of block vector guided chain motion vectors as motion vector prediction candidates of the current block to the motion vector prediction candidate set of the current block, where n is an integer greater than 1.

[0223] S325, add the first n chain motion vectors with the lowest template cost in the set of block vector guided chain motion vectors as motion vector prediction candidates of the current block to the motion vector prediction candidate set of the current block, where n is an integer greater than 1.

[0224] Optionally, the embodiments of the present application further include: dividing the plurality of block vector guided chain motion vectors according to the source of the initial block vector into at least one of the following:

[0225] the block vector guided chain motion vector based on the spatial neighboring block;

[0226] the block vector guided chain motion vector based on the temporal collocated block;

[0227] the block vector guided chain motion vector based on the spatial non-neighboring block;

[0228] the block vector guided chain motion vector based on the history-based block vector prediction table.

[0229] It should be understood that after the plurality of block vector guided chain motion vectors are divided according to the source of the initial block vector, a plurality of sets of block vector guided chain motion vectors can be obtained, such as: a set of block vector guided chain motion vectors based on the spatial neighboring block, a set of block vector guided chain motion vectors based on the temporal collocated block, a set of block vector guided chain motion vectors based on the spatial non-neighboring block, and a set of block vector guided chain motion vectors based on the history-based block vector prediction table.

[0230] Optionally, the embodiments of the present application further include: filling the block vector guided chain motion vectors into the motion vector prediction candidate set of the current block according to the source of the initial block vector.

[0231] In a possible example, the block vector guided chain motion vectors described above are filled into the motion vector prediction candidate set, and the optional filling manner includes: the block vector guided chain motion vectors and the motion vector guided chain motion vectors can be combined in any order.

[0232] For example, after filling the chain-based motion vector guided by the block vector into the chain-based motion vector guided by the motion vector, the order of each type of motion vector in the motion vector prediction candidate set is as follows:

[0233] Chain-based motion vector guided by the motion vector of the spatial neighboring block;

[0234] Chain-based motion vector guided by the motion vector of the temporal collocated block;

[0235] Chain-based motion vector guided by the motion vector of the spatial non-neighboring block;

[0236] Chain-based motion vector guided by the motion vector of the history;

[0237] Chain-based motion vector guided by the block vector of the spatial neighboring block;

[0238] Chain-based motion vector guided by the block vector of the temporal collocated block;

[0239] Chain-based motion vector guided by the block vector of the spatial non-neighboring block;

[0240] Chain-based motion vector guided by the block vector of the history.

[0241] In a possible example, the chain-based motion vector guided by the block vector described above is cross-filled into the chain-based motion vector guided by the motion vector according to the source of the initial block vector, and the order of each type of motion vector in the motion vector prediction candidate set is as follows:

[0242] Chain-based motion vector guided by the motion vector of the spatial neighboring block;

[0243] Chain-based motion vector guided by the block vector of the spatial neighboring block;

[0244] Chain-based motion vector guided by the motion vector of the temporal collocated block;

[0245] Chain-based motion vector guided by the block vector of the temporal collocated block;

[0246] Chain-based motion vector guided by the motion vector of the spatial non-neighboring block;

[0247] Chain-based motion vector guided by the block vector of the spatial non-neighboring block;

[0248] Chain-based motion vector guided by the motion vector of the history;

[0249] Chain-based motion vector guided by the block vector of the history.

[0250] In a possible example, the block vector guided chain motion vector described above is cross-filled into the motion vector guided chain motion vector according to the source of the initial block vector, and the order of each type of motion vector in the motion vector prediction candidate set is as follows:

[0251] The motion vector guided chain motion vector based on the spatial neighboring block;

[0252] The block vector guided chain motion vector based on the spatial neighboring block;

[0253] The motion vector guided chain motion vector based on the temporal collocated block;

[0254] The motion vector guided chain motion vector based on the spatial non-neighboring block;

[0255] The motion vector guided chain motion vector based on the history;

[0256] The block vector guided chain motion vector based on the temporal collocated block;

[0257] The block vector guided chain motion vector based on the spatial non-neighboring block;

[0258] The block vector guided chain motion vector based on the history.

[0259] It should be noted that in the above example, if there is no corresponding chain motion vector prediction candidate type, the filling of this type is skipped.

[0260] In a possible example of the present application, the method for obtaining a motion vector can specifically include:

[0261] S401, based on the motion vector prediction candidate set of the spatial neighboring block, the temporal collocated block, the spatial non-neighboring block and the history of the current block, a plurality of motion vector prediction candidates of the current block are determined, and a motion vector prediction candidate set is obtained;

[0262] The motion vector candidate includes at least one of the following: a motion vector candidate based on a spatial neighboring block; a motion vector candidate based on a temporal collocated block; a motion vector candidate based on a spatial non-neighboring block; and a candidate of a motion vector prediction table based on a history;

[0263] S402, a motion vector prediction candidate is derived from the motion vector prediction candidate set, the derived motion vector prediction candidate is used as a guide, a motion vector guided chain motion vector prediction candidate is constructed, and the motion vector guided chain motion vector prediction candidate is added to the motion vector prediction candidate set;

[0264] S403, derive a plurality of initial block vector from at least one of spatial neighboring block, temporal collocated block, spatial non-neighboring block of the current block, a set of history-based block vector predictors, a default block vector and a pair-wise average block vector, and a block vector of the current block;

[0265] S404, for each initial block vector, construct a block vector based chain motion vector using the initial block vector as a guide, and add the block vector based chain motion vector to a set of block vector based chain motion vectors;

[0266] S405, determine a block vector based chain motion vector predictor from the set of block vector based chain motion vectors, and add the block vector based chain motion vector predictor to a set of motion vector predictors;

[0267] The determination of the block vector based chain motion vector predictor can be implemented in any of the following optional manners:

[0268] selecting a first chain motion vector from the set of block vector based chain motion vectors as the motion vector predictor of the video block;

[0269] selecting a chain motion vector with the lowest template cost from the set of block vector based chain motion vectors as the motion vector predictor of the video block;

[0270] adding all chain motion vectors in the set of block vector based chain motion vectors as the motion vector predictors of the video block;

[0271] adding the first n chain motion vectors in the set of block vector based chain motion vectors as the motion vector predictors of the video block;

[0272] adding the first n chain motion vectors with the lowest template cost in the set of block vector based chain motion vectors as the motion vector predictors of the video block;

[0273] S406, fill the set of motion vector predictors with the pair-wise average candidate and the default candidate.

[0274] The embodiments of the present application also provide a video stream processing method, applied to an encoding end, comprising:

[0275] setting a preset flag in the encoding parameter to an open value, the open value indicating that the set of motion vector predictors of the video block is constructed according to the block vector based chain motion vector;

[0276] writing the encoding parameter into the video stream;

[0277] The block vector guided chain motion vector is obtained by the following manner: deriving an initial block vector from the motion information candidate set; and performing chain motion vector construction based on the initial block vector to obtain the block vector guided chain motion vector.

[0278] For example, when the embodiment of the present application is applied to the encoding end, the motion vector prediction candidate set is obtained by the above steps S401-S406; then the best motion vector prediction candidate is selected from the motion vector prediction candidate set by rate-distortion optimization; and then the index corresponding to the best motion vector prediction candidate is encoded into the code stream.

[0279] The embodiment of the present application also provides a video code stream processing method applied to the decoding end, and the method comprises the following steps:

[0280] receiving a video code stream and obtaining the encoding parameters from the video code stream;

[0281] when the preset flag in the encoding parameters is the opening value, constructing the motion vector prediction candidate set of the video block based on the block vector guided chain motion vector;

[0282] The block vector guided chain motion vector is obtained by the following manner: deriving an initial block vector from the motion information candidate set; and performing chain motion vector construction based on the initial block vector to obtain the block vector guided chain motion vector.

[0283] For example, when the embodiment of the present application is applied to the decoding end, the motion vector prediction candidate set is obtained by the above steps S401-S406; the index corresponding to the motion vector prediction candidate is parsed from the code stream; then the corresponding motion vector prediction candidate is obtained from the motion vector prediction candidate set according to the index; and then the current block is predicted by using the motion vector prediction candidate.

[0284] It should be understood that the motion vector prediction candidate is encoded into the code stream, so that the decoding end can find the reference block in the reference frame by using the motion vector prediction candidate after decoding the motion vector prediction candidate, and then the residual block is decoded, and the current block can be recovered by adding the residual block to the predicted block.

[0285] For example, the encoding parameters comprise at least one of the following: a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a picture header (PH) parameter, a slice header (SH) parameter, and a coding unit (CU) parameter.

[0286] In one possible example, a syntax element "vps_bvg_cmvp_enabled_flag" in VPS is used to indicate whether the method of constructing the set of motion vector prediction candidates according to the embodiments of the present application is enabled at the video level. When the element takes the value of 1, it means that the method is enabled; when the element takes the value of 0, it means that the method is not enabled.

[0287] In one possible example, a syntax element "sps_bvg_cmvp_enabled_flag" in SPS is used to indicate whether the method of constructing the set of motion vector prediction candidates according to the embodiments of the present application is enabled at the current video sequence. When the element takes the value of 1, it means that the method is enabled; when the element takes the value of 0, it means that the method is not enabled.

[0288] In one possible example, a syntax element "ph_bvg_cmvp_enabled_flag" in PPS or PH is used to indicate whether the method of constructing the set of motion vector prediction candidates according to the embodiments of the present application is enabled at the current picture. When the element takes the value of 1, it means that the method is enabled; when the element takes the value of 0, it means that the method is not enabled.

[0289] In one possible example, a syntax element "sh_bvg_cmvp_enabled_flag" in SH is used to indicate whether the method of constructing the set of motion vector prediction candidates according to the embodiments of the present application is enabled at the current slice. When the element takes the value of 1, it means that the method is enabled; when the element takes the value of 0, it means that the method is not enabled.

[0290] In one possible example, a syntax element "bvg_cmvp_enabled_flag" in CU parameters is used to indicate whether the method of constructing the set of motion vector prediction candidates according to the embodiments of the present application is enabled at the current coding unit (CU). When the element takes the value of 1, it means that the method is enabled; when the element takes the value of 0, it means that the method is not enabled.

[0291] It should be noted that the embodiments of the present application use flag bits in coding parameters at different levels to indicate whether the method of constructing the set of motion vector prediction candidates according to the embodiments of the present application is enabled at the corresponding level. It should be understood that the values of the flags are only illustrative, and other types of values can be used in actual applications, for example, "true" and "false" can be used to replace "1" and "0", or other types of characters or symbols can be used to replace "1" and "0", etc.

[0292] For example, the embodiments of the present application also include a method of inserting a set of chain motion vector prediction candidates guided by block vector into a set of motion vector prediction candidates. Specifically, similar syntax elements are used to control the insertion at the levels of VSP, SPS, PPS, SH, PH, CU, etc. Details are not described here.

[0293] In a possible example, at the encoding end, a screen content detection method is used to detect whether a current image belongs to screen content, if yes, a block vector guided chain motion vector prediction set is inserted into a motion vector prediction set in a manner, and an image level syntax element, a slice level syntax element are used to represent the enablement of the corresponding insertion manner, and a code stream is encoded, such as: ph_scc_bvg_cmvp_enabled_flag.

[0294] At the decoding end, the value of the syntax element ph_scc_bvg_cmvp_enabled_flag is parsed from the code stream, if true, the corresponding insertion manner is enabled in the current image and slice, otherwise, the corresponding insertion manner is not enabled.

[0295] The embodiment of the present application further provides an electronic device, as shown in Fig. 16, the electronic device 1400 comprises:

[0296] one or more processors 1410;

[0297] a memory 1420, one or more programs are stored on the memory 1420, when the one or more programs are executed by the one or more processors 1410, the one or more processors 1410 implement the method for obtaining a motion vector or the video code stream processing method provided by any one of the embodiments of the present application.

[0298] The memory 1420 is a kind of non-transient network system, and can be used to store non-transient software programs and non-transient computer executable programs.In addition, the memory 1420 can include high-speed random access memory, and can also include non-transient memory, such as at least one magnetic disk storage device, flash memory device or other non-transient solid-state memory device.In some embodiments, the memory 1420 can optionally include a memory 1420 remotely arranged relative to the processor 1410, and these remote memories 1420 can be connected to the processor 1410 through a network.The above-mentioned network includes but is not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0299] The memory 1420 can be realized in the form of read-only memory (ReadOnlyMemory, ROM), static storage device, dynamic storage device or random access memory (RandomAccessMemory, RAM).The memory 1420 can store operating systems and other application programs, when the technology solutions provided by the embodiments of the present application are realized by software or firmware, the related program codes are saved in the memory 1420, and the processor 1410 is called to execute the method of the embodiments of the present application.

[0300] The processor 1410 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided by the embodiments of the present application.

[0301] In some embodiments, the electronic device further includes:

[0302] The input / output interface is configured to implement information input and output.

[0303] The communication interface is configured to implement communication interaction between the device and other devices, which can be achieved by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0304] The bus is configured to transmit information between various components (such as the processor 1410, the memory 1420, the input / output interface, and the communication interface) of the device.

[0305] The processor 1410, the memory 1420, the input / output interface, and the communication interface can be connected to each other through the bus for internal communication within the device.

[0306] An embodiment of the present application further provides a computer readable storage medium storing computer executable instructions, which are used to execute the method for obtaining a motion vector or the video bitstream processing method provided by any one of the embodiments of the present application.

[0307] An embodiment of the present application further provides a computer program product including a computer program or computer instructions, which are stored in a computer readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer readable storage medium, and executes the computer program or computer instructions to make the computer device execute the method for obtaining a motion vector or the video bitstream processing method provided by any one of the embodiments of the present application.

[0308] The system architecture and application scenarios described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, as the system architecture evolves and new application scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0309] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in this application is intended to include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0310] Those skilled in the art can understand that all or some steps of the above-mentioned methods and systems can be implemented as software, firmware, hardware and appropriate combinations thereof. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, those skilled in the art know that communication media generally includes computer readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and can include any information delivery medium.

[0311] The above describes some embodiments of the present application with reference to the accompanying drawings, and is not limited to the scope of the present application. Any modification, equivalent replacement and improvement made by those skilled in the art without departing from the scope and essence of the present application shall be within the scope of the present application.

Claims

1. A method for obtaining a motion vector, the method comprising: deriving an initial block vector from a motion information candidate set; performing chain motion vector construction based on the initial block vector to obtain a block vector guided chain motion vector.

2. The method of claim 1, wherein, The motion information candidate set comprises motion information candidates, and each of the motion information candidates comprises at least one of a block vector based on a spatial neighboring block, a block vector based on a temporal collocated block, a block vector based on a spatial non-neighboring block, a history-based block vector prediction set, a default block vector, and a pair-wise average block vector; and the deriving of the initial block vector from the motion information candidate set comprises one of: iterating through the motion information candidates in the motion information candidate set in sequence, and deriving a first valid block vector in the iteration as the initial block vector; or, iterating through the motion information candidates in the motion information candidate set in sequence, and deriving a block vector with a minimum template cost from a plurality of valid block vectors in the iteration as the initial block vector; or, deriving a plurality of initial block vectors from at least one of the block vector based on the spatial neighboring block, the block vector based on the temporal collocated block, the block vector based on the spatial non-neighboring block, the history-based block vector prediction set, the default block vector, and the pair-wise average block vector in the motion information candidate set.

3. The method of claim 2, wherein, The valid block vector satisfies at least one of: a region pointed to by the block vector is a valid reference region of a current picture; or a region pointed to by the block vector has a block vector or a motion vector. The performing of the chain motion vector construction based on the initial block vector to obtain the block vector guided chain motion vector comprises:

4. The method of claim 1, wherein, determining a current target block pointed to by the initial block vector, starting from a preset position of a current block; in a case where the current target block has a target vector, performing a vector accumulation process by accumulating the target vector on the current target block to the current chain motion vector to obtain an updated chain motion vector, wherein the target vector comprises a block vector or a motion vector; determining a next target block pointed to by the target vector on the current target block, starting from the preset position of the current target block; in a case where a vector accumulation process end condition is not met, replacing the current target block with the next target block, replacing the current chain motion vector with the updated chain motion vector, and continuing the vector accumulation process; in a case where the vector accumulation process end condition is met, taking the updated chain motion vector as the block vector guided chain motion vector. The vector accumulation process end condition comprises:

5. The method of claim 4, wherein, a depth of vector accumulation reaches a preset value; or, the next target block does not have the target vector; or, a region where the next target block is located is not a valid reference region; or, an image where the next target block is located is not a reference image of the current picture. ​ 6. The method of claim 4, wherein, The preset positions include at least one of a center position, a top-left position, a top-right position, a bottom-left position and a bottom-right position; and the initial block vector is determined from the preset position of the current block. When there are multiple preset positions, each of the preset positions of the current block is traversed in a preset order, and a candidate current target block pointed to by the initial block vector is determined from the preset position currently traversed; and when the block vector or the motion vector exists in the candidate current target block, the candidate current target block is taken as the current target block, and the traversal is ended. Or, When there are multiple preset positions, each of the preset positions of the current block is traversed, and a candidate current target block pointed to by the initial block vector is determined from the preset position currently traversed; and when the block vector or the motion vector exists in the candidate current target block, the block vector or the motion vector on the candidate current target block is taken as a candidate vector; after the traversal is ended, a candidate vector with the minimum template cost is selected from all the candidate vectors, and the candidate current target block corresponding to the selected candidate vector is taken as the current target block. Or, When there are multiple preset positions, each of the preset positions of the current block is traversed, and a candidate current target block pointed to by the initial block vector is determined from the preset position currently traversed; and after the traversal is ended, one or more current target blocks are obtained.

7. The method of claim 4, wherein, The preset positions include a center position, a top-left position, a top-right position, a bottom-left position and a bottom-right position; and the next target block pointed to by the target vector is determined from the preset position of the current target block. Each of the preset positions of the current target block is traversed in a preset order, and a candidate next target block pointed to by the target vector on the current target block is determined from the preset position currently traversed; and when the block vector or the motion vector exists in the candidate next target block, the candidate next target block is taken as the next target block, and the traversal is ended. Or, Each of the preset positions of the current target block is traversed, and a candidate next target block pointed to by the target vector on the current target block is determined from the preset position currently traversed; and when the block vector or the motion vector exists in the candidate next target block, the block vector or the motion vector on the candidate next target block is taken as a candidate vector; after the traversal is ended, a candidate vector with the minimum template cost is selected from all the candidate vectors, and the candidate next target block corresponding to the selected candidate vector is taken as the next target block.

8. The method of claim 4, wherein, After the updated chain motion vector is obtained, the method further includes: When the updated chain motion vector does not satisfy a first preset condition, the previous vector accumulation is cancelled, and the current target block and the target vector on the current target block are re-determined. The first preset condition includes at least one of the following: the position pointed by the updated chain motion vector is located in the valid reference region, starting from the top-left corner of the current block; the position pointed by the updated chain motion vector is located in the valid reference region, starting from the bottom-right corner of the current block; the position pointed by the updated chain motion vector is located in the valid reference region, starting from the bottom-left corner of the current block; the position pointed by the updated chain motion vector is located in the valid reference region, starting from the top-right corner of the current block; the reference image pointed by the updated chain motion vector belongs to the reference image queue of the current image; wherein the valid reference region comprises a reconstructed region of the image.

9. The method of claim 4, wherein, when the target vector on the current target block comprises a forward motion vector and a backward motion vector; the accumulating the target vector on the current target block to the current chain motion vector to obtain an updated chain motion vector comprises: accumulating the forward motion vector and the backward motion vector to the current chain motion vector respectively to obtain a forward updated chain motion vector and a backward updated chain motion vector.

10. The method of claim 1, wherein, The method further comprises: adding the block vector guided chain motion vector to a motion vector prediction candidate set of a current block.

11. The method of claim 10, wherein, The adding the block vector guided chain motion vector to a motion vector prediction candidate set of a current block comprises: adding the block vector guided chain motion vector to a block vector guided chain motion vector set; selecting one or more block vector guided chain motion vectors from the block vector guided chain motion vector set to add to the motion vector prediction candidate set of the current block by one of the following steps: selecting a first chain motion vector from the block vector guided chain motion vector set as a motion vector prediction candidate of the current block to add to the motion vector prediction candidate set of the current block; selecting a chain motion vector with the lowest template cost from the block vector guided chain motion vector set as a motion vector prediction candidate of the current block to add to the motion vector prediction candidate set of the current block; adding all chain motion vectors in the block vector guided chain motion vector set as motion vector prediction candidates of the current block to the motion vector prediction candidate set of the current block; adding the first n chain motion vectors in the block vector guided chain motion vector set as motion vector prediction candidates of the current block to the motion vector prediction candidate set of the current block; adding the first n chain motion vectors with the lowest template cost in the block vector guided chain motion vector set as motion vector prediction candidates of the current block to the motion vector prediction candidate set of the current block.

12. The method of claim 11, wherein, The method further comprises dividing a plurality of the block vector guided chain motion vectors according to the source of the initial block vector into at least one of the following: a block vector guided chain motion vector based on a spatial neighboring block; a block vector guided chain motion vector based on a temporal collocated block; a block vector guided chain motion vector based on a spatial non-neighboring block; and a block vector guided chain motion vector based on a spatial non-neighboring block. Block vector guided chain motion vector based on history-based block vector prediction table.

13. The method of claim 12, wherein, The block vector guided chain motion vector is filled into a motion vector prediction candidate set of the current block according to a source of the initial block vector.

14. A video bitstream processing method applied to an encoding end, the method comprising: setting a preset flag bit in an encoding parameter to an on value, the on value indicating that a motion vector prediction candidate set of a video block is constructed according to a block vector guided chain motion vector; writing the encoding parameter into a video bitstream; wherein the block vector guided chain motion vector is obtained by deriving an initial block vector from a motion information candidate set and constructing a chain motion vector based on the initial block vector to obtain the block vector guided chain motion vector.

15. A video bitstream processing method applied to a decoding end, the method comprising: receiving a video bitstream and obtaining an encoding parameter from the video bitstream; constructing a motion vector prediction candidate set of a video block according to a block vector guided chain motion vector according to a preset flag bit in the encoding parameter being an on value; wherein the block vector guided chain motion vector is obtained by deriving an initial block vector from a motion information candidate set and constructing a chain motion vector based on the initial block vector to obtain the block vector guided chain motion vector.

16. An electronic device, comprising: one or more processors; a memory having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement a method for obtaining a motion vector prediction candidate according to any one of claims 1-13, or a video bitstream processing method according to claim 14, or a video bitstream processing method according to claim 15.

17. A computer readable storage medium having a computer program stored thereon, the program being executed by a processor to implement a method for obtaining a motion vector prediction candidate according to any one of claims 1-13, or a video bitstream processing method according to claim 14, or a video bitstream processing method according to claim 15.

18. A computer program product comprising a computer program, the computer program being executed by a processor to implement a method for obtaining a motion vector prediction candidate according to any one of claims 1-13, or a video bitstream processing method according to claim 14, or a video bitstream processing method according to claim 15.

Citation Information

Patent Citations

  • Method and device for obtaining a list of candidate motion vectors, and codec

    CN112042197A

  • Initializing history-based motion vector predictor table

    CN114287129A

  • Motion vector determination method and device in video coding, equipment and storage medium

    CN115914646A