CN110662074A - Motion vector determination method and device - Google Patents

Motion vector determination method and device Download PDF

Info

Publication number
CN110662074A
CN110662074A CN201810692034.XA CN201810692034A CN110662074A CN 110662074 A CN110662074 A CN 110662074A CN 201810692034 A CN201810692034 A CN 201810692034A CN 110662074 A CN110662074 A CN 110662074A
Authority
CN
China
Prior art keywords
image block
motion vector
template
candidate image
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810692034.XA
Other languages
Chinese (zh)
Other versions
CN110662074B (en
Inventor
陈方栋
王莉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201810692034.XA priority Critical patent/CN110662074B/en
Priority to PCT/CN2019/093709 priority patent/WO2020001624A1/en
Publication of CN110662074A publication Critical patent/CN110662074A/en
Application granted granted Critical
Publication of CN110662074B publication Critical patent/CN110662074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals

Abstract

The application provides a motion vector determination method and equipment, wherein the method comprises the following steps: acquiring motion information of candidate image blocks of a current image block; acquiring a template of the current image block according to the motion information of the candidate image block; obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template; and determining the final motion vector of the current image block according to the target motion vector. By the technical scheme, the template of the current image block can be obtained before the reconstruction stage of decoding, the decoding efficiency can be improved, and the decoding time delay can be reduced.

Description

Motion vector determination method and device
Technical Field
The present application relates to the field of video encoding and decoding technologies, and in particular, to a method and an apparatus for determining a motion vector.
Background
In order to achieve the purpose of saving space, video images are transmitted after being coded, and the complete video coding method can comprise the processes of prediction, transformation, quantization, entropy coding, filtering and the like. The predictive coding comprises intra-frame coding and inter-frame coding, wherein the inter-frame coding is to use the correlation of a video time domain and use the pixels adjacent to a coded image to predict the pixels of a current image so as to achieve the aim of effectively removing the video time domain redundancy.
In inter-frame coding, a Motion Vector (MV) may be used to represent a relative displacement between a current image block of a current frame video image and a reference image block of a reference frame video image. For example, when a video image a of the current frame has a strong temporal correlation with a video image B of the reference frame, and an image block a1 (current image block) of the video image a needs to be transmitted, a motion search may be performed in the video image B to find an image block B1 (i.e., reference image block) that best matches image block a1, and determine a relative displacement between image block a1 and image block B1, which is also a motion vector of image block a 1.
The encoding side may send the motion vector to the decoding side, instead of sending the image block a1 to the decoding side, and the decoding side may obtain the image block a1 according to the motion vector and the image block B1. Obviously, this can save a lot of bits, since the motion vector occupies a smaller number of bits than the image block a 1.
However, when the video image a is divided into a large number of image blocks, a relatively large number of bits are also consumed when transmitting the motion vector for each image block. To further save bits, the motion vectors of the image block a1 may also be predicted using spatial correlation between candidate image blocks. For example, the motion vector of image block a2 adjacent to image block a1 may be determined as the motion vector of image block a 1. Based on this, the encoding side may send the index value of the image block a2 to the decoding side, and the decoding side may determine the motion vector of the image block a2, which is the motion vector of the image block a1, based on the index value. This may result in further bit savings, since the index value of the image block a2 occupies a smaller number of bits than the motion vector.
Since the motion of the image block a1 may be different from the motion of the image block a2, that is, the motion vector of the image block a2 may not be consistent with the motion vector of the image block a1, determining the motion vector of the image block a2 as the motion vector of the image block a1 has problems of low prediction quality, erroneous prediction, and the like.
Disclosure of Invention
The application provides a motion vector determination method and equipment, which solve the problems of low prediction quality, prediction error and the like, can improve the precision of a motion vector and improve the coding performance.
The application provides a motion vector determination method, which is applied to a decoding end and comprises the following steps:
acquiring motion information of candidate image blocks of a current image block;
acquiring a template of the current image block according to the motion information of the candidate image block;
obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template;
and determining the final motion vector of the current image block according to the target motion vector.
The application provides a motion vector determination method, which is applied to a coding end and comprises the following steps:
acquiring motion information of candidate image blocks of a current image block;
acquiring a template of the current image block according to the motion information of the candidate image block;
obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template;
and sending the coded bit stream to a decoding end according to the original motion vector and the target motion vector.
The application provides a decoding side device, including: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute machine executable instructions to implement the motion vector determination method steps described above.
The application provides a coding end device, including: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute machine executable instructions to implement the motion vector determination method steps described above.
According to the technical scheme, the target motion vector can be obtained according to the original motion vector, the final motion vector of the current image block is determined according to the target motion vector instead of the original motion vector, and therefore the precision of the motion vector is improved, and the coding performance is improved. And when the target motion vector is obtained according to the original motion vector, the template of the current image block can be obtained according to the motion information of the candidate image block, and the target motion vector is obtained according to the template of the current image block. For example, before the reconstruction stage of decoding, a template of the current image block may be obtained, and the target motion vector may be obtained according to the template.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present application.
FIG. 1 is a diagram illustrating motion vectors in one embodiment of the present application;
FIG. 2 is a flow diagram of a motion vector determination method in one embodiment of the present application;
3A-3O are schematic diagrams of a template of a current image block in an embodiment of the present application;
fig. 4A and 4B are flowcharts of a motion vector determination method in another embodiment of the present application;
fig. 5 is a flowchart of a motion vector determination method according to another embodiment of the present application;
fig. 6A and 6B are flowcharts of a motion vector determination method in another embodiment of the present application;
fig. 7 is a block diagram of a motion vector determination device according to an embodiment of the present application;
fig. 8 is a block diagram of a motion vector determination device according to another embodiment of the present application;
fig. 9 is a hardware configuration diagram of a decoding-side device according to an embodiment of the present application;
fig. 10 is a hardware configuration diagram of an encoding-side device according to an embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
The embodiment of the application provides a motion vector determination method, which can relate to the following concepts:
motion Vector (MV): in the inter-frame coding, a motion vector is used to represent the relative displacement between a current image block of a current frame video image and a reference image block of a reference frame video image, and each divided image block has a corresponding motion vector transmitted to a decoding end. If the motion vectors of each image block are encoded and transmitted independently, especially if divided into a large number of image blocks of small size, a considerable number of bits are consumed. In order to reduce the bit number for encoding the motion vector, the spatial correlation between adjacent image blocks can be utilized to predict the motion vector of the current image block to be encoded according to the motion vector of the adjacent encoded image block, and then the prediction difference is encoded, so that the bit number representing the motion vector can be effectively reduced.
Motion Information (Motion Information): since the motion vector indicates the position offset of the current image block from a certain reference image block, in order to accurately acquire information pointing to the image block, index information of the reference frame image is required in addition to the motion vector to indicate which reference frame image is used. In the video coding technology, for a current frame image, a reference frame image list may be generally established, and the reference frame image index information indicates that the current image block adopts the several reference frame images in the reference frame image list. In the video encoding technology, motion-related encoding information such as a motion vector and a reference frame index may be collectively referred to as motion information.
Template (Template): in video coding techniques, the coding process is performed on an image block-by-image block basis, and when the current image block is coded, the reconstruction information of the surrounding coded image blocks is available. The template refers to the decoding information of a fixed shape around the current image block (adjacent region in the time domain or the space domain). The templates are identical at the encoding end and the decoding end, so that some operations performed by the templates at the encoding end can obtain completely consistent results at the decoding end, that is, information derived by the encoding end based on the templates can be recovered at the decoding end without loss, without transferring additional information, thereby further reducing the number of transmission bits.
Rate-Distortion principle (Rate-Distortion Optimized): there are two major indicators for evaluating coding efficiency: code rate and Peak Signal to Noise Ratio (PSNR), the smaller the bit stream, the larger the compression rate, and the larger the PSNR, the better the reconstructed image quality, and in the mode selection, the discrimination formula is essentially the comprehensive evaluation of the two. For example, the cost for a mode: j (mode) ═ D + λ R, where D denotes Distortion, which can be generally measured using SSE metric, SSE refers to the mean square sum of the differences between the reconstructed image block and the source image; and λ is a lagrange multiplier, and R is the actual number of bits required for encoding the image block in the mode, including the sum of bits required for encoding mode information, motion information, residual errors and the like.
Intra and inter prediction (intra and inter): the intra-frame prediction refers to performing predictive coding by using reconstructed pixel values of spatial adjacent image blocks (for example, in the same frame as the current image block) of the current image block, and the inter-frame prediction refers to performing predictive coding by using reconstructed pixel values of temporal adjacent image blocks (for example, in a different frame from the current image block) of the current image block.
The embodiment of the application provides a motion vector determination method which can be applied to an interframe coding technology. In the inter-frame coding technique, a relative displacement between a current image block of a current frame video image and a reference image block of a reference frame video image may be represented using a motion vector. Referring to fig. 1, video image a is a current frame video image, tile a1 is a current tile, video image B is a reference frame video image of video image a, and tile B1 is a reference tile of tile a 1. Due to the strong temporal correlation between video image a and video image B, when image block a1 of video image a needs to be transmitted, a motion search may be performed in video image B to find image block B1 that best matches image block a1, and determine the relative displacement between image block a1 and image block B1, which is also the motion vector of image block a 1. For example, the motion vector is (-6, 4), which indicates that image block B1 is shifted by 6 pixels to the left in the horizontal direction and by 4 pixels to the top in the vertical direction, compared to image block a 1.
When the encoding end sends the encoded bitstream to the decoding end, the encoded bitstream carries the motion vector (-6, 4) of the image block a1, instead of the image block a 1. The motion vector (-6, 4) for image block a1 may be obtained by the decoder after receiving the encoded bitstream, and the position of image block B1 is determined in video picture B based on the position of image block a1 and the motion vector (-6, 4), i.e.: at the position of the image block a1, 6 pixel points are moved to the left, 4 pixel points are moved upwards, the position of the image block B1 is obtained, the image block B1 is read from the position of the image block B1, and the image block a1 is reconstructed by using the image block B1. Since the similarity between the image block B1 and the image block a1 is high, an image with high similarity can be reconstructed by reconstructing the image block a1 using the image block B1. Since the number of bits occupied by the motion vector is smaller than the number of bits occupied by image block a1, a significant amount of bits is saved by carrying the motion vector in the encoded bitstream instead of carrying image block a 1.
Further, if the video image a includes a large number of image blocks, the motion vector of each image block also occupies relatively many bits, and therefore, in order to further save the number of bits, in the embodiment of the present application, the motion vector of the image block a1 may also be determined by using the motion vectors of adjacent image blocks. For example, in video image A, the image blocks adjacent to image block A1 may include: image block a2, image block A3, image block a4, and image block a5 include, in the motion vector list, motion vector a21 for image block a2, motion vector a31 for image block A3, motion vector a41 for image block a4, and motion vector a51 for image block a 5.
To determine the motion vector of image block a1, one motion vector may be selected from the motion vector list, assuming that motion vector a21 is selected, motion vector a21 is used as the original motion vector, and the original motion vector a21 is used to obtain the target motion vector, which is the final motion vector of image block a 1.
In one example, instead of directly taking the original motion vector a21 as the final motion vector for image block a1, a target motion vector different from the original motion vector a21 is obtained from the original motion vector a21, which is the closest to the motion vector for image block a1, and thus, the target motion vector may be taken as the final motion vector for image block a 1. Obviously, compared with the mode of directly taking the original motion vector a21 as the final motion vector of the image block a1, the mode of taking the target motion vector as the final motion vector of the image block a1 can solve the problems of low prediction quality, prediction error and the like.
Further, when the encoding end sends the encoded bitstream to the decoding end, the encoded bitstream carries the index value of the original motion vector a21 (i.e. the index value in the motion vector list), instead of the motion vector (-6, 4) of image block a1, even more, instead of image block a 1. After receiving the encoded bitstream, the decoder may obtain the index value of the original motion vector a21, obtain the original motion vector a21 from the motion vector list according to the index value, and obtain the target motion vector according to the original motion vector a21, where the target motion vector is the final motion vector of the image block a1, thereby obtaining the final motion vector of the image block a 1. Obviously, since the number of bits occupied by the index value is smaller than that occupied by the motion vector, a further bit saving is possible.
When the target motion vector is obtained according to the original motion vector, the template of the current image block may be obtained by using decoded information (such as reconstruction information or prediction information) of an image block adjacent to the current image block, and the target motion vector may be obtained according to the template of the current image block and the original motion vector. However, if the decoded information of the adjacent image block is reconstruction information, the generation of the template of the current image block needs to wait for the decoding reconstruction stage, which greatly reduces the decoding efficiency and brings decoding delay; if the decoded information of the adjacent image block is the prediction information, the generation of the template of the current image block also needs to wait for the decoding reconstruction stage, so that the decoding efficiency is greatly reduced, and the decoding time delay is brought. Therefore, the above method may cause the parallelism of decoding to be greatly affected.
In view of the above findings, in this embodiment, a more optimal template generating manner is provided, and unlike a manner in which a template is generated by using reconstruction information and prediction information, a template of a current image block may be obtained according to motion information (such as a motion vector and a reference frame index) of a candidate image block of the current image block, and then a target motion vector may be obtained according to the template of the current image block and an original motion vector, so as to improve efficiency.
The motion vector determination method will be described in detail below with reference to several specific embodiments.
The first embodiment is as follows:
referring to fig. 2, a flow chart of a motion vector determination method is schematically shown, where the method may include:
step 201, the encoding end obtains the motion information of the candidate image block of the current image block.
The candidate image blocks of the current image block may include, but are not limited to: a spatial domain candidate image block of the current image block; or, a time domain candidate image block of the current image block; the candidate image block is not limited.
When the current image block is encoded, since the candidate image block of the current image block has already been encoded, that is, the motion information of the candidate image block is known, the encoding end may directly obtain the motion information of the candidate image block, such as a motion vector and a reference frame index of the candidate image block, which is not limited thereto.
Step 202, the encoding end obtains the template of the current image block according to the motion information of the candidate image block.
The processing procedure in step 202 may refer to the following embodiments, which are not described herein again.
Step 203, the encoding end obtains a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, and the target motion vector may be different from the original motion vector.
Before step 203, the original motion vector of the current image block may be obtained, for example, assuming that the current image block is the image block a1, and the motion vector list at the encoding end sequentially includes the motion vector a21, the motion vector a31, the motion vector a41, and the motion vector a51, a motion vector may be selected from the motion vector list, and the selected motion vector is the original motion vector of the image block a 1. Of course, the above manner is only an example, and is not limited to this, for example, the default motion vector may be directly determined as the original motion vector.
Wherein, the selecting, by the encoding end, a motion vector from the motion vector list may include: the encoding end selects a first motion vector from the motion vector list; or, selecting the last motion vector from the motion vector list; or, randomly selecting a first motion vector from the motion vector list; alternatively, a hash algorithm is used to select the first motion vector from the motion vector list. Of course, the above-described modes are only examples, and the modes are not limited thereto as long as a motion vector can be selected from the motion vector list.
The motion vector list is used for recording motion vectors of image blocks adjacent to the current image block. For example, after obtaining the motion vector a21 of the image block a2, the motion vector a21 may be recorded in the motion vector list, after obtaining the motion vector a31 of the image block A3, the motion vector a31 may be recorded in the motion vector list, and so on, and finally, the motion vector list of the image block a1 may be obtained.
The processing procedure in step 203 may refer to the following embodiments, which are not described herein again.
And step 204, the encoding end sends the encoded bit stream to the decoding end according to the original motion vector and the target motion vector.
Specifically, the encoding end may obtain the encoding performance of the original motion vector and the encoding performance of the target motion vector. And when the coding performance of the target motion vector is better than that of the original motion vector, sending a coding bit stream carrying first indication information to a decoding end, wherein the first indication information is used for indicating that the final motion vector of the current image block is determined based on the template. And when the encoding performance of the original motion vector is better than that of the target motion vector, transmitting an encoding bit stream carrying second indication information to a decoding end, wherein the second indication information is used for indicating that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block.
In practical application, the first indication information or the second indication information may also be notified in an implicit manner, that is, the first indication information or the second indication information is not carried in the coded bitstream. Specifically, the encoding end and the decoding end may also negotiate a motion vector decision policy or define a policy in a standard, and store the policy in the encoding end and the decoding end, where the motion vector decision policy may be default first policy information, and the first policy information is used to indicate that a final motion vector of the current image block is determined based on a template; or defaulting second strategy information, wherein the second strategy information is used for indicating that a final motion vector of the current image block is determined based on an original motion vector corresponding to the current image block; or defaulting third strategy information, wherein the third strategy information is the final motion vector of the current image block determined by adopting the same strategy information as the adjacent image block of the current image block.
When the motion vector decision policy is the default first policy information and the coding performance of the target motion vector is better than that of the original motion vector, the coded bit stream may not carry the first indication information and the second indication information. When the motion vector decision policy is the default second policy information and the encoding performance of the original motion vector is better than that of the target motion vector, the encoded bitstream may not carry the first indication information and the second indication information. For another example, when the motion vector decision policy is the third policy information and the adjacent image block adopts the first policy information, the coding performance of the target motion vector is better than that of the original motion vector, and the coded bitstream may not carry the first indication information and the second indication information; when the adjacent image blocks adopt the second policy information, and the encoding performance of the original motion vector is better than that of the target motion vector, the encoded bitstream may not carry the first indication information and the second indication information.
In one example, the transmitting, by the encoding end, the encoded bitstream to the decoding end according to the original motion vector and the target motion vector may further include: acquiring an index value of an original motion vector in a motion vector list; and sending the coded bit stream carrying the index value to a decoding end. For example, if the original motion vector is motion vector a21 and motion vector a21 is the first motion vector of the motion vector list, the index value may be 1.
The process of the encoding end obtaining the encoding performance of the original motion vector and the encoding performance of the target motion vector may refer to the subsequent embodiments, and details are not described in this embodiment one.
According to the technical scheme, the target motion vector can be obtained according to the original motion vector, the final motion vector of the current image block is determined according to the target motion vector, and the final motion vector of the current image block is not determined according to the original motion vector, so that the precision of the motion vector is improved, and the coding performance is improved. And when the target motion vector is obtained according to the original motion vector, the template of the current image block can be obtained according to the motion information of the candidate image block, and the target motion vector is obtained according to the template of the current image block. For example, before the reconstruction stage of decoding, the template of the current image block may be obtained, and the target motion vector may be obtained according to the template of the current image block.
Example two:
in the process of video coding, each image block is coded one by one, and when the current image block is coded, if the adjacent image blocks around the current image block are completely reconstructed, the current image block can be reconstructed by using the decoded information of the adjacent image blocks, so that the template of the current image block can be obtained by using the decoded information of the adjacent image blocks of the current image block. The decoded information may include, but is not limited to: reconstruction information of neighboring image blocks and/or prediction information of neighboring image blocks. The reconstruction information may include, but is not limited to, luminance values, chrominance values, and the like; the prediction information may be an intermediate value from which the reconstruction information can be obtained, and for example, if the luminance value can be obtained using the intermediate value a, the intermediate value a is the prediction information, and this prediction information is not limited.
However, if the decoded information is reconstruction information, the generation of the template of the current image block needs to wait for the decoding reconstruction stage, which greatly reduces the decoding efficiency and brings decoding delay; and the decoding information is prediction information, the generation of the template of the current image block also needs to wait for the decoding reconstruction stage, so that the decoding efficiency is greatly reduced, and the decoding time delay is brought. Therefore, the above method may cause the parallelism of decoding to be greatly affected.
In view of the above findings, in this embodiment, a better template generating manner is provided, and unlike a manner in which a template is generated by using reconstruction information and prediction information, a method for obtaining the template of the current image block according to motion information (such as a motion vector and a reference frame index) of a candidate image block of the current image block and obtaining the template of the current image block according to the motion information of the candidate image block may be applied to both the encoding side and the decoding side.
The obtaining the template of the current image block according to the motion information of the candidate image block may include: when the motion information comprises a motion vector and a reference frame index of the candidate image block, determining a reference frame image corresponding to the candidate image block according to the reference frame index; and acquiring a reference image block corresponding to the candidate image block from the reference frame image according to the motion vector, and acquiring a template of the current image block according to the reference image block.
For example, referring to FIG. 3A, assume tile A1 is the current tile and tile A2 and tile A3 are candidate tiles for tile A1. For tile a2, if the reference frame index of tile a2 is the index of video image B, it may be determined that the reference frame image corresponding to tile a2 is video image B according to the reference frame index; then, an image block B2 corresponding to the image block A2 is selected from the video image B, namely the position of the image block B2 in the video image B is the same as the position of the image block A2 in the video image A; then, the image block B2 may be moved according to the motion vector of the image block a2, for example, the image block B2 is moved by using the motion vector (3, 3), so as to obtain the image block B2 '(e.g., moving 3 pixels rightward and moving 3 pixels upward) corresponding to the image block B2, and the image block B2' is a reference image block corresponding to the image block a 2. Likewise, the reference image block corresponding to image block a3 may be determined to be image block B3'. Further, a template for tile A2 may be determined from tile B2 'and tile B3', as illustrated in FIG. 3A.
In one example, the candidate image blocks may include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1 and N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 and N is a natural number greater than or equal to 1. The first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block.
Obtaining the template of the current image block according to the motion information of the candidate image block may include, but is not limited to: determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks; and determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks. Then, determining the first template as the template of the current image block; or, determining the second template as the template of the current image block; or determining the first template and the second template as the template of the current image block after splicing.
For example, when M is a natural number greater than or equal to 1 and N is 0, the first template may be determined according to the motion vector prediction modes and the motion information of the M first candidate image blocks, and the first template may be determined as the template of the current image block. When N is a natural number greater than or equal to 1 and M is 0, the second template may be determined according to the motion vector prediction modes and the motion information of the N second candidate image blocks, and the second template may be determined as the template of the current image block. When M is a natural number greater than or equal to 1 and N is a natural number greater than or equal to 1, determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks, determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks, and determining the first template as the template of the current image block; or determining the second template as the template of the current image block; or determining the first template and the second template as the template of the current image block after splicing.
The first candidate image block comprises an adjacent image block and/or a secondary adjacent image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the secondary adjacent image block is an inter mode. For example, the first candidate image block may include at least one neighboring image block whose prediction mode is an inter mode, e.g., all neighboring image blocks on an upper side of the current image block, or a first neighboring image block on an upper side of the current image block, or any one or more neighboring image blocks on an upper side of the current image block. In addition, when the adjacent image blocks on the upper side of the current image block are both in intra mode, the first candidate image block may further include at least one secondary adjacent image block whose prediction mode is in inter mode, for example, all secondary adjacent image blocks on the upper side of the current image block, or the first secondary adjacent image block on the upper side of the current image block, or any one or more secondary adjacent image blocks on the upper side of the current image block. Furthermore, when there are neighboring image blocks in intra mode on the top side of the current image block, then the first candidate image block may also include neighboring image blocks in intra mode, for example, a neighboring image block in first intra mode on the top side of the current image block, neighboring image blocks in all intra modes on the top side of the current image block, and so on. Of course, the above is only an example of the first candidate image block, and the method is not limited thereto.
The second candidate image block comprises an adjacent image block on the left side of the current image block and/or a secondary adjacent image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the secondary adjacent image block is an inter mode. For example, the second candidate image block may include at least one neighboring image block whose prediction mode is an inter mode, e.g., all neighboring image blocks on the left side of the current image block, or a first neighboring image block on the left side of the current image block, or any one or more neighboring image blocks on the left side of the current image block. Furthermore, when the adjacent image blocks on the left side of the current image block are all in intra mode, the second candidate image block may further include at least one secondary adjacent image block of which the prediction mode is in inter mode, for example, all secondary adjacent image blocks on the left side of the current image block, or the first secondary adjacent image block on the left side of the current image block, or any one or more secondary adjacent image blocks on the left side of the current image block. Furthermore, when there is an intra-mode neighboring image block on the left side of the current image block, then the first candidate image block may also include intra-mode neighboring image blocks, e.g., the first intra-mode neighboring image block on the left side of the current image block, all intra-mode neighboring image blocks on the left side of the current image block, etc. Of course, the above is only an example of the second candidate image block, and the method is not limited thereto.
Wherein, the neighboring image blocks of the current image block include but are not limited to: spatial adjacent image blocks of the current image block (i.e. adjacent image blocks in the same frame of video image); or temporally neighboring image blocks of the current image block (i.e., neighboring image blocks in a different frame of the video image). The secondary neighboring image blocks of the current image block include, but are not limited to: the spatial domain secondary adjacent image blocks of the current image block (namely the secondary adjacent image blocks in the same frame of video image); or a temporal secondary neighboring image block of the current image block (i.e., a secondary neighboring image block in a different frame of video image).
In an example, when M is greater than 1, the first template may include M sub-templates or P sub-templates, and the M sub-templates or the P sub-templates are spliced, where P may be the number of first candidate image blocks in the inter mode, and P is less than or equal to M. For example, when the M first candidate image blocks are all candidate image blocks in the inter mode, the first template may include M sub-templates, and the M sub-templates are spliced together. For another example, when the M first candidate image blocks include candidate image blocks in P inter modes and include candidate image blocks in M-P intra modes, the first template may include M sub-templates (i.e., one sub-template for each candidate image block) and is formed by splicing the M sub-templates, or the first template may include P sub-templates (i.e., P sub-templates for the candidate image blocks in P inter modes) and is formed by splicing the P sub-templates.
Furthermore, when M is equal to 1, the first template may include a first sub-template, which may be determined according to the motion vector prediction mode and the motion information of the first candidate image block on the upper side of the current image block; alternatively, the first sub-template may be determined according to the motion vector prediction mode and the motion information of any candidate image block on the upper side of the current image block. Since the first candidate image block includes at least one adjacent image block or a sub-adjacent image block whose prediction mode is the inter mode, when M is equal to 1, the first template includes a first sub-template corresponding to the adjacent image block or the sub-adjacent image block in the inter mode.
In one example, the motion information may include a motion vector and a reference frame index of the first candidate image block, based on which the first template is determined according to the motion vector prediction modes and the motion information of the M first candidate image blocks, which may include but is not limited to:
in the first case, for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter-frame mode, a reference frame image corresponding to the ith candidate image block is determined according to a reference frame index; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block; then, image blocks with the sizes of the first transverse length and the first longitudinal length may be obtained as the ith sub-template included in the first template according to the determined reference image block.
And secondly, for the ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be the intra-frame mode, filling the ith candidate image block according to a default value (such as a default pixel value, which may be an empirically preconfigured brightness value), and acquiring the image blocks with the sizes of the first transverse length and the first longitudinal length as the ith sub-template included in the first template based on the image block filled with the default value.
Determining a reference frame image corresponding to the ith candidate image block according to a reference frame index corresponding to the ith candidate image block when the motion vector prediction mode of the ith candidate image block is determined to be the intra-frame mode; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with (equal to or approximately equal to) the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a first transverse length and a first longitudinal length as an ith sub-template included in the first template; and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of the image block adjacent to the ith candidate image block.
The first lateral length and the lateral length of the first candidate image block satisfy a first proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc., which is not limited), or satisfy a second proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc.) with the lateral length of the current image block, or are equal to a first preset length (configured empirically).
The first vertical length and the vertical length of the first candidate image block satisfy a third proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc.), or satisfy a fourth proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc.) with the vertical length of the current image block, or equal to a second preset length (i.e., a length configured empirically).
The first proportional relationship, the second proportional relationship, the third proportional relationship and the fourth proportional relationship may be the same or different. The first preset length and the second preset length may be set to be the same or different.
In an example, when N is greater than 1, the second template may include N sub-templates or R sub-templates, and the N sub-templates or R sub-templates are spliced, where R may be the number of second candidate image blocks in the inter mode, and R is less than or equal to N. For example, when the N second candidate image blocks are all candidate image blocks in the inter mode, the second template may include N sub-templates, and the N sub-templates are spliced together. For another example, when the N second candidate image blocks include candidate image blocks in R inter modes and include candidate image blocks in N-R intra modes, the second template may include N sub-templates (i.e., one sub-template for each candidate image block) and is formed by splicing the N sub-templates, or the second template may include R sub-templates (i.e., R sub-templates for the candidate image blocks in R inter modes) and is formed by splicing the R sub-templates.
Furthermore, when N is equal to 1, the second template may include a second sub-template, which may be determined according to the motion vector prediction mode and the motion information of the first candidate image block on the left side of the current image block; alternatively, the second sub-template may be determined according to the motion vector prediction mode and the motion information of any candidate image block on the left side of the current image block. The second candidate image block includes at least one adjacent image block or a second adjacent image block of which the prediction mode is the inter mode, and therefore when N is equal to 1, the second template includes a second sub-template corresponding to the adjacent image block or the second adjacent image block of the inter mode.
In one example, the motion information may include a motion vector and a reference frame index of the second candidate image block, based on which the second template is determined according to the motion vector prediction modes and the motion information of the N second candidate image blocks, which may include but is not limited to:
in case one, for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter-frame mode, determining a reference frame image corresponding to the ith candidate image block according to a reference frame index; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block; then, image blocks having the sizes of the second transverse length and the second longitudinal length may be obtained as the ith sub-template included in the second template according to the determined reference image block.
And in a second case, for an ith candidate image block in the N second candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is the intra-frame mode, filling the ith candidate image block according to a default value (for example, a default pixel value, which may be a luminance value configured in advance according to experience), and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as an ith sub-template included in the second template based on the image block filled with the default value.
Determining a reference frame image corresponding to the ith candidate image block according to a reference frame index corresponding to the ith candidate image block when the motion vector prediction mode of the ith candidate image block is determined to be the intra-frame mode; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with (equal to or approximately equal to) the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a second transverse length and a second longitudinal length as an ith sub-template included in the first template; and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of the image block adjacent to the ith candidate image block.
The second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc., which is not limited), or satisfy a sixth proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc.) with the horizontal length of the current image block, or are equal to a third preset length (configured empirically).
The second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc.), or satisfy an eighth proportional relationship (e.g., 1: 1, 1: 2, 2: 1, etc.) with the vertical length of the current image block, or are equal to a fourth preset length (i.e., a length configured empirically).
The fifth proportional relation, the sixth proportional relation, the seventh proportional relation and the eighth proportional relation may be the same or different. The third preset length and the fourth preset length may be set to be the same or different.
In an example, obtaining the template of the current image block according to the motion information of the candidate image block may further include, but is not limited to: when the current image block corresponds to a plurality of pieces of motion information, a template corresponding to the motion information is obtained according to each piece of motion information, and the obtaining mode of each template refers to the above embodiment. Then, a weight parameter corresponding to each piece of motion information is obtained, and a template of the current image block is obtained according to the weight parameter corresponding to each piece of motion information and the template corresponding to the motion information. For example, the template of the current image block is obtained based on a weighted average method based on the weight parameter corresponding to each piece of motion information and the template corresponding to the piece of motion information.
For example, the current image block corresponds to motion information a and motion information B, the template a corresponding to the motion information a is obtained by using the above embodiment, and the template B corresponding to the motion information B is obtained by using the above embodiment.
Then, the weight parameter 1 of the motion information a and the weight parameter 2 of the motion information B may be obtained, so that the template of the current image block may be (template a × weight parameter 1+ template B × weight parameter 2)/2.
The template of the current image block is described in detail below with reference to several specific cases.
The first condition is as follows: referring to fig. 3B, the candidate image blocks may include neighboring image blocks of all inter modes on the upper side of the current image block and neighboring image blocks of all inter modes on the left side of the current image block.
For the current block a1, if there are neighboring blocks of the inter mode, such as block A3 and block a4, on the left side, the block A3 and block a4 of the inter mode may be determined as candidate blocks for the current block a 1. Similarly, if there are neighboring tiles of the inter mode, such as tile a2, on the upper side, the tile a2 of the inter mode may be determined as a candidate tile for the current tile a 1.
If there is no available image block on the left side, or if the available image blocks are all in intra mode although there is an available image block on the left side, it may indicate that there is no candidate image block on the left side of the current image block a 1. Similarly, if there is no available image block on the upper side, or if the available image blocks are all in intra mode although there is an available image block on the upper side, it may indicate that there is no candidate image block on the upper side of the current image block a 1. If neither the left side nor the top side has a candidate image block, it may indicate that the current image block a1 has no candidate image block.
In addition, if the current image block a1 has no candidate image block, the technical solution of the present embodiment is not adopted, but a conventional manner is adopted, which is not described again. If there are candidate image blocks in the current image block a1, such as a left candidate image block and/or an upper candidate image block, the technical solution of the present embodiment is adopted.
In an example, after determining that the candidate image block is the image block a2, the image block A3, and the image block a4, the template of the current image block a1 may be obtained according to the motion information of the image block a2, the motion information of the image block A3, and the motion information of the image block a 4. For example, for the tile a2, a reference frame image corresponding to the tile a2 may be determined according to the reference frame index, the tile B2 corresponding to the tile a2 is selected from the reference frame image, and the tile B2 is moved according to the motion vector of the tile a2 to obtain a reference tile B2 ' corresponding to the tile a2, and similarly, a reference tile B3 ' corresponding to the tile A3 and a reference tile B4 ' corresponding to the tile a4 may be obtained, as shown in fig. 3C. The template for the current tile A1 may then be obtained from reference tile B2 ', reference tile B3 ', and reference tile B4 '.
In an example, assuming that the lateral length of the upper template of the current image block a1 is W, the longitudinal length is S, the value of W may be configured empirically, the value of S may be configured empirically, and the values of W and S are not limited. For example, W may be the lateral length of the current image block A1, the lateral length of the candidate image block A2, 2 times the lateral length of the current image block A1, or the like, S may be the longitudinal length of the candidate image block A2, 1/3 the longitudinal length of the candidate image block A2, or the like. On the basis, refer to fig. 3D, which is a schematic diagram of a template corresponding to the reference image block B2'. In fig. 3D, W is taken as the lateral length of candidate image block a2 as an example, i.e. W is the lateral length of reference image block B2'; s is taken as 1/3, the longitudinal length of candidate image block a2, i.e., S is 1/3, the longitudinal length of reference image block B2'.
Assuming that the transverse length of the left template of the current image block a1 is R, the longitudinal length is H, the value of R may be configured according to experience, the value of H may be configured according to experience, and the values of R and H are not limited. For example, H may be the longitudinal length of the current image block A1, the longitudinal length of the candidate image block A3, R may be the lateral length of the candidate image block A3, 1/3 which is the lateral length of the candidate image block A3, or the like. On this basis, referring to fig. 3D, a template diagram corresponding to the reference image block B3' is shown, where H is taken as the longitudinal length of the candidate image block A3, and R is taken as the 1/3 of the transverse length of the candidate image block A3.
Similarly, the template page corresponding to the reference image block B4' can be seen in fig. 3D, and is not described herein again.
In one example, assuming that there are M candidate image blocks with different modes on the top side of the current image block, for the ith candidate image block, its lateral length is assumed to be wiThen, the prediction mode of the candidate image block is determined.
In the case of the intra mode, the sub-template is not generated any more, or is filled in by a default value (for example, a default pixel value, which may be a luminance value configured in advance according to experience) as the ith sub-template of the upper template.
If the image is in the inter-frame mode, motion information (such as a motion vector and a reference frame index) of the ith candidate image block is acquired, and a horizontal length w is generated based on the motion vector and the reference frame indexiThe template with the longitudinal length S is used as the ith sub-template of the upper template. Specifically, if the motion vector is MV and the reference frame index is idx, find the horizontal length w with the relative position offset MV in the idx-th reference picture of the current frameiAnd the rectangular block with the longitudinal length of S is used as the ith sub-template of the upper template.
Assuming that there are N candidate image blocks with different modes on the left side of the current image block, for the ith candidate image block, assuming that the longitudinal length is hiAnd if the transverse length is R, judging the prediction mode of the candidate image block.
In the intra mode, no sub-template is generated, or the left side template is filled with default values (e.g., default pixel values, which may be empirically pre-configured luminance values) as the ith sub-template.
If the image is in the inter-frame mode, motion information (such as a motion vector, a reference frame index and the like) of the ith candidate image block is acquired, and a horizontal length R and a vertical length h are generated based on the motion vector and the reference frame indexiAs the ith sub-template of the left template. Specifically, if the motion vector is MV and the reference frame index is idx, then a relative position offset is found in the idx-th reference picture of the current frameThe transverse length of the shift to MV is R and the longitudinal length of the shift to MV is hiAs the ith sub-template of the left template.
Further, the upper side template can be formed by splicing all the sub-templates on the upper side, the left side template can be formed by splicing all the sub-templates on the left side, and the upper side template and the left side template are spliced into the template of the current image block.
Case two: referring to fig. 3E, the candidate image blocks may include a first inter-mode adjacent image block on the upper side of the current image block and a first inter-mode adjacent image block on the left side of the current image block.
For the current tile A1, if the first tile A3 on the left is inter mode, then tile A3 may be determined to be a candidate tile for the current tile A1. If the first tile A2 on the upper side is in inter mode, then tile A2 may be determined to be a candidate tile for the current tile A1.
Wherein if no image block is available on the left side, or if the first image block on the left side is in intra mode, then there is no candidate image block on the left side of the current image block a 1. If there is no available image block on the upper side, or the first image block on the upper side is in intra mode, there is no candidate image block on the upper side of the current image block a 1. If neither the left nor the top side has a candidate image block, the current image block a1 has no candidate image block.
Further, if the current image block a1 has no candidate image block, the technical solution of the present embodiment is not adopted, but a conventional method is adopted, which is not described again. If there are candidate image blocks in the current image block a1, such as a left candidate image block and/or an upper candidate image block, the technical solution of the present embodiment is adopted.
After determining that the candidate image blocks are the image block a2 and the image block A3, the template of the current image block a1 may be obtained according to the motion information of the image block a2 and the motion information of the image block A3. For example, the reference frame image corresponding to the image block a2 may be determined according to the reference frame index, the image block B2 corresponding to the image block a2 is selected from the reference frame image, the image block B2 is moved according to the adjacent motion vector of the image block a2 to obtain the reference image block B2 'corresponding to the image block a2, and similarly, the reference image block B3' corresponding to the image block A3 may be obtained, and the template may be obtained according to the reference image block B2 'and the reference image block B3'.
In an example, assuming that the lateral length of the upper template of the current image block a1 is W, the longitudinal length is S, the value of W may be configured empirically, the value of S may be configured empirically, and the values of W and S are not limited. For example, W may be the lateral length of the current image block A1, the lateral length of the candidate image block A2, S may be the longitudinal length of the candidate image block A2, 1/3 which is the longitudinal length of the candidate image block A2, or the like. Referring to fig. 3F, it is a schematic diagram of a template corresponding to the reference image block B2'.
Assuming that the transverse length of the left template of the current image block a1 is R, the longitudinal length is H, the value of R may be configured according to experience, the value of H may be configured according to experience, and the values of R and H are not limited. For example, H may be the longitudinal length of the current image block A1, the longitudinal length of the candidate image block A3, or the like, and R may be the lateral length of the candidate image block A3, 1/3 which is the lateral length of the candidate image block A3, or the like. On the basis, refer to fig. 3F, which is a schematic diagram of a template corresponding to the reference image block B3'.
In one example, assuming that there are M candidate image blocks with different modes on the upper side of the current image block, the prediction mode of the candidate image block is determined for the first candidate image block on the upper side, assuming that the lateral length is w. In the intra mode, no template is generated, or the template is filled in with default values (e.g., default pixel values, which may be empirically pre-configured luminance values) as the upper template. If the image block is in the inter-frame mode, motion information (such as a motion vector, a reference frame index and the like) of the candidate image block is acquired, and a template with a horizontal length w and a vertical length S is generated as an upper template based on the motion vector and the reference frame index.
And (2) assuming that N candidate image blocks with different modes exist on the left side of the current image block, and for the first candidate image block on the left side, assuming that the longitudinal length is h and the transverse length is R, judging the prediction mode of the candidate image block. If the mode is the intra-frame mode, no template is generated, or the template is filled according to a default value to be used as a left template. If the image block is in the inter-frame mode, motion information (such as a motion vector and a reference frame index) of the candidate image block is acquired, and a template with the transverse length of R and the longitudinal length of h is generated as a left template based on the motion vector and the reference frame index.
Case three: referring to fig. 3G, the candidate image blocks may include a first inter-mode adjacent image block on the upper side of the current image block and a first inter-mode adjacent image block on the left side of the current image block.
Compared with fig. 3F in the second case, in the third case, the horizontal length W of the upper template of the current image block a1 is taken as the horizontal length of the current image block a1, and the vertical length H of the left template of the current image block a1 is taken as the vertical length of the current image block a1, which are similar to those in the second case and are not repeated.
Case four: referring to fig. 3H, the candidate image blocks may include an inter-mode adjacent image block on the upper side of the current image block, a sub-adjacent image block on the upper side of the current image block (i.e., when the adjacent image block is in the intra-frame mode, the image block corresponding to the adjacent image block is selected to be the sub-adjacent image block to the current image block), an inter-mode adjacent image block on the left side of the current image block, and a sub-adjacent image block on the left side of the current image block.
For example, for the current block a1, there are neighboring blocks in the inter mode on the left side, such as block A3 and block a4, the blocks A3 and a4 in the inter mode may be determined as candidate blocks for the current block a 1. Similarly, if there is an adjacent image block in the inter mode, such as the image block a2, on the upper side, the image block a2 in the inter mode may be determined as a candidate image block for the current image block a 1.
Further, an adjacent image block in intra mode, such as image block a7, exists on the left, and image block a7 has image block A8 in inter mode on the left, i.e., image block A8 is the next adjacent image block to the left of the current image block a1, and thus, image block A8 in inter mode may be determined as a candidate image block for the current image block a 1.
Similarly, an adjacent image block in intra mode, such as image block a5, exists on the upper side, and image block a5 has image block a6 in inter mode on the upper side, i.e., image block a6 is the next adjacent image block on the upper side of the current image block a1, and thus, image block a6 in inter mode may be determined as a candidate image block for the current image block a 1.
After determining that the candidate image block is the image block a2, the image block A3, the image block a4, the image block A6, and the image block A8, a template of the current image block a1 is obtained according to the motion information of the image block a2, the motion information of the image block A3, the motion information of the image block a4, the motion information of the image block A6, and the motion information of the image block A8, where the specific obtaining manner is as in the case one, only obtaining the template according to the motion information of the image block A6 and the motion information of the image block A8 is needed, and is not described herein, and the template is finally shown in fig. 3I.
Case five: referring to fig. 3J, if the first adjacent image block on the upper side of the current image block is in the intra mode and the image block on the upper side of the first adjacent image block is in the inter mode, the candidate image blocks may include a second adjacent image block in the inter mode on the upper side of the current image block. In addition, if the first adjacent image block on the left side of the current image block is in the intra mode and the image block on the left side of the first adjacent image block is in the inter mode, the candidate image blocks may include a second adjacent image block in the inter mode on the left side of the current image block.
For the current block a1, if the first block a2 in the upper side is in intra mode and there is an inter-mode block a4 in the upper side of block a2, i.e., block a4 is the next adjacent block in the upper side of the current block a1, then block a4 in inter mode may be determined as a candidate block for the current block a 1.
Further, if the first tile A3 on the left is in intra mode and there is a tile A5 in inter mode on the left of tile A3, i.e., tile A5 is the next adjacent tile to the left of the current tile A1, then tile A5 in inter mode may be determined to be a candidate tile for the current tile A1.
After determining that the candidate image blocks are the image block a4 and the image block a5, a template of the current image block a1 may be obtained according to the motion information of the image block a4 and the motion information of the image block a5, where the specific obtaining manner is referred to as case two and case three, which is not described herein again, and the template is finally referred to as shown in fig. 3K or fig. 3L.
Case six: referring to fig. 3H, the candidate image blocks may include neighboring image blocks of an inter mode on an upper side of the current image block, neighboring image blocks of an intra mode on an upper side of the current image block, neighboring image blocks of an inter mode on a left side of the current image block, and neighboring image blocks of an intra mode on a left side of the current image block.
For example, for the current block a1, there are neighboring blocks in the inter mode on the left side, such as block A3 and block a4, the blocks A3 and a4 in the inter mode may be determined as candidate blocks for the current block a 1. Similarly, if there is an adjacent image block in the inter mode, such as the image block a2, on the upper side, the image block a2 in the inter mode may be determined as a candidate image block for the current image block a 1.
The neighboring tile of the left side in intra mode, such as tile a7, may determine tile a7 in intra mode as a candidate tile for current tile a 1. The neighboring image block having the intra mode at the upper side, such as the image block a5, may determine the image block a5 of the intra mode as a candidate image block of the current image block a 1.
After determining that the candidate image block is the image block a2, the image block A3, the image block a4, the image block a5, and the image block a7, a template of the current image block a1 is obtained according to the motion information of the image block a2, the motion information of the image block A3, the motion information of the image block a4, the motion information of the image block a5, and the motion information of the image block a7, where the specific obtaining manner is as in the case one, only obtaining the template according to the motion information of the image block a5 and the motion information of the image block a7 is needed, and is not described herein again, and the template is finally shown in fig. 3M.
It should be noted that, when the template is obtained according to the motion information of the image block a5, since the image block a5 is in intra mode and has no motion information, the motion information of an adjacent image block (i.e., the image block a6) of the image block a5 may be determined as the motion information of the image block a5, and after the motion information of the image block a5 is obtained, the template may be obtained according to the motion information of the image block a5, as shown in the case one.
Similarly, when the template is acquired based on the motion information of the image block a7, since the image block a7 is in intra mode and has no motion information, it is possible to determine the motion information of an adjacent image block to the image block a7 (i.e., the image block A8) as the motion information of the image block a5 and acquire the template using the motion information of the image block a 5.
Case seven: referring to fig. 3J, if the first adjacent image block on the upper side of the current image block is in the intra mode and the image block on the upper side of the first adjacent image block is in the inter mode, the candidate image blocks may include the adjacent image block in the first intra mode on the upper side of the current image block. In addition, if the first neighboring image block on the left side of the current image block is in intra mode and the image block on the left side of the first neighboring image block is in inter mode, the candidate image blocks may include the neighboring image block on the left side of the current image block in the first intra mode.
For the current block a1, if the first block a2 on the top side is in intra mode, block a4 in inter mode exists on the top side of block a2, and block a2 in intra mode is determined to be a candidate block for the current block a 1. If the first image block A3 on the left is in intra mode, there is an image block A5 in inter mode on the left side of image block A3, and the image block A3 in intra mode is determined to be a candidate image block for the current image block A1.
After determining that the candidate image blocks are the image block a2 and the image block A3, a template of the current image block a1 may be obtained according to the motion information of the image block a2 and the motion information of the image block A3, where the specific obtaining manner is referred to as case two and case three, which is not described herein again, and the template is finally referred to as shown in fig. 3N or 3O.
It is to be noted that, when acquiring the template from the motion information of the image block a2, since the image block a2 is in intra mode and has no motion information, it is possible to determine the motion information of an adjacent image block of the image block a2 (i.e., the image block a4) as the motion information of the image block a2 and acquire the template using the motion information of the image block a 2. When the template is acquired from the motion information of the image block A3, since the image block A3 is in intra mode and has no motion information, it is possible to determine the motion information of an adjacent image block of the image block A3, that is, the image block a5, as the motion information of the image block A3 and acquire the template using the motion information of the image block A3.
Example three:
in step 203, the encoding end obtains a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, and the implementation flow thereof can be shown in fig. 4A and may include:
in step 401, the encoding end determines the original motion vector as the central motion vector.
In step 402, the encoding end determines an edge motion vector corresponding to the center motion vector.
Wherein the edge motion vector may be different from the center motion vector.
The determining, by the encoding end, the edge motion vector corresponding to the center motion vector may include: and shifting the central motion vector (x, y) to different directions by S, thereby obtaining edge motion vectors (x-S, y), edge motion vectors (x + S, y), edge motion vectors (x, y + S) and edge motion vectors (x, y-S) in different directions. For example, in the horizontal direction, the center motion vector (x, y) may be shifted to the left by S, resulting in an edge motion vector (x-S, y); in the horizontal direction, the central motion vector (x, y) may be shifted to the right by S, resulting in an edge motion vector (x + S, y); in the vertical direction, the central motion vector (x, y) may be shifted upwards by S, resulting in an edge motion vector (x, y + S); in the vertical direction, the center motion vector (x, y) may be shifted downward by S, resulting in an edge motion vector (x, y-S).
The initial value of S may be empirically configured, and may be 2, 4, 8, 16, etc.
Assuming that the center motion vector is (3, 3) and S is 4, the edge motion vectors are edge motion vector (7, 3), edge motion vector (3, 7), edge motion vector (-1, 3), edge motion vector (3, -1).
And 403, the encoding end obtains the encoding performance of the central motion vector according to the template of the current image block and obtains the encoding performance of the edge motion vector according to the template of the current image block.
In the first case, the encoding end obtains the encoding performance of the central motion vector according to the template of the current image block, which may include but is not limited to: and determining the coding performance of the central motion vector according to the parameter information of the template of the current image block and the parameter information of the first target reference block, wherein the first target reference block can be an image block obtained after the reference image block corresponding to the template is subjected to offset based on the central motion vector. Specifically, the encoding end may determine the prediction performance of the central motion vector according to the parameter information of the template and the parameter information of the first target reference block, and determine the encoding performance of the central motion vector according to the prediction performance of the central motion vector; for example, the encoding performance of the center motion vector may be determined according to the prediction performance and the actual number of bits required for encoding.
Wherein, the parameter information may be a brightness value; alternatively, there may be luminance values and chrominance values.
Assuming that the parameter information is a luminance value, in order to determine the encoding performance of the central motion vector, a luminance value of a template of the current image block and a luminance value of the first target reference block may be obtained first. For example, after obtaining the template of the current image block, the luminance value of each pixel point of the template may be obtained, and a reference image block of the template may be obtained, assuming that the central motion vector is (3, 3), the reference image block may be moved by using the central motion vector (3, 3), and an image block X corresponding to the reference image block is obtained (for example, the reference image block is moved rightward by 3 pixel points, the processed image block is recorded as the image block X, and the image block X is the first target reference block, and the luminance value of each pixel point of the image block X may be obtained.
Based on the brightness value of each pixel point of the template and the brightness value of each pixel point of the image block X, the prediction performance of the central motion vector can be determined by adopting the following formula:
Figure BDA0001712805450000241
SAD is the sum of the available absolute differences, used to representPrediction performance of the central motion vector. TMiThe brightness value, TMP, of the ith pixel point of the templateiAnd the brightness value of the ith pixel point of the image block X is represented, and M represents the total number of the pixel points.
Assuming that the parameter information is a luminance value and a chrominance value, the following formula is used
Figure BDA0001712805450000242
Determining the brightness value prediction performance SAD of the central motion vector, and determining the chroma value prediction performance of the central motion vector by adopting the following formula:
Figure BDA0001712805450000243
the average of the luminance value prediction performance SAD and the chrominance value prediction performance CSAD is the prediction performance of the central motion vector. Where CSAD is the sum of available absolute differences for representing chroma value prediction performance, CTM, of the central motion vectoriExpressing the chroma value, CTMP, of the ith pixel point of the templateiExpressing the colorimetric value, M, of the ith pixel point of the image block XcIndicating the total number of pixels.
Further, after the prediction performance of the central motion vector is obtained, the coding performance of the central motion vector may be determined according to the prediction performance and the actual number of bits required for coding. For example, RDO (Rate distortion optimized) may be used to determine the coding performance of the center motion vector, and RDO generally determines the coding performance of the center motion vector by using the following formula: j ═ D + λ R. Wherein J represents the coding performance, D represents the prediction performance, λ is a lagrange multiplier, which is a value configured according to experience, and R is the actual number of bits required for image block coding, i.e., the sum of bits of the coded bitstream carrying information.
In case two, the encoding end obtains the encoding performance of the edge motion vector according to the template of the current image block, which may include but is not limited to: and determining the encoding performance of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of the second target reference block, wherein the second target reference block can be an image block obtained after the reference image block corresponding to the template is subjected to offset based on the edge motion vector. Specifically, the encoding end may determine the prediction performance of the edge motion vector according to the parameter information of the template and the parameter information of the second target reference block, and determine the encoding performance of the central motion vector according to the prediction performance of the edge motion vector; for example, the encoding performance of the edge motion vector may be determined according to the prediction performance and the actual number of bits required for encoding.
Wherein, the parameter information may be a brightness value; alternatively, there may be luminance values and chrominance values.
Case two is similar to case one, with the difference that: in case one, the reference image block of the template is moved by using the edge motion vector to obtain a second target reference block, and the coding performance of the edge motion vector is obtained by using the second target reference block, while in case two, the reference image block of the template is moved by using the center motion vector to obtain a first target reference block, and the coding performance of the center motion vector is obtained by using the first target reference block.
In step 404, the encoding end determines a target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector.
Specifically, the encoding end may select a motion vector with the optimal encoding performance from the center motion vector and the edge motion vector; when the motion vector with the optimal coding performance is not the original motion vector, the motion vector with the optimal coding performance can be determined as a target motion vector; when the motion vector with the optimal coding performance is the original motion vector, the coding end can select a motion vector with the suboptimal coding performance from the central motion vector and the edge motion vector, and determine the motion vector with the suboptimal coding performance as the target motion vector.
For example, if the motion vector with the best encoding performance is the edge motion vector (7, 3), the encoding end may determine the edge motion vector (7, 3) as the target motion vector. If the motion vector with the best coding performance is the central motion vector (3, 3), that is, the original motion vector, the coding end may also determine the motion vector with the suboptimal coding performance (such as the edge motion vector (7, 3), etc.) as the target motion vector.
Example four:
in step 203, the encoding end obtains a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, and the implementation flow thereof can be shown in fig. 4A and may include:
in step 411, the encoding end determines the original motion vector as the central motion vector.
In step 412, the encoding end determines an edge motion vector corresponding to the center motion vector.
Wherein the edge motion vector may be different from the center motion vector.
Step 413, the encoding end obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
For steps 411 to 413, refer to steps 401 to 403, which are not described herein again.
In step 414, the encoding end determines whether the iteration end condition of the target motion vector is satisfied.
If so, step 416 may be performed; if not, step 415 may be performed.
Wherein, the iteration end condition may include but is not limited to: the number of iterations reaches a threshold number, or the execution time reaches a time threshold, or the parameter S has been modified to a preset value, such as 1.
Of course, the above is only a few examples of the iteration end condition, and the iteration end condition is not limited.
In step 415, the encoding end selects a motion vector with the best encoding performance from the central motion vector and the edge motion vector, determines the motion vector with the best encoding performance as the central motion vector, and returns to step 412.
For example, if the motion vector with the best coding performance is the edge motion vector (7, 3), the edge motion vector (7, 3) may be determined as the center motion vector, and step 412 may be performed again, and so on.
When step 412 is performed for the first time, the value of the parameter S may be an initial value, such as 16. When step 412 is executed again, the value of the parameter S is first adjusted, for example, to be the last parameter S minus 2, or to be half of the last parameter S, and the like, which is not limited to this, as long as it is smaller than the last parameter S, and then the adjustment to be half of the last parameter S is taken as an example. Therefore, when step 412 is performed for the second time, the value of the parameter S is 8; when step 412 is executed for the third time, the value of the parameter S is 4; and so on.
After the value of the parameter S is adjusted, it is first determined whether the adjusted parameter S is less than or equal to a preset value, such as 1. If not, step 412 may be executed based on the adjusted parameter S, and details of this process are not repeated. If so, the value of the parameter S may be set to 1, and step 412 is executed based on the parameter S (i.e., the value of 1), and when the step 414 is executed, the iteration end condition is satisfied.
In step 416, the encoding end determines the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector.
The processing of step 416 may refer to step 404, and is not repeated here.
Example five:
in step 204, the encoding performance of the original motion vector and the encoding performance of the target motion vector may be obtained, and the encoding end obtains the encoding performance of the original motion vector, which may include but is not limited to: and determining the encoding performance of the original motion vector according to the parameter information of the template of the current image block and the parameter information of a third target reference block, wherein the third target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the original motion vector. Specifically, the prediction performance of the original motion vector may be determined according to the parameter information of the template and the parameter information of the third target reference block, and the encoding performance of the original motion vector may be determined according to the prediction performance; for example, the encoding performance of the original motion vector is determined according to the prediction performance and the actual number of bits required for encoding. Wherein, the parameter information may be a brightness value; or luminance values and chrominance values.
The encoding performance of the encoding end for obtaining the target motion vector may include, but is not limited to: and determining the coding performance of the target motion vector according to the parameter information of the template of the current image block and the parameter information of a fourth target reference block, wherein the fourth target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the target motion vector. Specifically, the prediction performance of the target motion vector may be determined according to the parameter information of the template and the parameter information of the fourth target reference block, and the encoding performance of the target motion vector may be determined according to the prediction performance; for example, the encoding performance of the target motion vector is determined based on the prediction performance and the actual number of bits required for encoding. Wherein, the parameter information may be a brightness value; or luminance values and chrominance values.
The above process is similar to the third embodiment, except that: when the third target reference block or the fourth target reference block is obtained, the original motion vector or the target motion vector is used to move the reference image block of the template, instead of the reference image block of the central motion vector moving template, and the details are not repeated here.
Example six:
referring to fig. 5, a flow chart of a motion vector determination method is schematically shown, where the method may include:
step 501, a decoding end obtains motion information of a candidate image block of a current image block.
The candidate image blocks of the current image block may include, but are not limited to: a spatial domain candidate image block of the current image block; or, a time domain candidate image block of the current image block; the candidate image block is not limited.
Step 502, the decoding end obtains the template of the current image block according to the motion information of the candidate image block.
The method for acquiring the template of the current image block by the decoding end according to the motion information of the candidate image block is the same as that of the encoding end, and reference may be specifically made to the related contents of embodiment two, which is not described herein again.
Step 503, the decoding end obtains a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, where the target motion vector may be different from the original motion vector.
In an example, before the decoding end obtains the motion information of the candidate image block of the current image block, the decoding end may further obtain a coded bit stream, where the coded bit stream may be sent by the encoding end, or obtained after the decoding end codes the bit stream, and this is not limited, and the example is that the encoding end sends the coded bit stream.
The decoding end may receive the encoded bitstream from the encoding end, when the encoded bitstream carries the first indication information, the first indication information is used to indicate that the final motion vector of the current image block is determined based on the template, the motion information of the candidate image block of the current image block may be obtained according to the first indication information, and the template of the current image block is obtained according to the motion information of the candidate image block, that is, the above step 501 and step 503 are performed.
The decoding end can receive the coded bit stream from the encoding end, and when the coded bit stream carries second indication information which is used for indicating that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block, the decoding end obtains the original motion vector corresponding to the current image block according to the second indication information, and determines the final motion vector of the current image block according to the original motion vector.
In practical application, the encoding end may also use an implicit method to notify, that is, the encoded bitstream does not carry the first indication information or the second indication information. Based on the above, the decoding end may obtain motion information of a candidate image block of the current image block according to locally preset first policy information, and obtain a template of the current image block according to the motion information of the candidate image block, where the first policy information is used to instruct that a final motion vector of the current image block is determined based on the template; or, the original motion vector corresponding to the current image block may be acquired according to second policy information preset locally; determining a final motion vector of the current image block according to the original motion vector, wherein the second strategy information is used for indicating that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block; or, third policy information may be obtained, where the third policy information is to determine a final motion vector of the current image block by using the same policy information as that of an adjacent image block of the current image block; then, according to the third strategy information, a final motion vector of the current image block is determined.
Specifically, the encoding end and the decoding end may also negotiate a motion vector decision policy or define a policy in a standard, and store the policy in the encoding end and the decoding end, for example, the motion vector decision policy may be default first policy information; or default second policy information; or default third policy information.
When the motion vector decision strategy is the default first strategy information, obtaining the motion information of the candidate image block of the current image block according to the locally preset first strategy information, and obtaining the template of the current image block according to the motion information of the candidate image block; when the motion vector decision strategy is the default second strategy information, acquiring an original motion vector corresponding to the current image block according to the second strategy information preset locally; determining a final motion vector of the current image block according to the original motion vector; when the motion vector decision strategy is third strategy information, if the strategy information of the adjacent image block is first strategy information, obtaining the motion information of a candidate image block of the current image block, and obtaining a template of the current image block according to the motion information of the candidate image block; if the strategy information of the adjacent image block is second strategy information, acquiring an original motion vector corresponding to the current image block; and determining the final motion vector of the current image block according to the original motion vector.
In an example, before obtaining a target motion vector based on a template according to an original motion vector corresponding to a current image block and an obtained template, a decoding end may further receive a coded bit stream from an encoding end, where the coded bit stream carries an index value of the original motion vector in a motion vector list; the decoding end can select the motion vector corresponding to the index value from the motion vector list; and determining the selected motion vector as the original motion vector corresponding to the current image block. If the index value is 1, the first motion vector of the motion vector list is obtained, and the motion vector is the original motion vector of the current image block. The motion vector list is used for recording motion vectors of image blocks adjacent to the current image block, and the motion vector list maintained by the decoding end is the same as the motion vector list maintained by the encoding end. Of course, the above-mentioned manner is only an example, and for example, the motion vector of the candidate image block of the current image block may be determined as the original motion vector corresponding to the current image block.
The processing procedure of obtaining the target motion vector based on the template by the decoding end according to the original motion vector corresponding to the current image block and the obtained template may refer to the subsequent embodiments, and is not described herein again.
In step 504, the decoding end determines a final motion vector of the current image block according to the target motion vector, for example, the target motion vector may be determined as the final motion vector of the current image block.
According to the technical scheme, the target motion vector can be obtained according to the original motion vector, the final motion vector of the current image block is determined according to the target motion vector, and the final motion vector of the current image block is not directly determined according to the original motion vector, so that the precision of the motion vector is improved, and the decoding performance is improved. Moreover, when the target motion vector is obtained according to the original motion vector, the template of the current image block can be obtained according to the motion information of the candidate image block, and the target motion vector is obtained according to the original motion vector based on the template of the current image block; the method can quickly obtain the template of the current image block, and then obtain the target motion vector according to the template, thereby improving the decoding efficiency and reducing the decoding time delay. For example, before the reconstruction stage of decoding, a template of the current image block may be obtained, and the target motion vector may be obtained according to the template.
Example seven:
in this embodiment, unlike the manner of generating the template by using the reconstruction information and the prediction information, the template of the current image block may be obtained according to the motion information (such as a motion vector and a reference frame index) of the candidate image block of the current image block. Specifically, the decoding end may determine a reference frame image corresponding to the candidate image block according to the reference frame index; and acquiring a reference image block corresponding to the candidate image block from the reference frame image according to the motion vector, and acquiring a template of the current image block according to the reference image block.
The candidate image blocks may include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1 and N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 and N is a natural number greater than or equal to 1. The first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block. The first candidate image block comprises an adjacent image block and/or a secondary adjacent image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the secondary adjacent image block is an inter mode. The second candidate image block comprises an adjacent image block on the left side of the current image block and/or a secondary adjacent image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the secondary adjacent image block is an inter mode.
Obtaining the template of the current image block according to the motion information of the candidate image block may include, but is not limited to: determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks; and determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks. Then, determining the first template as the template of the current image block; or, determining the second template as the template of the current image block; or determining the first template and the second template as the template of the current image block after splicing.
In an example, when M is greater than 1, the first template may include M sub-templates or P sub-templates, and the M sub-templates or the P sub-templates are spliced to form the first template, where P is the number of first candidate image blocks in the inter mode; when M is equal to 1, the first template may comprise a first sub-template determined according to the motion vector prediction mode and the motion information of the first candidate image block on the upper side of the current image block. When N is greater than 1, the second template may include N sub-templates or R sub-templates, and the N sub-templates or R sub-templates are spliced to form the second template, where R is the number of second candidate image blocks in the inter mode; when N is equal to 1, the second template may comprise a second sub-template determined according to the motion vector prediction mode and the motion information of the first candidate image block on the left side of the current image block.
In an example, obtaining the template of the current image block according to the motion information of the candidate image block may further include, but is not limited to: and when the current image block corresponds to a plurality of pieces of motion information, obtaining a template corresponding to the motion information according to each piece of motion information. And acquiring a weight parameter corresponding to each piece of motion information, and acquiring a template of the current image block according to the weight parameter corresponding to each piece of motion information and the template corresponding to the motion information.
The processing procedure of the seventh embodiment is similar to that of the second embodiment, and is not repeated here.
Example eight:
in step 503, the decoding end obtains a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, and the implementation flow thereof can be shown in fig. 6A and may include:
step 601, the decoding end determines the original motion vector as the central motion vector.
In step 602, the decoding end determines an edge motion vector corresponding to the center motion vector.
Wherein the edge motion vector may be different from the center motion vector.
Wherein determining the edge motion vector corresponding to the center motion vector may include: and shifting the central motion vector (x, y) to different directions by S to obtain edge motion vectors (x-S, y), edge motion vectors (x + S, y), edge motion vectors (x, y + S) and edge motion vectors (x, y-S) in different directions.
Step 603, the decoding end obtains the coding performance of the central motion vector according to the template of the current image block, and obtains the coding performance of the edge motion vector according to the template of the current image block.
The decoding end obtains the coding performance of the central motion vector according to the template of the current image block, which may include but is not limited to: the decoding end may determine the encoding performance of the central motion vector according to the parameter information of the template of the current image block and the parameter information of the first target reference block, where the first target reference block is an image block obtained after the reference image block corresponding to the template is shifted based on the central motion vector.
The decoding end obtains the encoding performance of the edge motion vector according to the template of the current image block, which may include but is not limited to: the decoding end may determine the encoding performance of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of the second target reference block, where the second target reference block is an image block obtained after the reference image block corresponding to the template is shifted based on the edge motion vector.
Step 604, the decoding end determines the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector.
Specifically, the decoding end may select a motion vector with the best coding performance from the center motion vector and the edge motion vector; when the motion vector with the optimal coding performance is not the original motion vector, the motion vector with the optimal coding performance can be determined as a target motion vector; when the motion vector with the optimal coding performance is the original motion vector, the decoding end can select a motion vector with the suboptimal coding performance from the central motion vector and the edge motion vector, and determine the motion vector with the suboptimal coding performance as the target motion vector.
The detailed processing flow of steps 601-604 can be seen from the third embodiment, except that the execution main body is changed from the encoding end to the decoding end, and other processing flows are the same, and are not repeated herein.
Example nine:
in step 503, the decoding end obtains a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, and the implementation flow thereof can be shown in fig. 6B and may include:
in step 611, the decoding end determines the original motion vector as the central motion vector.
In step 612, the decoding end determines an edge motion vector corresponding to the center motion vector.
Wherein the edge motion vector may be different from the center motion vector.
Step 613, the decoding end obtains the coding performance of the central motion vector according to the template of the current image block, and obtains the coding performance of the edge motion vector according to the template of the current image block.
In step 614, the decoding end determines whether the iteration end condition of the target motion vector is satisfied.
If so, step 616 may be performed; if not, step 615 may be performed.
Step 615, the decoding end selects the motion vector with the best coding performance from the central motion vector and the edge motion vector, determines the motion vector with the best coding performance as the central motion vector, and returns to step 612.
In step 616, the decoding end determines the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector.
The detailed processing flow of steps 611 to 616 can be seen in the fourth embodiment, except that the execution main body is changed from the encoding end to the decoding end, and other processing flows are the same, and are not repeated herein.
Example ten:
based on the same application concept as the method, an embodiment of the present application further provides a motion vector determining apparatus applied to a decoding end, as shown in fig. 7, which is a structural diagram of the apparatus, and the apparatus includes:
an obtaining module 71, configured to obtain motion information of a candidate image block of a current image block; acquiring a template of the current image block according to the motion information of the candidate image block; obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template; a determining module 72, configured to determine a final motion vector of the current image block according to the target motion vector.
The obtaining module 71 is further configured to: receiving a coded bit stream from a coding end, wherein the coded bit stream carries first indication information, and the first indication information is used for indicating that a final motion vector of the current image block is determined based on a template; and acquiring the motion information of a candidate image block of the current image block according to the first indication information, and acquiring the template of the current image block according to the motion information of the candidate image block.
The obtaining module 71 is further configured to: receiving a coded bit stream from a coding end, wherein the coded bit stream carries second indication information, and the second indication information is used for indicating that a final motion vector of a current image block is determined based on an original motion vector corresponding to the current image block; acquiring an original motion vector corresponding to the current image block according to the second indication information; and determining the final motion vector of the current image block according to the original motion vector.
The obtaining module 71 is further configured to: acquiring motion information of candidate image blocks of a current image block according to locally preset first strategy information, and acquiring a template of the current image block according to the motion information of the candidate image blocks; the first strategy information is used for indicating that a final motion vector of the current image block is determined based on a template; or acquiring an original motion vector corresponding to the current image block according to second strategy information preset locally; determining a final motion vector of the current image block according to the original motion vector; the second strategy information is used for indicating that a final motion vector of the current image block is determined based on an original motion vector corresponding to the current image block; or acquiring third strategy information, wherein the third strategy information is the final motion vector of the current image block determined by adopting the same strategy information as the adjacent image block of the current image block; and determining the final motion vector of the current image block according to the third strategy information.
The obtaining module 71 is further configured to: receiving a coded bit stream from a coding end, wherein the coded bit stream carries an index value of an original motion vector in a motion vector list; selecting a motion vector corresponding to the index value from a motion vector list; determining the selected motion vector as an original motion vector corresponding to the current image block; or, determining the motion vector of the candidate image block of the current image block as the original motion vector corresponding to the current image block.
The candidate image blocks comprise M first candidate image blocks and N second candidate image blocks, wherein M is a natural number which is greater than or equal to 1, N is a natural number which is greater than or equal to 0, or M is a natural number which is greater than or equal to 0, and N is a natural number which is greater than or equal to 1; the first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block; the obtaining module 71 is specifically configured to, when obtaining the template of the current image block according to the motion information of the candidate image block: determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks; determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks; determining the first template as the template of the current image block; or, determining the second template as the template of the current image block; or, determining the first template and the second template as the template of the current image block after splicing.
In one example, the first candidate image block includes an adjacent image block and/or a sub-adjacent image block on an upper side of the current image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; the prediction mode of the secondary adjacent image block is an inter-frame mode; the second candidate image block comprises an adjacent image block on the left side of the current image block and/or a secondary adjacent image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; and the prediction mode of the secondary adjacent image block is an inter-frame mode.
In an example, when M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or the P sub-templates, where P is the number of first candidate image blocks in the inter mode; and when M is equal to 1, the first template comprises a first sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the upper side of the current image block.
The motion information includes a motion vector and a reference frame index of the first candidate image block, and the obtaining module 71 is specifically configured to, when determining the first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks: for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block; and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as the ith sub-template included in the first template according to the determined reference image block.
The obtaining module 71, according to the motion vector prediction modes and the motion information of the M first candidate image blocks, is specifically configured to: for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as an ith sub-template included by the first template; or determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a first transverse length and a first longitudinal length as an ith sub-template included by the first template; and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
The first transverse length and the transverse length of the first candidate image block meet a first proportional relation, or the first transverse length and the transverse length of the current image block meet a second proportional relation, or the first transverse length and the transverse length of the current image block are equal to a first preset length;
the first longitudinal length and the longitudinal length of the first candidate image block meet a third proportional relation, or the first longitudinal length and the longitudinal length of the current image block meet a fourth proportional relation, or the first longitudinal length and the longitudinal length of the first candidate image block are equal to a second preset length.
In an example, when N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or the R sub-templates, where R is the number of second candidate image blocks in the inter mode; and when N is equal to 1, the second template comprises a second sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the left side of the current image block.
The motion information includes a motion vector and a reference frame index of the second candidate image block, and the obtaining module 71 is specifically configured to, when determining the second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks: for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block; and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as the ith sub-template included by the second template according to the determined reference image block.
The obtaining module 71, according to the motion vector prediction modes and the motion information of the N second candidate image blocks, is specifically configured to: for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as an ith sub-template included by the second template; or determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a second transverse length and a second longitudinal length as an ith sub-template included by the first template; and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
The second transverse length and the transverse length of the second candidate image block meet a fifth proportional relation, or the second transverse length and the transverse length of the current image block meet a sixth proportional relation, or the second transverse length and the transverse length of the current image block are equal to a third preset length;
the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or satisfy an eighth proportional relationship with the vertical length of the current image block, or are equal to a fourth preset length.
The obtaining module 71 is specifically configured to, when obtaining the template of the current image block according to the motion information of the candidate image block: when the current image block corresponds to a plurality of pieces of motion information, obtaining a template corresponding to the motion information according to each piece of motion information; and acquiring a weight parameter corresponding to each piece of motion information, and acquiring a template of the current image block according to the weight parameter corresponding to each piece of motion information and the template corresponding to the motion information.
The obtaining module 71 is specifically configured to, when obtaining the target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template: determining the original motion vector as a central motion vector; determining an edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector; obtaining the coding performance of the central motion vector and the coding performance of the edge motion vector according to the template; and determining the target motion vector from the central motion vector and the edge motion vector according to the coding performance of the central motion vector and the coding performance of the edge motion vector.
The obtaining module 71 is specifically configured to, when determining the edge motion vector corresponding to the center motion vector: and shifting the central motion vector (x, y) to different directions by S to obtain edge motion vectors (x-S, y), edge motion vectors (x + S, y), edge motion vectors (x, y + S) and edge motion vectors (x, y-S) in different directions.
The obtaining module 71 is specifically configured to, when obtaining the coding performance of the center motion vector and the coding performance of the edge motion vector according to the template: determining the coding performance of the central motion vector according to the parameter information of the template of the current image block and the parameter information of a first target reference block, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the central motion vector; and determining the encoding performance of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of a second target reference block, wherein the second target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the edge motion vector.
The obtaining module 71, according to the coding performance of the center motion vector and the coding performance of the edge motion vector, is specifically configured to: selecting a motion vector with the optimal coding performance from the central motion vector and the edge motion vector; when the motion vector with the optimal coding performance is not the original motion vector, determining the motion vector with the optimal coding performance as the target motion vector; and when the motion vector with the optimal coding performance is the original motion vector, selecting a motion vector with the suboptimal coding performance from the central motion vector and the edge motion vector, and determining the motion vector with the suboptimal coding performance as the target motion vector.
The obtaining module 71 is further configured to: judging whether an iteration end condition of the target motion vector is met; if yes, determining the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector; if not, selecting the motion vector with the optimal coding performance from the central motion vector and the edge motion vector, determining the motion vector with the optimal coding performance as the central motion vector, and returning to execute the operation of determining the edge motion vector corresponding to the central motion vector.
Based on the same application concept as the method, an embodiment of the present application further provides a motion vector determining apparatus, applied to a coding end, as shown in fig. 8, which is a structural diagram of the apparatus, and the apparatus includes:
an obtaining module 81, configured to obtain motion information of a candidate image block of a current image block; acquiring a template of the current image block according to the motion information of the candidate image block; obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template;
and a sending module 82, configured to send an encoded bitstream to a decoding end according to the original motion vector and the target motion vector.
The candidate image blocks comprise M first candidate image blocks and N second candidate image blocks, wherein M is a natural number which is greater than or equal to 1, N is a natural number which is greater than or equal to 0, or M is a natural number which is greater than or equal to 0, and N is a natural number which is greater than or equal to 1; the first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block; the obtaining module 81 is specifically configured to, when obtaining the template of the current image block according to the motion information of the candidate image block: determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks; determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks; determining the first template as the template of the current image block; or, determining the second template as the template of the current image block; or, determining the first template and the second template as the template of the current image block after splicing.
In one example, the first candidate image block includes an adjacent image block and/or a sub-adjacent image block on an upper side of the current image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; the prediction mode of the secondary adjacent image block is an inter-frame mode; the second candidate image block comprises an adjacent image block on the left side of the current image block and/or a secondary adjacent image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; and the prediction mode of the secondary adjacent image block is an inter-frame mode.
In an example, when M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or the P sub-templates, where P is the number of first candidate image blocks in the inter mode; and when M is equal to 1, the first template comprises a first sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the upper side of the current image block.
The motion information includes a motion vector and a reference frame index of the first candidate image block, and the obtaining module 81 is specifically configured to, when determining the first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks: for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block; and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as the ith sub-template included in the first template according to the determined reference image block.
The obtaining module 81 is specifically configured to, when determining the first template, according to the motion vector prediction modes and the motion information of the M first candidate image blocks: for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as an ith sub-template included by the first template; or determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a first transverse length and a first longitudinal length as an ith sub-template included by the first template; and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
The first transverse length and the transverse length of the first candidate image block meet a first proportional relation, or the first transverse length and the transverse length of the current image block meet a second proportional relation, or the first transverse length and the transverse length of the current image block are equal to a first preset length; the first longitudinal length and the longitudinal length of the first candidate image block meet a third proportional relation, or the first longitudinal length and the longitudinal length of the current image block meet a fourth proportional relation, or the first longitudinal length and the longitudinal length of the first candidate image block are equal to a second preset length.
In an example, when N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or the R sub-templates, where R is the number of second candidate image blocks in the inter mode; and when N is equal to 1, the second template comprises a second sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the left side of the current image block.
The motion information includes a motion vector and a reference frame index of the second candidate image block, and the obtaining module 81 is specifically configured to, when determining the second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks: for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block; and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as the ith sub-template included by the second template according to the determined reference image block.
The obtaining module 81 is specifically configured to, when determining the second template, according to the motion vector prediction modes and the motion information of the N second candidate image blocks: for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as an ith sub-template included by the second template; or determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a second transverse length and a second longitudinal length as an ith sub-template included by the first template; and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
The second transverse length and the transverse length of the second candidate image block meet a fifth proportional relation, or the second transverse length and the transverse length of the current image block meet a sixth proportional relation, or the second transverse length and the transverse length of the current image block are equal to a third preset length;
the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, and the second vertical length and the vertical length of the current image block satisfy an eighth proportional relationship, or equal to a fourth preset length.
The obtaining module 81 is specifically configured to, when obtaining the template of the current image block according to the motion information of the candidate image block: when the current image block corresponds to a plurality of pieces of motion information, obtaining a template corresponding to the motion information according to each piece of motion information; and acquiring a weight parameter corresponding to each piece of motion information, and acquiring a template of the current image block according to the weight parameter corresponding to each piece of motion information and the template corresponding to the motion information.
The obtaining module 81 is specifically configured to, when obtaining the target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template: determining the original motion vector as a central motion vector; determining an edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector; obtaining the coding performance of the central motion vector and the coding performance of the edge motion vector according to the template; and determining the target motion vector from the central motion vector and the edge motion vector according to the coding performance of the central motion vector and the coding performance of the edge motion vector.
The obtaining module 81 is specifically configured to, when determining the edge motion vector corresponding to the center motion vector: and shifting the central motion vector (x, y) to different directions by S to obtain edge motion vectors (x-S, y), edge motion vectors (x + S, y), edge motion vectors (x, y + S) and edge motion vectors (x, y-S) in different directions.
The obtaining module 81 is specifically configured to, when obtaining the coding performance of the center motion vector and the coding performance of the edge motion vector according to the template: determining the coding performance of the central motion vector according to the parameter information of the template of the current image block and the parameter information of a first target reference block, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the central motion vector; and determining the encoding performance of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of a second target reference block, wherein the second target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the edge motion vector.
The obtaining module 81 is specifically configured to, when determining the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector: selecting a motion vector with the optimal coding performance from the central motion vector and the edge motion vector; when the motion vector with the optimal coding performance is not the original motion vector, determining the motion vector with the optimal coding performance as the target motion vector; and when the motion vector with the optimal coding performance is the original motion vector, selecting a motion vector with the suboptimal coding performance from the central motion vector and the edge motion vector, and determining the motion vector with the suboptimal coding performance as the target motion vector.
The obtaining module 81 is further configured to: judging whether an iteration end condition of the target motion vector is met; if yes, determining the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector; if not, selecting the motion vector with the optimal coding performance from the central motion vector and the edge motion vector, determining the motion vector with the optimal coding performance as the central motion vector, and returning to execute the operation of determining the edge motion vector corresponding to the central motion vector.
The sending module 82 is specifically configured to, when sending the encoded bitstream to the decoding end according to the original motion vector and the target motion vector: acquiring the coding performance of the original motion vector and the coding performance of the target motion vector; and when the coding performance of the target motion vector is better than that of the original motion vector, sending a coding bit stream carrying first indication information to a decoding end, wherein the first indication information is used for indicating that the final motion vector of the current image block is determined based on a template.
The sending module 82 is specifically configured to, when sending the encoded bitstream to the decoding end according to the original motion vector and the target motion vector: acquiring the coding performance of the original motion vector and the coding performance of the target motion vector; and when the encoding performance of the original motion vector is better than that of the target motion vector, transmitting an encoding bit stream carrying second indication information to a decoding end, wherein the second indication information is used for indicating that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block.
The sending module 82 is specifically configured to, when sending the encoded bitstream to the decoding end according to the original motion vector and the target motion vector: acquiring an index value of the original motion vector in a motion vector list; and sending the coded bit stream carrying the index value to a decoding end.
When the sending module 82 obtains the encoding performance of the original motion vector, it is specifically configured to: determining the encoding performance of the original motion vector according to the parameter information of the template of the current image block and the parameter information of a third target reference block, wherein the third target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the original motion vector;
when the sending module 82 obtains the coding performance of the target motion vector, the sending module is specifically configured to: and determining the coding performance of the target motion vector according to the parameter information of the template of the current image block and the parameter information of a fourth target reference block, wherein the fourth target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the target motion vector.
In terms of hardware, the hardware architecture diagram of the decoding-side device provided in the embodiment of the present application may specifically refer to fig. 9. The method comprises the following steps: a processor 91 and a machine-readable storage medium 92, wherein: the machine-readable storage medium 92 stores machine-executable instructions executable by the processor 91; the processor 91 is configured to execute machine-executable instructions to implement the motion vector determination methods disclosed in the above examples.
Based on the same application concept as the method, embodiments of the present application further provide a machine-readable storage medium, where several computer instructions are stored, and when the computer instructions are executed by a processor, the method for determining a motion vector disclosed in the above example of the present application can be implemented.
In terms of hardware, the hardware architecture diagram of the encoding end device provided in the embodiment of the present application may specifically refer to fig. 10. The method comprises the following steps: a processor 93 and a machine-readable storage medium 94, the machine-readable storage medium 94 storing machine-executable instructions executable by the processor 93; the processor 93 is configured to execute machine-executable instructions to implement the motion vector determination methods disclosed in the above examples.
Based on the same application concept as the method, embodiments of the present application further provide a machine-readable storage medium, where several computer instructions are stored, and when the computer instructions are executed by a processor, the method for determining a motion vector disclosed in the above example of the present application can be implemented.
The machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (45)

1. A motion vector determination method, applied to a decoding side, comprising:
acquiring motion information of candidate image blocks of a current image block;
acquiring a template of the current image block according to the motion information of the candidate image block;
obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template;
and determining the final motion vector of the current image block according to the target motion vector.
2. The method of claim 1,
before the obtaining the motion information of the candidate image block of the current image block, the method further includes:
receiving a coded bit stream from a coding end, wherein the coded bit stream carries first indication information, and the first indication information is used for indicating that a final motion vector of the current image block is determined based on a template;
and acquiring the motion information of a candidate image block of the current image block according to the first indication information, and acquiring the template of the current image block according to the motion information of the candidate image block.
3. The method of claim 1, further comprising:
receiving a coded bit stream from a coding end, wherein the coded bit stream carries second indication information, and the second indication information is used for indicating that a final motion vector of a current image block is determined based on an original motion vector corresponding to the current image block;
acquiring an original motion vector corresponding to the current image block according to the second indication information;
and determining the final motion vector of the current image block according to the original motion vector.
4. The method of claim 1, further comprising:
acquiring motion information of candidate image blocks of a current image block according to locally preset first strategy information, and acquiring a template of the current image block according to the motion information of the candidate image blocks; the first strategy information is used for indicating that a final motion vector of the current image block is determined based on a template; alternatively, the first and second electrodes may be,
acquiring an original motion vector corresponding to the current image block according to second strategy information preset locally; determining a final motion vector of the current image block according to the original motion vector; the second strategy information is used for indicating that a final motion vector of the current image block is determined based on an original motion vector corresponding to the current image block; alternatively, the first and second electrodes may be,
acquiring third strategy information, wherein the third strategy information is the final motion vector of the current image block determined by adopting the same strategy information as the adjacent image block of the current image block;
and determining the final motion vector of the current image block according to the third strategy information.
5. The method according to any one of claims 1 to 4,
before obtaining the target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, the method further includes:
receiving a coded bit stream from a coding end, wherein the coded bit stream carries an index value of an original motion vector in a motion vector list; selecting a motion vector corresponding to the index value from a motion vector list;
and determining the selected motion vector as an original motion vector corresponding to the current image block.
6. The method according to any one of claims 1 to 4,
before obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template, the method further includes:
and determining the motion vector of the candidate image block of the current image block as the original motion vector corresponding to the current image block.
7. The method according to any one of claims 1 to 6, wherein the candidate image blocks comprise M first candidate image blocks and N second candidate image blocks, M being a natural number greater than or equal to 1, N being a natural number greater than or equal to 0, or M being a natural number greater than or equal to 0, N being a natural number greater than or equal to 1; the first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block;
the obtaining the template of the current image block according to the motion information of the candidate image block includes:
determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks;
determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks;
determining the first template as the template of the current image block; alternatively, the first and second electrodes may be,
determining the second template as the template of the current image block; alternatively, the first and second electrodes may be,
and determining the first template and the second template as the template of the current image block after splicing.
8. The method of claim 7,
the first candidate image block comprises an adjacent image block and/or a secondary adjacent image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; the prediction mode of the secondary adjacent image block is an inter-frame mode; the second candidate image block comprises an adjacent image block on the left side of the current image block and/or a secondary adjacent image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; and the prediction mode of the secondary adjacent image block is an inter-frame mode.
9. The method according to claim 7, wherein when M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or the P sub-templates, where P is the number of first candidate image blocks in the inter mode;
and when M is equal to 1, the first template comprises a first sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the upper side of the current image block.
10. The method according to claim 9, wherein the motion information comprises a motion vector and a reference frame index of the first candidate image block, and the determining the first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks comprises:
for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index;
determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block;
and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as the ith sub-template included in the first template according to the determined reference image block.
11. The method as claimed in claim 9, wherein determining the first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks comprises:
for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as an ith sub-template included by the first template; alternatively, the first and second electrodes may be,
determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a first transverse length and a first longitudinal length as an ith sub-template included by the first template;
and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
12. The method according to claim 10 or 11,
the first transverse length and the transverse length of the first candidate image block meet a first proportional relation, or the first transverse length and the transverse length of the current image block meet a second proportional relation, or the first transverse length and the transverse length of the current image block are equal to a first preset length;
the first longitudinal length and the longitudinal length of the first candidate image block meet a third proportional relation, or the first longitudinal length and the longitudinal length of the current image block meet a fourth proportional relation, or the first longitudinal length and the longitudinal length of the first candidate image block are equal to a second preset length.
13. The method according to claim 7, wherein when N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or the R sub-templates, where R is the number of second candidate image blocks in the inter mode;
and when N is equal to 1, the second template comprises a second sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the left side of the current image block.
14. The method according to claim 13, wherein the motion information comprises a motion vector and a reference frame index of the second candidate image block, and the determining the second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks comprises:
for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index;
determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block;
and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as the ith sub-template included by the second template according to the determined reference image block.
15. The method according to claim 13, wherein determining the second template according to the motion vector prediction mode and the motion information of the N second candidate image blocks comprises:
for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as an ith sub-template included by the second template; alternatively, the first and second electrodes may be,
determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a second transverse length and a second longitudinal length as an ith sub-template included by the first template;
and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
16. The method according to claim 14 or 15,
the second transverse length and the transverse length of the second candidate image block meet a fifth proportional relation, or the second transverse length and the transverse length of the current image block meet a sixth proportional relation, or the second transverse length and the transverse length of the current image block are equal to a third preset length;
the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or satisfy an eighth proportional relationship with the vertical length of the current image block, or are equal to a fourth preset length.
17. The method according to any one of claims 1 to 16,
the obtaining the template of the current image block according to the motion information of the candidate image block includes:
when the current image block corresponds to a plurality of pieces of motion information, obtaining a template corresponding to the motion information according to each piece of motion information;
and acquiring a weight parameter corresponding to each piece of motion information, and acquiring a template of the current image block according to the weight parameter corresponding to each piece of motion information and the template corresponding to the motion information.
18. The method according to claim 1, wherein obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template comprises:
determining the original motion vector as a central motion vector;
determining an edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector;
obtaining the coding performance of the central motion vector and the coding performance of the edge motion vector according to the template;
and determining the target motion vector from the central motion vector and the edge motion vector according to the coding performance of the central motion vector and the coding performance of the edge motion vector.
19. The method of claim 18,
determining an edge motion vector corresponding to the center motion vector, comprising: and shifting the central motion vector (x, y) to different directions by S to obtain edge motion vectors (x-S, y), edge motion vectors (x + S, y), edge motion vectors (x, y + S) and edge motion vectors (x, y-S) in different directions.
20. The method of claim 18, wherein obtaining the coding performance of the center motion vector and the coding performance of the edge motion vector according to the template comprises:
determining the coding performance of the central motion vector according to the parameter information of the template of the current image block and the parameter information of a first target reference block, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the central motion vector;
and determining the encoding performance of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of a second target reference block, wherein the second target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the edge motion vector.
21. The method of claim 18,
determining the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector, including:
selecting a motion vector with the optimal coding performance from the central motion vector and the edge motion vector;
when the motion vector with the optimal coding performance is not the original motion vector, determining the motion vector with the optimal coding performance as the target motion vector; and when the motion vector with the optimal coding performance is the original motion vector, selecting a motion vector with the suboptimal coding performance from the central motion vector and the edge motion vector, and determining the motion vector with the suboptimal coding performance as the target motion vector.
22. The method of claim 18,
before determining the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector, the method further includes:
judging whether an iteration end condition of the target motion vector is met;
if so, performing an operation of determining the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector;
if not, selecting the motion vector with the optimal coding performance from the central motion vector and the edge motion vector, determining the motion vector with the optimal coding performance as the central motion vector, and returning to execute the operation of determining the edge motion vector corresponding to the central motion vector.
23. A motion vector determination method, applied to an encoding side, comprising:
acquiring motion information of candidate image blocks of a current image block;
acquiring a template of the current image block according to the motion information of the candidate image block;
obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template;
and sending the coded bit stream to a decoding end according to the original motion vector and the target motion vector.
24. The method according to claim 23, wherein the candidate image blocks comprise M first candidate image blocks and N second candidate image blocks, M being a natural number greater than or equal to 1 and N being a natural number greater than or equal to 0, or M being a natural number greater than or equal to 0 and N being a natural number greater than or equal to 1; the first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block;
the obtaining the template of the current image block according to the motion information of the candidate image block includes:
determining a first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks;
determining a second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks;
determining the first template as the template of the current image block; alternatively, the first and second electrodes may be,
determining the second template as the template of the current image block; alternatively, the first and second electrodes may be,
and determining the first template and the second template as the template of the current image block after splicing.
25. The method of claim 24,
the first candidate image block comprises an adjacent image block and/or a secondary adjacent image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; the prediction mode of the secondary adjacent image block is an inter-frame mode; the second candidate image block comprises an adjacent image block on the left side of the current image block and/or a secondary adjacent image block; the prediction mode of the adjacent image block is an inter-frame mode or an intra-frame mode; and the prediction mode of the secondary adjacent image block is an inter-frame mode.
26. The method according to claim 24, wherein when M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or the P sub-templates, where P is the number of first candidate image blocks in the inter mode;
and when M is equal to 1, the first template comprises a first sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the upper side of the current image block.
27. The method of claim 26, wherein the motion information comprises a motion vector and a reference frame index of the first candidate image block, and wherein determining the first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks comprises:
for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index;
determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block;
and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as the ith sub-template included in the first template according to the determined reference image block.
28. The method as claimed in claim 26, wherein determining the first template according to the motion vector prediction modes and the motion information of the M first candidate image blocks comprises:
for an ith candidate image block in the M first candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a first transverse length and a first longitudinal length as an ith sub-template included by the first template; alternatively, the first and second electrodes may be,
determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a first transverse length and a first longitudinal length as an ith sub-template included by the first template;
and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
29. The method of claim 27 or 28,
the first transverse length and the transverse length of the first candidate image block meet a first proportional relation, or the first transverse length and the transverse length of the current image block meet a second proportional relation, or the first transverse length and the transverse length of the current image block are equal to a first preset length;
the first longitudinal length and the longitudinal length of the first candidate image block meet a third proportional relation, or the first longitudinal length and the longitudinal length of the current image block meet a fourth proportional relation, or the first longitudinal length and the longitudinal length of the first candidate image block are equal to a second preset length.
30. The method according to claim 24, wherein when N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or the R sub-templates, where R is the number of second candidate image blocks in the inter mode;
and when N is equal to 1, the second template comprises a second sub-template which is determined according to the motion vector prediction mode and the motion information of the first candidate image block on the left side of the current image block.
31. The method of claim 30, wherein the motion information comprises a motion vector and a reference frame index of the second candidate image block, and wherein determining the second template according to the motion vector prediction modes and the motion information of the N second candidate image blocks comprises:
for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an inter mode, determining a reference frame image corresponding to the ith candidate image block according to the reference frame index;
determining a reference image block corresponding to the ith candidate image block from the reference frame image according to the motion vector of the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector of the ith candidate image block;
and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as the ith sub-template included by the second template according to the determined reference image block.
32. The method as claimed in claim 30, wherein determining the second template according to the motion vector prediction mode and the motion information of the N second candidate image blocks comprises:
for an ith candidate image block in the N second candidate image blocks, when the motion vector prediction mode of the ith candidate image block is determined to be an intra-frame mode, filling the ith candidate image block according to a default value, and acquiring image blocks with the sizes of a second transverse length and a second longitudinal length as an ith sub-template included by the second template; alternatively, the first and second electrodes may be,
determining a reference frame image corresponding to the ith candidate image block according to the reference frame index corresponding to the ith candidate image block; determining a reference image block corresponding to the ith candidate image block from the reference frame image according to a motion vector corresponding to the ith candidate image block, wherein the relative position offset of the reference image block and the ith candidate image block is matched with the motion vector corresponding to the ith candidate image block; according to the determined reference image block, acquiring an image block with the size of a second transverse length and a second longitudinal length as an ith sub-template included by the first template;
and the reference frame index and the motion vector corresponding to the ith candidate image block are the reference frame index and the motion vector of an image block adjacent to the ith candidate image block.
33. The method of claim 31 or 32,
the second transverse length and the transverse length of the second candidate image block meet a fifth proportional relation, or the second transverse length and the transverse length of the current image block meet a sixth proportional relation, or the second transverse length and the transverse length of the current image block are equal to a third preset length;
the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or satisfy an eighth proportional relationship with the vertical length of the current image block, or are equal to a fourth preset length.
34. The method of any one of claims 23 to 33,
the obtaining the template of the current image block according to the motion information of the candidate image block includes:
when the current image block corresponds to a plurality of pieces of motion information, obtaining a template corresponding to the motion information according to each piece of motion information;
and acquiring a weight parameter corresponding to each piece of motion information, and acquiring a template of the current image block according to the weight parameter corresponding to each piece of motion information and the template corresponding to the motion information.
35. The method of claim 23, wherein obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template comprises:
determining the original motion vector as a central motion vector;
determining an edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector;
obtaining the coding performance of the central motion vector and the coding performance of the edge motion vector according to the template;
and determining the target motion vector from the central motion vector and the edge motion vector according to the coding performance of the central motion vector and the coding performance of the edge motion vector.
36. The method of claim 35,
determining an edge motion vector corresponding to the center motion vector, comprising: and shifting the central motion vector (x, y) to different directions by S to obtain edge motion vectors (x-S, y), edge motion vectors (x + S, y), edge motion vectors (x, y + S) and edge motion vectors (x, y-S) in different directions.
37. The method of claim 35, wherein obtaining the coding performance of the center motion vector and the coding performance of the edge motion vector according to the template comprises:
determining the coding performance of the central motion vector according to the parameter information of the template of the current image block and the parameter information of a first target reference block, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the central motion vector;
and determining the encoding performance of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of a second target reference block, wherein the second target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the edge motion vector.
38. The method of claim 35,
determining the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector, including:
selecting a motion vector with the optimal coding performance from the central motion vector and the edge motion vector;
when the motion vector with the optimal coding performance is not the original motion vector, determining the motion vector with the optimal coding performance as the target motion vector; and when the motion vector with the optimal coding performance is the original motion vector, selecting a motion vector with the suboptimal coding performance from the central motion vector and the edge motion vector, and determining the motion vector with the suboptimal coding performance as the target motion vector.
39. The method of claim 35,
before determining the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of the edge motion vector, the method further includes:
judging whether an iteration end condition of the target motion vector is met;
if so, performing an operation of determining the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector;
if not, selecting the motion vector with the optimal coding performance from the central motion vector and the edge motion vector, determining the motion vector with the optimal coding performance as the central motion vector, and returning to execute the operation of determining the edge motion vector corresponding to the central motion vector.
40. The method of claim 23, wherein sending the encoded bitstream to a decoding end according to the original motion vector and the target motion vector comprises:
acquiring the coding performance of the original motion vector and the coding performance of the target motion vector;
and when the coding performance of the target motion vector is better than that of the original motion vector, sending a coding bit stream carrying first indication information to a decoding end, wherein the first indication information is used for indicating that the final motion vector of the current image block is determined based on a template.
41. The method of claim 23, wherein sending the encoded bitstream to a decoding end according to the original motion vector and the target motion vector comprises:
acquiring the coding performance of the original motion vector and the coding performance of the target motion vector;
and when the encoding performance of the original motion vector is better than that of the target motion vector, transmitting an encoding bit stream carrying second indication information to a decoding end, wherein the second indication information is used for indicating that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block.
42. The method of claim 23, wherein sending the encoded bitstream to a decoding end according to the original motion vector and the target motion vector comprises:
acquiring an index value of the original motion vector in a motion vector list;
and sending the coded bit stream carrying the index value to a decoding end.
43. The method of claim 40 or 41,
acquiring the encoding performance of the original motion vector, comprising:
determining the encoding performance of the original motion vector according to the parameter information of the template of the current image block and the parameter information of a third target reference block, wherein the third target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the original motion vector;
acquiring the coding performance of the target motion vector, wherein the coding performance comprises the following steps:
and determining the coding performance of the target motion vector according to the parameter information of the template of the current image block and the parameter information of a fourth target reference block, wherein the fourth target reference block is an image block obtained after the reference image block corresponding to the template is subjected to offset based on the target motion vector.
44. A decoding-side apparatus, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute machine executable instructions to perform the method steps of any of claims 1-22.
45. An encoding side device, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute machine executable instructions to perform the method steps of any of claims 23-43.
CN201810692034.XA 2018-06-28 2018-06-28 Motion vector determination method and device Active CN110662074B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810692034.XA CN110662074B (en) 2018-06-28 2018-06-28 Motion vector determination method and device
PCT/CN2019/093709 WO2020001624A1 (en) 2018-06-28 2019-06-28 Method and apparatus for determining motion vector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810692034.XA CN110662074B (en) 2018-06-28 2018-06-28 Motion vector determination method and device

Publications (2)

Publication Number Publication Date
CN110662074A true CN110662074A (en) 2020-01-07
CN110662074B CN110662074B (en) 2021-11-23

Family

ID=68985404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810692034.XA Active CN110662074B (en) 2018-06-28 2018-06-28 Motion vector determination method and device

Country Status (2)

Country Link
CN (1) CN110662074B (en)
WO (1) WO2020001624A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022143215A1 (en) * 2020-12-31 2022-07-07 腾讯科技(深圳)有限公司 Inter-frame prediction method and apparatus, electronic device, computer-readable storage medium, and computer program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110188579A1 (en) * 2008-09-28 2011-08-04 Huawei Technologies Co., Ltd. Method, apparatus and system for rapid motion search applied in template switching
CN102215386A (en) * 2010-04-09 2011-10-12 华为技术有限公司 Video image block processing method and device
US20160309152A1 (en) * 2010-10-01 2016-10-20 Dolby International Ab Nested Entropy Encoding
CN106851312A (en) * 2010-07-09 2017-06-13 三星电子株式会社 Method and apparatus for being coded and decoded to motion vector
CN107113424A (en) * 2014-11-18 2017-08-29 联发科技股份有限公司 Bidirectional predictive video coding method based on the motion vector from single directional prediction and merging candidate
CN108134939A (en) * 2016-12-01 2018-06-08 北京金山云网络技术有限公司 A kind of method for estimating and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3646845B2 (en) * 1998-03-03 2005-05-11 Kddi株式会社 Video encoding device
CN102215387B (en) * 2010-04-09 2013-08-07 华为技术有限公司 Video image processing method and coder/decoder
CN102611886A (en) * 2011-01-22 2012-07-25 华为技术有限公司 Method for predicting or compensating motion

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110188579A1 (en) * 2008-09-28 2011-08-04 Huawei Technologies Co., Ltd. Method, apparatus and system for rapid motion search applied in template switching
CN102215386A (en) * 2010-04-09 2011-10-12 华为技术有限公司 Video image block processing method and device
CN106851312A (en) * 2010-07-09 2017-06-13 三星电子株式会社 Method and apparatus for being coded and decoded to motion vector
US20160309152A1 (en) * 2010-10-01 2016-10-20 Dolby International Ab Nested Entropy Encoding
CN107113424A (en) * 2014-11-18 2017-08-29 联发科技股份有限公司 Bidirectional predictive video coding method based on the motion vector from single directional prediction and merging candidate
CN108134939A (en) * 2016-12-01 2018-06-08 北京金山云网络技术有限公司 A kind of method for estimating and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022143215A1 (en) * 2020-12-31 2022-07-07 腾讯科技(深圳)有限公司 Inter-frame prediction method and apparatus, electronic device, computer-readable storage medium, and computer program product

Also Published As

Publication number Publication date
WO2020001624A1 (en) 2020-01-02
CN110662074B (en) 2021-11-23

Similar Documents

Publication Publication Date Title
KR101617740B1 (en) Method and device for encoding a sequence of images and method and device for decoding a sequence of images
JP5422168B2 (en) Video encoding method and video decoding method
CN110933426B (en) Decoding and encoding method and device thereof
TWI692246B (en) Image prediction decoding method
WO2012095466A1 (en) Video encoding and decoding with improved error resilience
CN111698500B (en) Encoding and decoding method, device and equipment
CN115348443A (en) Motion information determination method, device and equipment
CN110662033B (en) Decoding and encoding method and device thereof
CN110662074B (en) Motion vector determination method and device
CN112449180B (en) Encoding and decoding method, device and equipment
CN113794883B (en) Encoding and decoding method, device and equipment
CN112565747B (en) Decoding and encoding method, device and equipment
CN110691247B (en) Decoding and encoding method and device
CN110365987B (en) Motion vector determination method, device and equipment
CN113422951B (en) Decoding and encoding method, device and equipment
CN112055220B (en) Encoding and decoding method, device and equipment
CN112073734A (en) Encoding and decoding method, device and equipment
CN112468817A (en) Encoding and decoding method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant